• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Custom Food and Power System

Status
Not open for further replies.
Well, I need the custom food system and the power system. The original food system has a limit of 300, while I also need a separate power system (based on Yuri's Revenge power system).

Any ideas?

The custom food system should also include food produced by pre-placed food-generating structures, same as power system. A player can see friendly food and power by selecting on one of their generator structures by a game text.

Power system: Most of the base structures require power. for production structures, if there is not enough power, it will produce units more slowly. for defensive structure, it will not work. for superweapons, it will pause its superweapon ability etc.
 
Last edited:
Level 29
Joined
Oct 24, 2012
Messages
6,543
You need to give much more detail for the power system.

For food you can get rid of the old food and limit the unit creation if the player has used all their food. Use an integer array to store the good they have. And another integer array to store the amount of food used. You can use my system item and unit cost system to tell how much food a unit takes. Then you increase the amount of food used. It also detects units that increase max food.
Whenever a unit is created you check how much food it cost using my system. Then increase the integer array for that player based on if it increases max food or if it increase the food consumption. Then you set the players food resource to 0. ( not the arrayed resource just the one in the top right. ) this will prevent you from hitting the limit and implementing your own food system.
 
You need to give much more detail for the power system.

For food you can get rid of the old food and limit the unit creation if the player has used all their food. Use an integer array to store the good they have. And another integer array to store the amount of food used. You can use my system item and unit cost system to tell how much food a unit takes. Then you increase the amount of food used. It also detects units that increase max food.
Whenever a unit is created you check how much food it cost using my system. Then increase the integer array for that player based on if it increases max food or if it increase the food consumption. Then you set the players food resource to 0. ( not the arrayed resource just the one in the top right. ) this will prevent you from hitting the limit and implementing your own food system.

hmm... but can you write gui example for me? seems complicated......unless there's a gui image for me
 
Status
Not open for further replies.
Top