requirements for building units

requirements for building units

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
thedude
Posts: 66
Joined: 21 Aug 2009, 12:47

requirements for building units

Post by thedude »

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.
Master-Athmos
Posts: 916
Joined: 27 Jun 2009, 01:32

Re: requirements for building units

Post by Master-Athmos »

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)...
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: requirements for building units

Post by FLOZi »

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
thedude
Posts: 66
Joined: 21 Aug 2009, 12:47

Re: requirements for building units

Post by thedude »

Many thanks.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: requirements for building units

Post by AF »

I released a lua gadget ages and ages ago for XTA that did something like this
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: requirements for building units

Post by Forboding Angel »

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.
thedude
Posts: 66
Joined: 21 Aug 2009, 12:47

Re: requirements for building units

Post by thedude »

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?
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: requirements for building units

Post by REVENGE »

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?
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.

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.
thedude
Posts: 66
Joined: 21 Aug 2009, 12:47

Re: requirements for building units

Post by thedude »

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).
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Re: requirements for building units

Post by Caydr »

You need metal and energy.
Post Reply

Return to “Game Development”