requirements for building units
Moderator: Moderators
requirements for building units
Is it possible to define requirenent for buuilding units? I mean you want to build a factory but you are not allowed until you build something else. I had a look at some page dealing with fbi files but could not find such thing.
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: requirements for building units
Not out of the box - you'd have to use Lua for something like that. Maybe have a look at the morph gadget which has some logic for making morphing only possible in certain cases (one of them e.g. being the need of having a specific building)...
Re: requirements for building units
S44 has something like this; engineers can only build vehicle factories after they have built a barracks for example.
Gadget code is here:
http://spring1944.svn.sourceforge.net/v ... iew=markup
Example defs here:
http://spring1944.svn.sourceforge.net/v ... iew=markup
Gadget code is here:
http://spring1944.svn.sourceforge.net/v ... iew=markup
Example defs here:
http://spring1944.svn.sourceforge.net/v ... iew=markup
Re: requirements for building units
I released a lua gadget ages and ages ago for XTA that did something like this
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: requirements for building units
That lua gadget has serious issues tho. I had to remove it from evo because of extremely odd behavior (keep in mind this was like 2 1/2 years ago).
Not sure it's your fault tho.
Not sure it's your fault tho.
Re: requirements for building units
I'm new to spring and I am playing with some mods to figure out how mods work and what things I need to make a mod. Is this gadget "modindependent"? I mean can I use it for every mod? I think I have to change the names in the "prereq_defs" file but have I to change things in other files for example tell spring to use this gadget or things like that?
Re: requirements for building units
Whether or not a gadget is mod dependent is completely dependent upon the gadget. Certain gadgets have "hard coded" criterion, but since everything is in lua you can go and modify them to suit your needs / mods.thedude wrote:I'm new to spring and I am playing with some mods to figure out how mods work and what things I need to make a mod. Is this gadget "modindependent"? I mean can I use it for every mod? I think I have to change the names in the "prereq_defs" file but have I to change things in other files for example tell spring to use this gadget or things like that?
You do not need to specify Spring to use a gadget. As long as you include the gadget in the right folder in your mod archive ( /LuaRules/Gadgets) they will be run automatically.
Re: requirements for building units
AWESOME!
It worked for me. I just changed the names of units to fit my units in the "prereq_defs" file and it worked! I don't know if it only worked because I tried it with a very basic mod (I don't even know if I can call it a mod).
It worked for me. I just changed the names of units to fit my units in the "prereq_defs" file and it worked! I don't know if it only worked because I tried it with a very basic mod (I don't even know if I can call it a mod).
Re: requirements for building units
You need metal and energy.