Page 1 of 1

Scripting Metamorphose

Posted: Thu Jan 03, 2008 4:22 pm
by £N
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!

Posted: Thu Jan 03, 2008 6:30 pm
by A-Red
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.

Posted: Thu Jan 03, 2008 11:42 pm
by £N
Thanks, A-Red. Looks like I've got some investigating to do.

Posted: Fri Jan 04, 2008 5:59 pm
by TarousZars
I know ozone used the deciever spell to "change" unit types. The advantage of using charm is it always gives the new unit to the proper player.

Posted: Mon Jan 07, 2008 12:45 am
by Fury IX
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)

Posted: Thu Jan 10, 2008 3:30 pm
by Souly
Due Dwl my map The9 vs The fallen Lords...Version1

Play with Cu Rio.. he turns into a FG.

Posted: Thu Jan 10, 2008 4:39 pm
by £N
yeah souly, I remember that... I also remember that the FG is dispatched to the captain and not necessarily to the correct owner... is there a way to address that?

Posted: Fri Jan 11, 2008 10:04 am
by Zeph
this is why fury's idea sound pretty neat to me

Posted: Fri Jan 11, 2008 4:40 pm
by Pyro
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.

Posted: Sun Jan 13, 2008 6:25 am
by haravikk
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

Posted: Sun Jan 13, 2008 2:26 pm
by Fury IX
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".

Posted: Mon Jan 14, 2008 7:25 am
by haravikk
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.

Posted: Sat Feb 16, 2008 1:35 pm
by £N
Thanks for the feedback yous guys. I plan on working on this really soon.

Posted: Sun Feb 17, 2008 11:31 am
by Souly
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"