Page 1 of 1
Limit individual units ...
Posted: Sun Feb 24, 2013 2:40 pm
by AlvioWayne
Welcome all!
I expose units (eg sniper) how many of them should be on the map (minimum and maximum).
sniper = {"rep_inf_ep3_sniper", 1, 2},
1 - minimum
2 - maximum snipers on the map
But acts only on the AI, but the player does not count!
Ie, if your card has two snipers, then I can be a third ...
I also need to get the choice of a unit indicates how much of the map and how many can be maximum, and if their have two, I can not select and play for him.
I've seen many mods that, but how to make them do not know.
I do not know where to look ...
Waiting for an answer ...
Re: Limit individual units ...
Posted: Sun Feb 24, 2013 6:12 pm
by kinetosimpetus
If you add
Code: Select all
PointsToUnlock = 4 //or any number you want
to the unit .odf, it will enforce the maximum for human players as well.
Re: Limit individual units ...
Posted: Sun Feb 24, 2013 7:41 pm
by Loopy53
AlvioWayne wrote:Ie, if your card has two snipers, then I can be a third ...
what? I think you meant map?
Re: Limit individual units ...
Posted: Mon Feb 25, 2013 6:39 am
by AlvioWayne
PointsToUnlock = 4 what I need ...
But need unit was available immediately.
PointsToUnlock = 0, the result does not give, all the same that the functions do not.
what? I think you meant map?
Let's just say I have on map the two Jedi
(one for playing AI, for the other I).
But in the sum on map should be only one.
And play or should I or PC.
Simultaneously should not be!
Re: Limit individual units ...
Posted: Mon Feb 25, 2013 2:24 pm
by Loopy53
set the maximum 1 less maybe? lets say you have 4 ai + you but you only want 4 total so set the max ammount of AI to 3 then when you spawn there will be maximum of 4. I hope this makes sense/I am making sense of what you want.
Re: Limit individual units ...
Posted: Mon Feb 25, 2013 3:41 pm
by AlvioWayne
On the map should be only one Jedi.
And if the Jedi is AI, I can not select it, and vice versa.
Parameter PointsToUnlock - almost what I need ...
Just with him a Jedi is not available immediately.
Or give the player at once one point ...
All units with the option PointsToUnlock opened initially.
Re: Limit individual units ...
Posted: Mon Feb 25, 2013 5:56 pm
by Loopy53
We understand if English is not your first language, but I am having a hard time understanding you. Could you re-word that somehow? English in school was always hard for me.
How are droidekas, dark/jet troopers, and wookies limited in the number available? it says maximum 4, how is that done? I don't think its PTU (Points To Unlock).
Re: Limit individual units ...
Posted: Mon Feb 25, 2013 6:40 pm
by kinetosimpetus
The lua sets the minimum and maximum that specifies how AI choose what class to play.
For a sniper in a stock script, it's min = 1, max = 4, so AI will always try to have at least 1 sniper playing at once, and if there's already 4, will check other classes, but may still spawn as a sniper, and so can humans, beyond the 4 maximum.
However, with PointsToUnlock > 0 units, the maximum value changes from a guideline to a hard limit and a 5th sniper would be impossible. Also, AI would only spawn 3 so the player can spawn as one as well.
Re: Limit individual units ...
Posted: Mon Feb 25, 2013 6:46 pm
by Loopy53
Seems to me like PTU is what you need then. Perhaps set it to a really low number? you could try a decimal. anyhow, best of luck.
Re: Limit individual units ...
Posted: Wed Feb 27, 2013 7:43 pm
by SAMofBIA
decimal wouldn't work, the game can't give you a fractional value.
Re: Limit individual units ...
Posted: Fri Mar 01, 2013 7:31 am
by CressAlbane
I think setting PointsToUnlock to 1 and then giving the player 1 point when he spawns is a good idea.
Re: Limit individual units ...
Posted: Fri Mar 01, 2013 7:47 pm
by Loopy53
Yes, actually, that would (in theory) work! Now why didnt I think of that?

Give it a shot, AlvioWayne, and tell us if it works
