1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Ride into the sunset with the 32nd Modeling Contest.
    Dismiss Notice
  4. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  5. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

How to best penalize a player for overpopulation?

Discussion in 'World Editor Help Zone' started by Verdun, Nov 16, 2017.

  1. Verdun

    Verdun

    Joined:
    Jun 9, 2008
    Messages:
    140
    Resources:
    4
    Models:
    4
    Resources:
    4
    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.
     
  2. Kaijyuu

    Kaijyuu

    Joined:
    Jun 2, 2004
    Messages:
    848
    Resources:
    0
    Resources:
    0
    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.
     
  3. Verdun

    Verdun

    Joined:
    Jun 9, 2008
    Messages:
    140
    Resources:
    4
    Models:
    4
    Resources:
    4
    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: Nov 16, 2017
  4. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,930
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    One could apply a debuff aura, such as negative command or endurance aura. This could make the units a lot weaker than normal, eg -50% damage, so that it really is not worth keeping above the food cap.
     
    Last edited: Nov 18, 2017
  5. TheLordOfChaos201

    TheLordOfChaos201

    Joined:
    Jul 2, 2011
    Messages:
    1,732
    Resources:
    0
    Resources:
    0
    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: Nov 18, 2017
  6. Marcos_M

    Marcos_M

    Joined:
    Jan 23, 2011
    Messages:
    347
    Resources:
    0
    Resources:
    0
    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)
     
  7. TheLordOfChaos201

    TheLordOfChaos201

    Joined:
    Jul 2, 2011
    Messages:
    1,732
    Resources:
    0
    Resources:
    0
    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.
     
  8. Marcos_M

    Marcos_M

    Joined:
    Jan 23, 2011
    Messages:
    347
    Resources:
    0
    Resources:
    0
    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
     
  9. TheLordOfChaos201

    TheLordOfChaos201

    Joined:
    Jul 2, 2011
    Messages:
    1,732
    Resources:
    0
    Resources:
    0
    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
     
  10. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,930
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    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...
     
  11. TheLordOfChaos201

    TheLordOfChaos201

    Joined:
    Jul 2, 2011
    Messages:
    1,732
    Resources:
    0
    Resources:
    0
    Really!?

    hmm oh well I'll take your word for it
     
  12. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,930
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    You do not have to take my word for it. You can always create a simple test map to try and prove me wrong.
     
  13. TheLordOfChaos201

    TheLordOfChaos201

    Joined:
    Jul 2, 2011
    Messages:
    1,732
    Resources:
    0
    Resources:
    0
    that is so much work, and besides, my computer isn't doing so well :(