| 09-22-2002, 11:38 PM | #1 |
Guest | Hi. I recently pulled off a rather remarkable feat of coding to replace level 3 water elementals with berserk water elementals (which are certainly 10x cooler), and even die after 75 seconds. After this monumentous project (if you want to see the code, just ask), I took on another project: Replacing Shadow Wolves with Dire Wolves. That's right--whenever those suckers are summoned, I wanted them to be replaced by 2 dire wolves in their place. What I've come up with so far: So far, I've tried several different methods. All of them have failed completely (i.e. no removal of shadow wolves, no dire wolves popping in,etc). The first was a simple trigger that looked like this: Player 1 summons a unit Condition: 2 shadow wolves are in (playable map area) Action: move Wolf conversion region to (triggering unit) Pick every shadow wolf for player 1 and kill em. Spawn 2 dire wolves in Wolf conversion region. This trigger apparently failed to work, so I came up with another that works on a periodic basis, but that also failed (I thought that removing the player 1 summons a unit for both shadow wolves would remove ambiguity as to whether or not the trigger affected both wolves at the same time, or only ran once). Please respond with explicit code and/or a working alternative! |
| 09-23-2002, 10:57 AM | #2 |
Guest | You could just change the stats of a Lv.1 Wolf in the Unit Editor. |
| 09-23-2002, 12:09 PM | #3 |
Guest | No, I want to completely change it so that whenever shadow wolves are summoned by, say, a hero who's at level 10 (a condition I haven't implemented due to the difficulty in attaining level 10 in my map), they're replaced by dire wolves. |
| 09-23-2002, 12:30 PM | #4 |
Try this: E: unit enters region C: triggering unit is shadow wolf A: replace triggering unit with a dire wolf |
| 10-13-2002, 07:58 PM | #5 |
Guest | I tried your suggestion, wakeman, and it doesn't work. Maybe having 2 units trigger the same trigger is bad somehow...? Anyways, I wanted my trigger to be able to destroy the dire wolves as soon as new shadow wolves are spawned and have them turn into new dire wolves... Event: Unit enters region. Condition: Unit is type Shadow Wolf Action: Center region on triggering unit Kill/remove triggering unit create dire wolf in region I can't think of a way to fix this....whenever my hero creates shadow wolves, nothing happens to them. Please help! |
| 10-13-2002, 08:10 PM | #6 |
Event: unit enters (playable map area) condition:Unit type of unit=shadow wolf action: set variable xxxx[integer variableyyyy]{unit variable}=triggering unit replace varible xxxx[0] with 1 dire wolf replace varible xxxx[1] with 1 dire wolf set yyyy to yyyy+1 run trigger set life trigger set life is in custom text so i do know it all but the trigger thing is UnitApplyTimedLife(unit,{youll have to look for this function i dont remember},amount in seconds) im exactly sure about allm of this but this is what id try note you can make as many things up there as you want |
| 10-13-2002, 08:45 PM | #7 |
Guest | For some reason i dont think unit - enters region will work for a summoned unit. But maybe it does it dont remember. You might try Event - A unit owned by player __ is summoned Condition - Triggering unit= shadow wolf lvl 3 Actions - (Whatever) |
| 10-14-2002, 02:02 AM | #8 |
Guest | trilknight is probably right. the shadow wolfs do have lvl 1,2, and 3 on the end of their names |
| 10-14-2002, 03:49 AM | #9 |
hmm, I think both unit enter region and unit is summoned should work, though I'm unable to verify them at the moment. I did similar thing to the orcish sapper in my map. When it summons a Scout owl, the trigger remove the owl and replace with number of goblin land mines equal to the level of the owl. I forget which event I used......:sweatdrop |
| 10-14-2002, 05:02 AM | #10 |
Guest | Nope. I originally tried "unit is summoned" in my trigger to begin with, but that didn't work either... |
| 10-14-2002, 05:02 AM | #11 |
Guest | Nope. I originally tried "unit is summoned" in my trigger to begin with, but that didn't work either... |
| 10-14-2002, 06:09 AM | #12 |
Guest | You are making this completely too hard.It is any easy trigger. BTW - unit event - summoned doesnt work for some odd reason But heres the stuff Event - Unit enters playable map area Condition - Triggering unit= shadow wolf lvl 3 action - replace triggering unit with dire wolf and use new units deflauts Simply said. This works i tried it. You will have to tailor in how you will do this if he is lvl 10 or not. But it shouldnt be hard. |
| 10-14-2002, 05:55 PM | #13 |
Guest | What I want to do specifically is be able to create these new wolves AND removes any traces of old dire wolves (so that you can't summon a stackload of dire wolves). |
| 10-14-2002, 07:18 PM | #14 |
Guest | So make the dire wolves variables. Maybe add it to the trigger above something like set DIREWOLVES = true do something like if DIREWOLVES die set DIREWOLVES = false Another tigger Event - Unit enters playable map area Condition - Triggering unit= shadow wolf lvl 3 action - if dire wolves = true then kill triggering units else do nothing Just use some variables. |
| 10-14-2002, 08:42 PM | #15 |
*Sigh* Make sure you use entering unit I can't tell you how many times I've seen mistakes like this made :p |
