You must be logged in to post messages.
Please login or register

Scenario Design and Discussion
Moderated by HockeySam18

Hop to:    
Welcome! You are not logged in. Please Login or Register.11 replies
Age of Kings Heaven » Forums » Scenario Design and Discussion » a way to set HP for generated units?
Bottom
Topic Subject:a way to set HP for generated units?
kammerjaeger
Squire
posted 06-17-13 07:07 AM CT (US)         
I'm looking for a way to increase or set HP for specific units in scenario editor.

Situation:
i'm trying to create a "tower defense"-map in AoE: Units, generated with triggers, walk to a given point on the map and the player should try to avoid this.

Problem:
After a while, the generated units should get stronger (more HP). For this, there's an effect given by the game. But this affects only already generated units, all units which will be generated later, are not affected of this effect. If i set it as trigger, units will have increased the HP multiple times. and if i set an additional condition, so the HP will increase only if they are in a selected area, some units are too fast to get stronger and others are so slow that they will also have increased the HP multiple times.


Question:
Is there an option / hack / trick to solve my problem?

thanks for your help
AuthorReplies:
BF_Tanks
Squire
posted 06-17-13 08:17 AM CT (US)     1 / 11       
Okay, So basically what you want is a trigger that stops the whole "Clogging up" of the unit's gaining stats. Pretty simple.

So, You have your Spawn Trigger:

Conditions:
Timer - ##

Effects:
Remove Object - Area where new unit is being created.
Create Object - Whatever unit you're creating
Damage Object - (Negative) ### for HP.
Task Object - Unit Spawned to Location

And that's it.
Firstly, you remove any unit that is sitting on the buff zone, which is where we create the next unit. The next unit gets created, and a negative damage object trigger adds HP to it (Negative damage object triggers means your unit can have over 32768 HP without dying.) and then finally you task the unit, all in one trigger.

Proud Member of Black Forest Studios
Co-creator of Silent Evil - Voted Best Multiplayer Scenario of 2009
and The Seas of Egressa - Voted Best Multiplayer Scenario of 2010
Impeached
VIP (Reverie World Studios)
(id: MeGaIdIoT)
posted 06-17-13 12:57 PM CT (US)     2 / 11       
..Alternatively, you can create the unit for one player, then change its HP, then change the ownership to another player.

This fixes the HP-stacking-problem and also stops lag from just making all units always get removed.

For example:

Effects:
Create Object (Gaia, Light Cavalry, Area)
Damage Object (Gaia, Light Cavalry, Area, -1000)
Change Ownership (Gaia, Light Cavalry, Area, to Player 8)

me

[This message has been edited by Impeached (edited 06-17-2013 @ 12:59 PM).]

BF_Tanks
Squire
posted 06-17-13 02:28 PM CT (US)     3 / 11       
I was thinking that but is there not a slight chance the unit can change ownership if a player is close enough?

Proud Member of Black Forest Studios
Co-creator of Silent Evil - Voted Best Multiplayer Scenario of 2009
and The Seas of Egressa - Voted Best Multiplayer Scenario of 2010
HockeySam18
Dúnadan
posted 06-17-13 04:17 PM CT (US)     4 / 11       
UserPatch adds area parameters to the "Change Object HP" effect.

Storm on the Steppe | Galderton Hill RP | Proud member of Stormwind Studios

"Cattle die, kindred die, every man is mortal:
But the good name never dies of one who has done well." - Hávamál

"Hockey is the only sport left for true men." - ax_man1
JustTesting1234
Squire
posted 06-18-13 05:05 AM CT (US)     5 / 11       
(attack/hp boost in negative)
create object
(attack/hp boost)

http://aok.heavengames.com/cgi-bin/aokcgi/display.cgi?action=ct&f=4,41530,0,30
BF_Tanks
Squire
posted 06-18-13 06:35 AM CT (US)     6 / 11       
@Hockeysam: What? UserPatch never added that! That's been in the game forever!

Proud Member of Black Forest Studios
Co-creator of Silent Evil - Voted Best Multiplayer Scenario of 2009
and The Seas of Egressa - Voted Best Multiplayer Scenario of 2010
kammerjaeger
Squire
posted 06-18-13 02:47 PM CT (US)     7 / 11       
thanks for all your answers.

i thought the solution of Impeached fits best to my situation, so I tried it. But unfortunately, all units change their ownership when they are in the range of my units (as BF-tanks wrote)

Actually I like this way, because there are no negative values needed. So if you would have a solution for this ownership-changing-problem, i would be very glad :-)
Impeached
VIP (Reverie World Studios)
(id: MeGaIdIoT)
posted 06-18-13 02:59 PM CT (US)     8 / 11       
Oh right, I forgot about the Gaia conversion. Well try just creating it for one player and giving it to another then?

You could also make it only run the create trigger if there's not a unit currently there. It's more complicated, though.

me

[This message has been edited by Impeached (edited 06-18-2013 @ 03:19 PM).]

HockeySam18
Dúnadan
posted 06-18-13 05:10 PM CT (US)     9 / 11       
@Tanks: Whoops . Forgot that they just added the area to the name effect.


@KammerJaeger: In that case, there shouldn't be any issue- just have a trigger create the units and then change their HP with the effects.

Of course, if you want to change the names of those units created with triggers, then UserPatch also makes that possible.

Storm on the Steppe | Galderton Hill RP | Proud member of Stormwind Studios

"Cattle die, kindred die, every man is mortal:
But the good name never dies of one who has done well." - Hávamál

"Hockey is the only sport left for true men." - ax_man1
BF_Tanks
Squire
posted 06-19-13 08:33 AM CT (US)     10 / 11       
You could easily do my method with Change Object HP instead of a negative Damage Object, just you would be limited to how much health your spawned unit can have.

Proud Member of Black Forest Studios
Co-creator of Silent Evil - Voted Best Multiplayer Scenario of 2009
and The Seas of Egressa - Voted Best Multiplayer Scenario of 2010
kammerjaeger
Squire
posted 06-21-13 12:21 PM CT (US)     11 / 11       
the problem is, that i cann't use create-trigger and hp-upgrade-trigger in the same condition, because the units shouldn't be upgraded during first 60min. and after 10 more minutes, the units should become stronger once again. in this case it would became very complicated with your solution.

now i created a 3rd player with the same color as player 2. units change ownerchip after being generated from player 3 to player 2.

the scenario works really fine. it's looking a little buggy, because player 3 will give up quite fast and appears in the end of the game, but there's no effect on the funcionality.

thank you all very much
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Kings Heaven | HeavenGames