Hello to everyone. It seems I have a problem. I was/am trying to make one of those spells that are supposed to morph one Hero into another, with different abilities. I was reading about similar problems, and it seemed i found an answer, but...
This is the topic where I read it:
http://www.wc3sear.ch/viewtopic.php?t=301&highlight=morph
RaZoR wrote this:
The problem:
1. Trigger
Does this mean remove from the game?
- unit: remove "alternateunitformonyourmap"
2. Trigger
- store "firstunitvariable" as Firstunit of test
in "gamecachevariable"
Firstunit of test?
- set last replaced unit = "alternateunitvariable"
This cannot be written. Is it in fact
- set "alternateunitvariable" = last replaced unit ?
3. Trigger
Same like the second
Anyway, i tried it with "set "alternateunitvariable" = last replaced unit" and the first change was succesfull. A change back didnt replace the alternate unit, but add the normal one next to it. This normal one didnt change any more, but kept adding more units. After this test, back in trigger editor, some triggers were'nt functioning any more.(Had that red sign instead of normal one)
So, does anyone has an explanation?
By the way, i still use 1.07 version of TFT and WE.
Thanks
This is the topic where I read it:
http://www.wc3sear.ch/viewtopic.php?t=301&highlight=morph
RaZoR wrote this:
ok, i solved it with using game caches, so u haven't to hide the units :
first : create 2 different units (the normal form and the alternate form)
and place them on your map, then create variables: a unit variable
(named unit 1 or sth. like that), a second unit variable (for the alternate form)
and a game-cache variable; then create some triggers :
1. Trigger :
event - map initializing
action - varible: set "firstunitvariable" = "unit placed on your map"
- variable: set "altenateunitvariable" = altenate form
(u have to place the alternate form also on your map)
- game cache: create a game cache from yourmapname.w3v
- variable: set "thegamecachevariable" = last created game cache
- game cache: store "alternateunitvariable" (placed on your map)
as Alternateunit of test in last created game cache
- unit: remove "alternateunitformonyourmap"
- gamecache: save last created game cache
then u have to create two untargeted dummy spells
and a region called "unitchange" or sth. like that (the size isn't importent)
2. Trigger :
event - generic unit event: unit casts an ability
condition - ability comparison: ability being cast equal to "first dummy spell"
action - region: move center of "unitchange" to position of "firstunitvariable"
- store "firstunitvariable" as Firstunit of test in "gamecachevariable"
- remove "firstunitvariable" from the game
- game cache: restore Alternateunit of test for player1 at center of "unitchange"
- set last replaced unit = "alternateunitvariable"
- game cache: save "gamecachevariable"
3. Trigger
event - generic unit event: unit casts an ability
condition - ability comparison: ability being cast equal to "second dummy spell"
action - region: move center of "unitchange" to position of "alternateunitvariable"
- store "alternateunitvariable" as Alternateunit of test in "gamecachevariable"
- remove "alternatetunitvariable" from the game
- game cache: restore Firstunit of test for player1 at center of "unitchange"
- set last replaced unit = "firstunitvariable"
- game cache: save "gamecachevariable"
The problem:
1. Trigger
Does this mean remove from the game?
- unit: remove "alternateunitformonyourmap"
2. Trigger
- store "firstunitvariable" as Firstunit of test
in "gamecachevariable"
Firstunit of test?
- set last replaced unit = "alternateunitvariable"
This cannot be written. Is it in fact
- set "alternateunitvariable" = last replaced unit ?
3. Trigger
Same like the second
Anyway, i tried it with "set "alternateunitvariable" = last replaced unit" and the first change was succesfull. A change back didnt replace the alternate unit, but add the normal one next to it. This normal one didnt change any more, but kept adding more units. After this test, back in trigger editor, some triggers were'nt functioning any more.(Had that red sign instead of normal one)
So, does anyone has an explanation?
By the way, i still use 1.07 version of TFT and WE.
Thanks