Scripting Metamorphose
Scripting Metamorphose
I am working on implementing a spell where a unit turns into another unit with a separate collection (in this instance it is a mage turning into a small flying beast, so he can traverse terrain unimpeded with greater speed to retreat if needed). I realize that this will require scripting, but I've no idea what. Fury mentioned that it was possible, but that's about all I've been able to glean. I would really only like to have this spell if it can be ensured that the new unit is transferred to the correct player, and not to the captain by default (as I've sometimes seen it occur).
Any help at all would be great, thanks!
Any help at all would be great, thanks!
Well, if you have Amber the easiest way to do it is probably to combine the two collections into one. Then it won't matter how different they look, they'll technically be able to replace each other without issue.
If you don't, you would need to use a GEOM to find the location of your wizard unit, and send it as a "dest" into a MOMA action, which would send in the second creature to that location. It would help to stop your wizard unit, and even make him uncontrollable briefly, in order to be sure that it goes smoothly.
I know very little about scripting player control, as I only script solos. I know that you can script units to be detached to specific players--but as for using the script to figure out which player had control in the first place, I have no idea.
If you don't, you would need to use a GEOM to find the location of your wizard unit, and send it as a "dest" into a MOMA action, which would send in the second creature to that location. It would help to stop your wizard unit, and even make him uncontrollable briefly, in order to be sure that it goes smoothly.
I know very little about scripting player control, as I only script solos. I know that you can script units to be detached to specific players--but as for using the script to figure out which player had control in the first place, I have no idea.
- TarousZars
- Site Admin
- Posts: 565
- Joined: Wed Mar 31, 2004 9:15 pm
- Location: Utah, USA
- Contact:
Yea my idea was: (all theory of course)
1) Create a spell that when dropped detonates charm damage at the wizards feet, perhaps with a cloud of mist.
2) Have script test for that projectile, and then send in an enemy beast to the wizards spot. Then, the wizard disapears and the beast gets converted.
3) Create a spell for the beast to drop, and have script move the wizard to the beast and have the beast disapear and die (and repawn with script).
So basic script:
Geom: Test for Wizard spell
Moma: Move in evil beast
Ctrl: Evil Beast Visi
Ctrl: Wizard Invisi
Geom: Test for Beast spell
Moma: Move in Wizard
Ctrl: Wizard Visi (loop back to start)
Ctrl: Beast Invisi (Kill)
1) Create a spell that when dropped detonates charm damage at the wizards feet, perhaps with a cloud of mist.
2) Have script test for that projectile, and then send in an enemy beast to the wizards spot. Then, the wizard disapears and the beast gets converted.
3) Create a spell for the beast to drop, and have script move the wizard to the beast and have the beast disapear and die (and repawn with script).
So basic script:
Geom: Test for Wizard spell
Moma: Move in evil beast
Ctrl: Evil Beast Visi
Ctrl: Wizard Invisi
Geom: Test for Beast spell
Moma: Move in Wizard
Ctrl: Wizard Visi (loop back to start)
Ctrl: Beast Invisi (Kill)
I have such an attack planned... but I am not on a Mac so I can't Amber. I plan on combining collections like A-Red suggested. It is better and more fluid than having an enemy attack and converted.
There is a way to give the unit to the right player. Using scripting and the "chrm" flag. I did that in Shiver's Turn. Where Murgen makes a copy of a unit and is given to the player who has Murgen. The only side effect to doing it with that script is that the captain will hear "Units Detached" and confuse him or her.
There is a way to give the unit to the right player. Using scripting and the "chrm" flag. I did that in Shiver's Turn. Where Murgen makes a copy of a unit and is given to the player who has Murgen. The only side effect to doing it with that script is that the captain will hear "Units Detached" and confuse him or her.
Your script would have to look more like:
GEOM - Detect Wizard's Spell (is an invisible projectile that sits doing nothing)
CTRL - Wizard uncontrollable (and maybe a GENE to stop for good measure)
ATTA - Charm beast (wizard as subj, beast as charm target)
MOMA - Move beast into place
CTRL - Wizard invisible
CTRL - Beast visible
GEOM - Detect Beast marker (I usually use an invisible projectile called "Marker" for these types of tests, tag is 'mark' that way =)
CTRL - Beast uncontrollable (again a stop is useful too after this)
MOMA - Move wizard into place
CTRL - Beast invisible
CTRL - Wizard visible
GEOM - Detect Wizard's Spell (is an invisible projectile that sits doing nothing)
CTRL - Wizard uncontrollable (and maybe a GENE to stop for good measure)
ATTA - Charm beast (wizard as subj, beast as charm target)
MOMA - Move beast into place
CTRL - Wizard invisible
CTRL - Beast visible
GEOM - Detect Beast marker (I usually use an invisible projectile called "Marker" for these types of tests, tag is 'mark' that way =)
CTRL - Beast uncontrollable (again a stop is useful too after this)
MOMA - Move wizard into place
CTRL - Beast invisible
CTRL - Wizard visible
I am not very good at fear, but does that mean that you cant make a marker that continuosly detonates charm damage for up to 2 seconds? I didnt try but I did try radius conversion, and that works. I have found that scripting player units to attack in general doesnt work very well (though it might work fine in this case). Also, youve got to be able to somehow kill the converted beast afterward, so he will respawn again as enemy for next time spell is cast.
And yea, I have a feeling no matter what you do it will say "units detached", and "new units recieved".
And yea, I have a feeling no matter what you do it will say "units detached", and "new units recieved".
The conversion affect is only applied to a unit once, having it detonate continuously won't do anything except convert any other units that stumble across it.
The purpose of the marker projectile is to trigger the GEOM action and subsequently provide a location for the unit swap to occur, it doesn't really need to do anything as the charm effect is applied by the ATTA (attack) actions using the chrm flag, essentially simulating the charm effect, but with scripted control.
The purpose of the marker projectile is to trigger the GEOM action and subsequently provide a location for the unit swap to occur, it doesn't really need to do anything as the charm effect is applied by the ATTA (attack) actions using the chrm flag, essentially simulating the charm effect, but with scripted control.
Your right, the fg did get despatch to the captin, but thats before i found out about the charm flag.
In the 9 v2, im not using the metamorp but insted im using summoning.
So you can do the metap spell and despacth it to the player that owns the caster...
Thing with editing collections, works the best.
Just waiting or pyro to proof to me that one can make the monster use entranch flag when the monster gets "override"
In the 9 v2, im not using the metamorp but insted im using summoning.
So you can do the metap spell and despacth it to the player that owns the caster...
Thing with editing collections, works the best.
Just waiting or pyro to proof to me that one can make the monster use entranch flag when the monster gets "override"