HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Possible? impossible? [Trigger]

09-19-2003, 10:06 PM#1
Ironboy
cavalries spawn over time, so there're lots of them. (unit-type)


when the same cavalry kills an amount of units (specified or any), the cavalry gets replaced with another type of unit.


anyone can think any trigger for this?

thxs
09-19-2003, 10:12 PM#2
Another stold called | ONE |
i dont know the words to it rite now but I did it before

Creat a leader bourd for each calvery once it gits to a # that unit group dies and is replaced with a defferent one

Make a unit group for each one and pick around in triggers to find it

O ya set up veribles for spawning:gsmile:
09-19-2003, 10:16 PM#3
Ironboy
Quote:
Originally posted by | ONE |
i dont know the words to it rite now but I did it before

Creat a leader bourd for each calvery once it gits to a # that unit group dies and is replaced with a defferent one

Make a unit group for each one and pick around in triggers to find it

O ya set up veribles for spawning:gsmile:


no... i know how to spawn the units............

the problem is... i can't specify any cavalry for the action of replacing,

the cavalry (there're lots of same type cavalry,non-hero) that killed a certain amount of enemy units=======> gets replaced with another unit.....


got it?
09-19-2003, 10:18 PM#4
junithorn !
ARRAY!
09-19-2003, 10:22 PM#5
Another stold called | ONE |
Quote:
Originally posted by junithorn !
ARRAY!


LOL who else here thinks he doent even know what a array is...

Make unit groups for each seperate cavelry there is no easy way out you have to creat a unit group and leader bourd for each one there is no mass way into this you gotta git your hands dirty in triggers and play a lil.. If all else fails send me you map and ill do it if I have the time then you can study the trigger that I mad
09-19-2003, 10:22 PM#6
35263526
I hate it when people just say array. How would it be set up (i.e. it would obviously be a unit array, but what would go in the [ ] part.
09-19-2003, 10:24 PM#7
Ligature
Create a Unit array and an integer total. Each time a cavalry spawns, add 1 to the total and set the next array member to the spawning unit. To keep things clean, you'll have to fix it so that when a cavalry dies, he's removed from the array, and all the units below him in the array get bumped up a notch to take up the space, and the total gets knocked down one too.

Then you can have an integer array to keep track of how many kills each unit has made, and treat it the same way.

Make sense?
09-19-2003, 10:25 PM#8
Another stold called | ONE |
Quote:
Originally posted by 35263526
I hate it when people just say array. How would it be set up (i.e. it would obviously be a unit array, but what would go in the [ ] part.


I agree with you but I dont think he know what a array is lol
09-19-2003, 10:26 PM#9
junithorn !
Yes and why dont you think that?
09-19-2003, 10:27 PM#10
35263526
what reference would you use for the unit (what (specifically) would be placed within the [ ]) I need this for another map i'm making.
09-19-2003, 10:31 PM#11
Ligature
Well say you've found that one of your kill totals, KillTotal(N) has gone over the required number. You should have it organized so that you can then just say that UnitArrayMember(N) gets replaced with the new unit.
09-19-2003, 10:45 PM#12
Shvegait
Why not just modify the Custom Value of the units? When the value reaches a certain point, change the unit-type. Much, much more simpler than using an array for this case.
09-19-2003, 10:49 PM#13
Ligature
Quote:
Originally posted by Shvegait
Why not just modify the Custom Value of the units? When the value reaches a certain point, change the unit-type. Much, much more simpler than using an array for this case.


Hell yes... That's the way to go. I keep trying to build a new nose 'cause I forget the one on my face...
09-19-2003, 11:18 PM#14
weaaddar
the correct answer to this question in a soley trigger method is a mix of the usage of an array and the Custom Unit value.

Though I'm not on my Home PC I can give you a rough idea of what you will have to do.
First you must set up 2 arrays: Array one which specifies the type of units. (Note you can do this in custom text and use only one array as both values are really integers, but if your not comfortable with that the first one should be a unit type array) and array two which specifies the amount of kills required to reach the next form. The array number (The number between the []) should correspond between the two arrays except the integer one will be one below it. (IE the first entry will be Knight type 1, and 10 if it requires 10 kills to become a knight type 2).
I would name the arrays UnitType and KillsReq, you will also need another integer which you can set as I (I like I...shut up)
After setting up all these values in a intilization trigger, you will create a new trigger which will do the nasty work for you but will be versatile so you will really only need one trigger for this whole process.

event-A unit is killed.
Action:
Unit-add 1 to Custom value of killing unit
For Each Integer a 1 to end of your array
If Killing unit is a unittype of UnitType[Integer A]
then set I=Integer A
Else Do nothing

If Then else
If Custom Value of Killing Unit is KillsReq[i]
then
Replace Killing unit with UnitType[Arthmetic(I+1)
else Do nothing

Basically if you couldn't fallow this trigger is launched when your unit dies, then it will add 1 to the custom value incrementing its counter counter, now it wants to know if your unit is ready to be upgraded so first it must find out what unit type it uses a Loop until it finds the Unit type of the killing unit in your array then it will set the I value (Identifier in this case). It then will run a new If/Then/else outside this For loop. It will check the custom value of the killing unit if it happens to match the killsrequired to reach the next level then it will be replaced.

This is the simplistic method of doing it. There is a major flaw in this method, the unit will be deselected if it was selected. Meaning it can give the false Idea that you lost your uber knight when he actually just upgraded. The correct way to fix this would to use a modified Storm Earth Fire spell, Giving each level a different version which will upgrade to the next level and not have any duration (Meaning its permanant), Then disabling all of them at startup. And when the unit is upgrading enable the spell of that level force the killing unit to cast it then disable that spell for the player again. This method has its own inherit flaw as your unit will be fully healed instead of just being upped.
Another method you can use is give each unit metamorphsis but it will only work if they all are heroes metamorphing into, and having a bear formed unit casting a new bear form spell will revert it to its original unit.
09-19-2003, 11:59 PM#15
Another stold called | ONE |
you can do unit groups to you know easyer!!!