Just got an idea.
I would like to have randomised HP for all units as a MOD. Not complete random but with a min and max range. The HP should follow normal distribution as in the real world some people are short, some long, some heavy and some light. Example: villager HP can be randomised in the range of 15-35 with most villagers having nearby 25 HP.
Any Ideas or suggestions on how to do it?
Just got an idea.
that might be an awesome mod for fun games ( T90 community game?) love the idea
I like this idea, but unfortunately the game mechanics are limited in a way that would make this impossible. However, there is a way to make this work by use of triggers within the scenario editor. If you would like for me to explain some methods to make this feature work, let me know.
Yeah I am more than eager to know.
Alright, I will detail the concept, and then if you have any questions on any of the steps, just let me know.
This method works best for fixed setup scenarios, as it will be difficult to track unit creations across the entire map without an extremely impractical amount of triggers. It is still theoretically possible for non-fixed setup scenarios, but you would have to use several hundreds of triggers with Objects in Area conditions to detect when a specific building has been built, and then detect when a specific unit has been created at that building.
I am going to use the Barracks for this example.
- Place a Barracks on your map.
- Create a new trigger with an “Objects in Area” condition. Draw the area around the entire Barracks, plus one additional tile around its perimeter. Set the desired player number, and select the unit type to detect in the area. Set the number of objects to 1. (This will detect when the specified unit has been created at any tile adjacent to the Barracks.) Set this trigger to “Loop”.
- Create another condition for this trigger. Select the “Timer” condition. Set the timer to 2 second.
- Create an effect for this trigger. Select the “Change Object HP” effect. Select the same area around the Barracks as you did with the “Objects in Area” condition. Specify the same unit type and choose the operator. I recommend choosing “set”. Then choose the amount of hit points.
- Create another effect for this trigger. Select the “Attack Move” effect. Set the area around the Barracks the same as before, specify the unit type, and then choose the desired location that you want the unit to move to. (You must add this effect, otherwise, your unit will risk having his hit points altered multiple times if he remains adjacent to the Barracks after spawning.)
- You will need to create three or four more of the same trigger that you just made, and alter the “Timer” amount and the “Change Object HP” operator and amount in order to simulate the effect of randomizing the hit points for each new unit that spawns. You want to have triggers that fire every 2, 3, 4, 5, and 6 seconds, and have the HP to whichever number you want within your range.
- If it takes too long for your unit to move out of the area before another trigger fires, then you may want to add a separate trigger to handle the “Attack Move” effect that has a delayed timer, and then extend the time of the other triggers. Essentially, you want the following operation to happen:
a. You train a new unit.
b. When the new unit spawns, a trigger detects the unit in the area and fires the “Change Object HP” trigger.
c. The unit is automatically instructed to move away from the Barracks.
- You will also need to create trigger that fires when the Barracks is destroyed, and set the effects to disable all of the previous triggers.
- Because the Barracks can have multiple unit types (i.e. Militia, Man-at-Arms, Longswordsman, Two-Handed Swordsman, Champion, Spearman, Pikeman, Halberdier, Eagle Scout, Eagle Warrior, and Elite Eagle Warrior), you will need to make the same series of triggers for each unit type (depending on the civ being played, of course). – Once complete, you should have about 35-55 triggers just to handle this one building.
Because each unit type is its own “class”, so to speak, you cannot simply use the “Modify Attribute” trigger to change the hit points of one unit of its type. For example, if you use “Modify Attribute” to change the hit points of a Militia unit, it will affect all Militia units, not just one of them. Therefore, you will have to set several triggers per building to make your idea work.
If you are trying to use this function for use in multiplayer, keep in mind that players would have the ability to exploit the “Change Object HP” effect by sending injured troops back to the Barracks for an instant heal. You can attempt to negate this exploit with additional triggers, but I can foresee it being difficult to eliminate completely.
Sounds complicated but i will give it a try.
Sounds very interesting!