HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Is there a way to change unit type via triggers?

10-12-2006, 06:55 PM#1
Fyrestorm
I'm just not exactly sure how this is done.

All I want to do is to be able to both change the flying height of a unit and the unit type, so that it can move over cliffs etc, when moving with a raised height.

I looked for a while, but I don't see this function (I've tried SET_UNIT_TYPE, which didn't seem to work)

Am I doing this wrong (probably) or am I merely missing a function?

Help appreciated, thanks.
10-12-2006, 07:40 PM#2
aidan_124
If you make an identical unit except with the changed then you can use
Trigger:
random
Events
Conditions
Collapse Actions
Unit - Replace No unit with a Footman using The old unit's relative life and mana
if you need to change something to lots of different values, sorry i cant help you as im new to JASS (i know the above is GUI but its simpler for me to do)
10-12-2006, 08:15 PM#3
iNfraNe
You could use the ability "chaos" to replace a unit with another one while keeping its stats (even its handle address).
10-12-2006, 08:31 PM#4
The)TideHunter(
Yar!
Chaos or berkserker, although i do too prefer chaos.
10-12-2006, 09:04 PM#5
Fyrestorm
Thanks for the replies; I would have preferred not to do it by switching units, but on second thoughts, it would, I assume, be possible to create a unit with chaos type, and then dynamically change model as needed. This is possible, isnt it?

To give more of a context, I want this trigger so that I can for example make units jump off cliffs etc.
10-12-2006, 09:05 PM#6
Fyrestorm
Thanks for the replies; I would have preferred not to do it by switching units, but on second thoughts, it would, I assume, be possible to create a unit with chaos type, and then dynamically change model as needed. This is possible, isnt it?

To give more of a context, I want this trigger so that I can for example make all units jump off cliffs etc.
10-13-2006, 07:16 AM#7
Anitarf
Why would you need to make it a new unit to allow it to jump off a cliff?
10-13-2006, 03:57 PM#8
The)TideHunter(
I was thinking the same thing, but i thought i was missing something and it would be stupid to ask.

But Btw: If you want one unit that can fly, and one that cant. (In other words set its height) Just add and remove the ability Morph (Medivh), you can only set the fly heights of units if they can actually fly, but ground units can too by adding and removing. Its a good bug.
10-13-2006, 07:05 PM#9
Rising_Dusk
Quote:
flying height of a unit and the unit type, so that it can move over cliffs etc, when moving with a raised height.

Yes, just add/remove crow form to a ground unit when they begin 'flying'.
Then you can set their fly height as you wish.

Then, in order for them to fly over things, do this: call SetUnitPathing(YourUnit, false)
That will allow you to move them as though they were a flyer.
If you want them to be able to move on their own, issued orders still see that they are ground units, so you would need to use a unit-changing ability.