• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How to best penalize a player for overpopulation?

Status
Not open for further replies.
Level 13
Joined
Jun 9, 2008
Messages
261
As you all know, it's quite possible to have more units than available food, the only immediate consequence being that you cannot train additional units.

My question is, what would be the best way to simulate things like exposure and starvation? In such a way that a player who doesn't make sure to protect their food supply will start losing units and the like. Ideally, you'd have something like "Player used food > Player available food => Periodic event where select random unit from units controled by Player and reduce HP by X". I've looked for trigger options, but I don't really see anything that would get it done.
 
Level 11
Joined
Jun 2, 2004
Messages
849
Something like this?
  • Untitled Trigger 001
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) Food used) Greater than ((Picked player) Food max)
            • Then - Actions
              • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is Mechanical) Equal to False
                      • ((Picked unit) has buff Invulnerable) Equal to False
                      • (Level of Invulnerable (Neutral) for (Picked unit)) Equal to 0
                      • ((Picked unit) is dead) Equal to False
                    • Then - Actions
                      • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 10.00)
                    • Else - Actions
            • Else - Actions
It leaks a unit group but I was too lazy to fix that.
 
Level 13
Joined
Jun 9, 2008
Messages
261
Something like this?
  • Untitled Trigger 001
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) Food used) Greater than ((Picked player) Food max)
            • Then - Actions
              • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is Mechanical) Equal to False
                      • ((Picked unit) has buff Invulnerable) Equal to False
                      • (Level of Invulnerable (Neutral) for (Picked unit)) Equal to 0
                      • ((Picked unit) is dead) Equal to False
                    • Then - Actions
                      • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 10.00)
                    • Else - Actions
            • Else - Actions
It leaks a unit group but I was too lazy to fix that.
That's kinda somewhat 100% what I've been looking for. Thanks for taking the time! I just started using triggers to deal with problems, and aparently I have a much smaller insight into how it all fits together than I thought. There's several things in there that will be very useful to me.
 
Last edited:
Level 19
Joined
Jul 2, 2011
Messages
2,162
let's look at it from a realistic front

when a country is over populated they have less food, less jobs, less housing, and more riots, more disease, more theft, more crime

if you want to make those into an effect the best way to do so would to make it into an upgrade that every unit has, giving negative values instead of positive values would conversely affect them.

food shortage would account for hunger, lower attack damage and health regeneration

less jobs and theft would damage their moral and sense of security, lower armour rating

more disease I'm sure you could trigger a random disease cloud every now and then.

why I say an upgrade would be a better solution is because it would results in less buffs showing up on every unit. it can also be switched on and off via trig, while a buff could still last even after the buff source has been killed.

1 upgrade can hold 4 effects so you should have no problem setting that up.

remember shift click allows you to input any value positive or negative
 
Last edited:
Level 7
Joined
Jan 23, 2011
Messages
350
Upgrades are too static to use in a game mechanic such as Overpopulation, you can jump from side to side and reach the upgrades limits 'easily' unless you use 99999 lvls upgrades, which Can't be created inside the editor and would require him to understand working directly with the MPQ.

I think the initial trigger from Kaijyuu is the best way to go, maybe adding a chance to lower a stat using a buff like cripple, so is easier to remove the effect(simply by changing the duration in object editor)
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Upgrades are too static to use in a game mechanic such as Overpopulation, you can jump from side to side and reach the upgrades limits 'easily' unless you use 99999 lvls upgrades, which Can't be created inside the editor and would require him to understand working directly with the MPQ.

I think the initial trigger from Kaijyuu is the best way to go, maybe adding a chance to lower a stat using a buff like cripple, so is easier to remove the effect(simply by changing the duration in object editor)

I don't understand what limits you are talking about in upgraded

unless this hive wants to change their units health to- 99999 there are no real limitations.
 
Level 7
Joined
Jan 23, 2011
Messages
350
I'm talking about max lvl upgrade. You can't go to the editor and put 99999 lvls on an upgrade, it crashes(or at least takes you a lot of downtime creating it, editing it AND saving the map)

Also, you don't seem to see that once you go overpopulation you can go down the overpopulation and the debilitation dissapear, which will require another upgrade to negate your previous upgrade. That lil "go up" and "go down" could be a nightmare as an editor
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
I'm talking about max lvl upgrade. You can't go to the editor and put 99999 lvls on an upgrade, it crashes(or at least takes you a lot of downtime creating it, editing it AND saving the map)

Also, you don't seem to see that once you go overpopulation you can go down the overpopulation and the debilitation dissapear, which will require another upgrade to negate your previous upgrade. That lil "go up" and "go down" could be a nightmare as an editor
the limit of upgrades is 4, and I'm guessing this hive only needs 4 penalties for over population

and you do realise upgrades can be turned on and off from trigs right? and unlike buffs it's an instant change with no lasting effect either way
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
why I say an upgrade would be a better solution is because it would results in less buffs showing up on every unit. it can also be switched on and off via trig, while a buff could still last even after the buff source has been killed.
and you do realise upgrades can be turned on and off from trigs right?
This is Warcraft III and not StarCraft II. Unlike StarCraft II, in Warcraft III you cannot "unresearch" an upgrade. Once an upgrade is applied via triggers or researched by a unit it is permanent and will effect the player until the end of game. Trying to set an upgrade for a player to a level lower than it currently is via triggers does nothing, one can only increase upgrade levels and never decrease them.

There is a reason no one ever uses upgrades for this kind of thing...
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
This is Warcraft III and not StarCraft II. Unlike StarCraft II, in Warcraft III you cannot "unresearch" an upgrade. Once an upgrade is applied via triggers or researched by a unit it is permanent and will effect the player until the end of game. Trying to set an upgrade for a player to a level lower than it currently is via triggers does nothing, one can only increase upgrade levels and never decrease them.

There is a reason no one ever uses upgrades for this kind of thing...
Really!?

hmm oh well I'll take your word for it
 
Status
Not open for further replies.
Top