• 🏆 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!

[General] Limiting food acording to allies

Status
Not open for further replies.
Level 18
Joined
Jan 12, 2011
Messages
1,512
I need a system that uses the native function
Player - Set Player X (x) Food max X

That works like this, if the player is alone he has 300 food max, if he has 1 ally (they are two in total) each of them get 150 food available, if they are 3 allied each get 100 food available, if they are 4 or more they all get 75 food max.
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
It won't be accurate, though - that number can only be integer, but if you have 7 players, then it would make 42,85 food per player, which will make it round down to 42.
That way you would distribute 294 food instead of if you have 7 players.

I think this is it
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set Integer_var = (Integer((300.00 / (Real((Number of players in (All players controlled by a User player)))))))
      • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Food cap to Integer_var
It may be Food max instead of Food cap (not sure which one it is atm)
You may also need to go to Gameplay Constants and change Food Limit to 300
 
Last edited:
Level 18
Joined
Jan 12, 2011
Messages
1,512
Yeah you are right it's food max, and about gameplay constants i already did

edit:

isn't your system just made for player 1?


The system i'm making is for a game with 12 players each in a diferent alliance group
 
Last edited:
Status
Not open for further replies.
Top