• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Structure to Give Different Amounts of Food

Status
Not open for further replies.
Level 3
Joined
Apr 18, 2008
Messages
44
I am currently attempting to create a structure that will have the ability to produce twice as much food as it normally does, but still have the capability to return to its normal form. Unfortunately all of my attempts so far have failed.

First I tried giving the ability a Bear Form based ability. But this does not work, because when the structure morphs, it begins to infinitely play its build animation. I have tried to use triggers to order it not to do so, but it has not worked so far. Is it possible to fix this?

My second attempt was giving it Immolation. When it would activate Immolation, with triggers I would add to the player's food cap, and when it was deactivated that extra food would be removed. Unfortunately the integers of how much food ought to be removed began to bug and multiple on their own. I remade the trigger, and yet it would continue to bug, removing wrong amounts of food.

My third attempt was to simply remove the structure via triggers and replace in its place the other form of the structure which provides more food. However, if this takes place when a unit is next to the structure, then the structure feels as though there is not enough space where the older form was, and so the triggers create the newer one a bit off from where the older one was. Jumping structures - while amusing - are something I would like to avoid. Is there any way to possibly make the nearby unit(s) not interfere with the structure?
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Simply make a dummy ability with a turn on/off icon. When activated, set max food of the owner to whatever you want it to produce when activated + the max food that player already has. When deactivated, set max food of the owner to the current food - what you added to it.

If a turn on/off ability doesn't work, make a normal ability. When used, check the Custom Value of the building. If it's 0, set it to 1 and increase the max food as explained above. If the Custom Value is 1, set it to 0 and decrease the max food also like I explained above.
 
Level 9
Joined
Apr 28, 2009
Messages
538
You could use "Upgrade" instead of "Ability".
Let's say you have "Farm +5 Food" and "Farm +10 Food", and when you bild "Farm +5 Food", this structure will have the ability to upgrade to "Farm +10 Food". Of course, the "Farm +10" will have the ability to be "upgraded" to "Farm +5".
I guess it's one of the easiest way to get this thing work.
 
Level 3
Joined
Apr 18, 2008
Messages
44
Both good suggestions, but Avator's is exactly what my second attempt was, and unfortunately upgrading a structure forces it to enter into its build animation, which is something I would like to avoid if possible.
 
Status
Not open for further replies.
Top