PDA

View Full Version : How to: Limit the amount of Units in battle


rebel5555
10th Oct 06, 9:16 PM
This tutorial will expalin how to limit how many of a certain unit you can have at once.

If you want a better reference than the pictures that I will use for this, open sbps\races\axis\soldiers\officer_squad.lua and goto
(squad_requirement_ext)
(requirement_table)
(required_1)

First things first, find the unit that you want to limit.

(For Example: sbps\races\allies\soldiers\ranger_elite.lua)

Next open the rgd file of that unit and find (squad_requirement_ext)

Now expand the tab and you should see (requirement_table)

http://img242.imageshack.us/img242/3126/untitledig6.jpg (http://imageshack.us)


Under required_1 we will be adding tags to it, So right click on required_1 and click add child. Now lets name our child (no pun intended) max_squad_cap.

http://img143.imageshack.us/img143/3098/untitledpo8.jpg (http://imageshack.us)

Next, use the same steps that we used to add our child (max_squad_cap) to add the folowing child
(squad_name)

http://img143.imageshack.us/img143/7232/untitledup7.jpg (http://imageshack.us)

Now click on required_1 find the reference tag and add this (requirements\required_squad.lua) to it.

Then, click on the child (max_squad_cap) and change the data type to Number. Under value is where you put how many units that you want to be built.

Finally, click on (squad_name) and change the data type to text. Under value put the name of your squad.
(for example: sbps\races\allies\soldiers\ranger_elite.lua) Below you should see what it will look like if you were to click required_1.

http://img143.imageshack.us/img143/5103/untitledjc0.jpg (http://imageshack.us)

Make sure that the child (reason) has usage for it's value. Also, If you are wondering what the child (ui_name) is for go here: http://forums.relicnews.com/showthread.php?t=112051

I hope this helps people who want to limit certain units such as the howitzer.

Kyranzor
11th Oct 06, 2:46 AM
gee thanks awesome info (seriously, now i can limit number of schnipers! ahh teh scharfshutze!)

djukel
11th Oct 06, 1:51 PM
As I saw It is working without defining squad_name. Why it is important?

rebel5555
11th Oct 06, 11:37 PM
As I saw It is working without defining squad_name. Why it is important?

Honestly, I haven't got a clue. If you were wondering how I figured out to limit the amount of units was that I copied the code from the rgd file for the german officer.

solecist
13th Oct 06, 3:19 PM
is this working for anybody? i still get the bug where it can't finish the last unit. this is unbelievably frustrating

solecist
13th Oct 06, 8:48 PM
after a second glance i find that it works for some things but not for others. for instance it works fine with shermans, but not for snipers. sheesh.

Kyranzor
21st Oct 06, 6:23 PM
if you cant finish the last unit, then you probably need to make the requirment reference not for "required_squad" but for "required_squad_cap"

maxfly77
17th Jan 07, 1:05 PM
Ok it work I made one jeep at time...but i want to build one in the battle and unable that build another....???

max

captfinlay
27th Jan 07, 9:38 AM
Awesome help, been trying to figure out ages how to limit. sorry at above post for being rude

maxfly77
28th Jan 07, 9:54 AM
The question is simple, with max_cap and squad_name, u have on the field limited number of units, but if one of this units will be kia will be replaced... I will that not be replaced.

max

STEAL
28th Jan 07, 12:53 PM
Hey captfinlay he is trying to speak english obviously he is not of English speaking descent so give him a break. You can still get the jist of what he is asking, if not ask him to clarify.

Radeon
31st Jan 07, 8:48 PM
i can understand him, he want to say that what he wants. is that he can build in total only two jeeps.

but if he build two jeeps and one gets killed, he can build another one. he wants not that to happen. but i dont hink if thats possible

fldash
1st Feb 07, 10:10 AM
That's possible only using SCAR. I'm trying to do something similar but have yet to figure it out completely.

I want to hard limit the number of paradrops (and other abilities) regardless of anything else.

So, paradrop would only be able to be executed 2 times max.

JagerMeister101
6th Mar 09, 12:31 PM
Hey i have a question, how do you limit or unlimit commander ability units? and which module file do you open to edit it in corsix's editor?
Thanks