Wc3C.net

Wc3C.net (http://www.wc3c.net/forums.php)
-   General Development (http://www.wc3c.net/forumdisplay.php?f=189)
-   -   how can i make a unit change into another unit when it stops moving (http://www.wc3c.net/showthread.php?t=110855)

andreasaspenberg 04-22-2015 01:50 PM

how can i make a unit change into another unit when it stops moving
 
in one my projects i have a basic unit that transforms between basal golem(when moving) and obelisk(when not moving). i have already figured out how to make it transform from obelisk to basal golem when it moves but the issue is to make it transform into obelisk when it stops. how can i do that?

Fledermaus 04-23-2015 01:33 AM

That depends on your definition of "moving". Do you mean when a unit is issued a stop/hold position command and when it reaches its destination from move/attack commands? Or do you simply mean when it is standing still?

Also: how are you doing the obelisk to golem transformation?

andreasaspenberg 04-23-2015 02:38 PM

when it is given a move or attack order it changes from obelisk til basal golem. i want it to change back into obelisk when it does nothing.

yeeboys 04-24-2015 02:07 AM

Quote:

Originally Posted by andreasaspenberg
when it is given a move or attack order it changes from obelisk til basal golem. i want it to change back into obelisk when it does nothing.

create a new unit and hide the old one and vice versa.

Fledermaus 04-24-2015 12:54 PM

Quote:

Originally Posted by andreasaspenberg
when it is given a move or attack order it changes from obelisk til basal golem. i want it to change back into obelisk when it does nothing.

That wont work 100%. If the obelisk has any other abilities, issuing those could cause it to move to the target and wont trigger the change.
There is also the problem that if a unit is standing still (i.e. after it has finished moving/attack moving to a location, or after a stop (or hold position if it's ranged) order) and it auto-acquires a new target to attack, it will attack the target but it will not fire any order. So your current system will not catch when this happens and wont transform from obelisk to golem.

I would do it by running a timer and keeping track of all obelisk/golem's x/y previous position.
When the timer runs, check their current x/y.
If the unit is a golem and the current x/y is not different from the previous x/y then it has stopped moving so transform it into the obelisk.
If the unit is an obelisk and it's current x/y is different from the previous x/y then it has started moving so transform it into the golem.
Update the previous x/y to the current x/y.

How are you doing the actual transformation, chaos morp or replace unit?

andreasaspenberg 04-30-2015 01:34 PM

i am using chaos as that is smoother. i have been working on a variant of bear form to transform the unit so it just needs to trigger bear form when it stops moving and when starts moving.

Fledermaus 05-01-2015 04:36 AM

So which one do you want to use?

andreasaspenberg 05-01-2015 12:43 PM

bear form would be the best for what i want though when i have perfected the system i want to hide it so that it becomes invisible.

Fledermaus 05-04-2015 12:18 PM

2 Attachment(s)
It was too annoying with Bear Form so I made it using chaos instead.

Steps for copying it to your map:
  • Open my map.
  • Select the custom code section (red) - copy everything in the blue section.
  • Open your map and paste into the custom code section (blue).
  • Create the following variables:
    • Boolean array - CanYouMoveWhenBlizzardSuesYou
    • Timer - SuingAssassinTimer
    • Integer - TheCountForThirdPartyApps (Initial value 0)
    • Real array - TheXPositionWhenBlizzardKillsU
    • Real array - TheYPositionWhenBlizzardSuesU
    • Unit array - WhichUnitShallBlizzardSueNext
  • Create the chaos morph abilities
  • Go through the custom code, look for the 3 comments all in caps and follow the instructions
  • Look at the "Trigger For Registering Units" and "Trigger For Unregistering Units" triggers and try to create something similar in your map.
  • Please don't sue or have me assassinated for using jass :c
  • Complain that it is unusable because it is in jass.
  • Complain that it is unusable because of some reason you are only giving now after I have created everything that you asked for.

andreasaspenberg 05-04-2015 01:35 PM

that file would not open in the world editor. there several types of jass: one is typed in without the use of a third party program and therefore legal, others are typed in through the use of a third party program and therefore illegal. what type did you use? please give me what i asked for instead of what you want me to use.

Fledermaus 05-04-2015 10:05 PM

That was saved in the vanilla world editor on the latest patch. If you can't open it you must be using a third party editor that can't open normal maps.
Since you have now openly admitted you use a third party editor you probably should go into hiding before blizzard sends someone to kill you.

Fledermaus 05-04-2015 10:17 PM

Quote:

Originally Posted by andreasaspenberg
there several types of jass: one is typed in without the use of a third party program and therefore legal, others are typed in through the use of a third party program and therefore illegal

Actually by that logic all of the code you have gotten from us on this site is doubly illegal (even the gui). It was first written in a third party editor, and then copied into your map from a third party website (this isn't the official blizzard site).

You might be in serious danger already.

andreasaspenberg 05-05-2015 12:46 AM

blizzard have said nothing about third party sites or third party code, only third party programs and that i do not use. please stop trolling me. any more trolling from you will be ignored.

Fledermaus 05-05-2015 01:28 AM

I am being serious. That map was saved with blizzards world editor on the latest patch.
You must have done something if you cannot open it.

It is exactly what you asked for (well, it uses chaos but that's a better way to do it anyway) and yet you still somehow find a reason to not be able to use it... Please stop trolling me.

Quote:

Originally Posted by andreasaspenberg
blizzard have said nothing about third party sites or third party code, only third party programs and that i do not use.

Quote:

Originally Posted by andreasaspenberg
there several types of jass: one is typed in without the use of a third party program and therefore legal, others are typed in through the use of a third party program and therefore illegal.

These two statements contradict each other. How can you think that jass written with a third party application is illegal and yet it is legal to use third party code (possibly written in a third party application - therefor making it illegal)?
Again, please stop trolling me.

Rao Dao Zao 05-05-2015 09:07 AM

Isn't this the point where you just make a custom model that has one unit in its stand animation and another in its walk animation?


All times are GMT. The time now is 02:28 PM.

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services