Page 2 of 3
Re: Can someone make the Units Cap infinite?
Posted: Tue Jun 05, 2018 8:55 pm
by TommyCD1
Don't forget the Bulldozer and any other heroes also cost unit limit. Also to note is that this game's engine has a strange glitch where if you exceed the unit limit, for example by dropping paratroopers at the limit, then all construction gets blocked, regardless if it costs limit or not... this includes air strikes and things that cost 0 limit. It's pretty annoying and happens often if you using more than one facility at a time.
Unit Limit Code & another way to have unlimited troops
Posted: Fri Jun 15, 2018 10:03 pm
by Secg
I've tested the DR2 Unit Limit quote once again; & found out it actually works
in Campaign, Multiplayer, & Instant Action:
However, to prevent online desyncing, all players involved must have their
base.x modded to contain the same
limit.cfg file with the exact same numerical value for Unit Limit.
Another way is simply change all units' & heroes' Command Cost to (0)
Code: Select all
///////////////////////////////////////////////////////////////////////////////
//
// Copyright 1997-2000 Pandemic Studios - Dark Reign II
//
// Unit Construction Limits
//
Limit(150);
Re: Unit Limit Code & another way to have unlimited troops
Posted: Wed Jul 17, 2019 11:26 am
by j3rry
Secg wrote: ↑Fri Jun 15, 2018 10:03 pm
Does not work for me. Are you sure that is the limit command is correct? I have created limit.cfg with Limit(1), but I can still produce units in Campaign, Great Battles and Multiplayer modes.
Re: Can someone make the Units Cap infinite?
Posted: Wed Jul 17, 2019 4:26 pm
by Secg
You're right,
j3rry!. The DR2 Limit function does not work! Or does it only work because I had a Trainer on last time
? Can't tell!
Still,
I was wrong!
To raise the unit limit cap, I have to code an individual objective for each Individual player in each individual map. Like this:
Code: Select all
CreateObject("obj_unitlimit_player_1", 3144)
{
ObjectiveObj()
{
Condition();
}
}
CreateObjectType("obj_unitlimit_player_1","Objective")
{
Condition("TRUE");
Action()
{
SetUnitLimit(100);
}
}
Re: Can someone make the Units Cap infinite?
Posted: Wed Jul 17, 2019 10:25 pm
by j3rry
Secg wrote: ↑Wed Jul 17, 2019 4:26 pm
It is too bad, because in this case need to repack all maps.
Though I need only remove this limit, so I can use CommandCost(0) for that.
Re: Can someone make the Units Cap infinite?
Posted: Thu Jul 18, 2019 7:22 am
by Secg
Well, the reason I prefer raising Individual Unit Limit Caps (to 140) (through Clunky coding for each Individual player in each map) is because I want to raise unit's CP & want players of my Heroic 1.1 mod to wisely manage their Unit Composition (e.g. a player can have
four times(!) as many grunts as they can have tanks):
- Buildings, Bulldozer, Dumptruck: 1 CP
Minesweeper, Radio: 1 CP
Grunt: 1CP (Let the Grunt Rush begin! )
All other Infantries: 2 CP
Minelayer, Medic, Dumdum: 2 CP
Halftrack, Chopper: 3 CP
Tank: 4 CP (tank-spammers beware! )
Guardtower: 2 CP
Pillbox: 3 CP
AAgun, BWpost: 1 CP
Sarge or any other Hero: 1CP
I don't feel like writing a code to either (a) allow the Barracks to mass-produce Heroes (though with absurdly high Plastic costs & 10 CP
for balance's sake) or
(b) spawn another Hero when your current one is Wounded even though I think I can
Re: Can someone make the Units Cap infinite?
Posted: Thu Jul 18, 2019 8:02 am
by j3rry
Secg wrote: ↑Thu Jul 18, 2019 7:22 am
Yes, that is pretty good idea. I was thinking to do it like that. But some of maps, especially large ones, have standart 70 unit limit, so I have to recompile them in that case which is not good idea by itself, because players must download recompiled maps.
Re: Can someone make the Units Cap infinite?
Posted: Thu Jul 18, 2019 8:14 am
by Secg
j3rry wrote: ↑Thu Jul 18, 2019 8:02 am
Secg wrote: ↑Thu Jul 18, 2019 7:22 am
But some maps (especially large ones) have standard 70 unit limit
So far, I have only successfully raised Unit Limit for Story & Campaign Missions, not Multiplayer ones
.
types_common.cfg and ruleset
Posted: Thu Jul 18, 2019 12:29 pm
by Secg
I think I figure out another way to both increase the unit limit cap without the need to code it directly into the map as individual team's objective
Using NotepPad++ to convert
base.x to
base.zwp & extract files
Open
base >
misc >
types_common.cfg
Create this objective
Code: Select all
CreateObjectType("common.unitlimit", "Objective")
{
Condition("TRUE");
Action()
{
SetUnitLimit(100);
}
}
Open
mods >
ruleset
Using NotepPad++ to convert
protect.x to
protect.zwp & extract files
Open
protect >
mod.cfg
Add this code line
Code: Select all
NewObjective("common.unitlimit");
Before
Code: Select all
StartActionAvailable()
{
CreateVarFloat("@.timeleft", 180);
NewObjective("protecthq.check");
NewObjective("common.killallenemy");
NewObjective("common.aivictory");
NewObjective("common.eliminate");
}
After
Code: Select all
NewObjective("common.unitlimit");
CreateVarFloat("@.timeleft", 180);
NewObjective("protecthq.check");
NewObjective("common.killallenemy");
NewObjective("common.aivictory");
NewObjective("common.eliminate");
Repeat the same steps above for
sarge.x's
mod.cfg and
's mod.cfgkoth.x
Exceptions
Posted: Thu Jul 18, 2019 12:38 pm
by Secg
However, instead of coding a ruleset, such as
The mapmaker(s) choose(s) not to, as in
s15.x
Then unit limits must be directly coded into the map