HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

On "Stop" event. how?

07-06-2002, 12:42 PM#1
Guest
This is a copy paste from's Mr.123's Tower defence forum
i shall get help here, he said:)

"I had a question concerning something i write
so i decided i might as well post it here...

I was writing a code for a "Heroes(the game)" based combat system
what i was doing is a timer of 6 secs for every unit to move, then it comes back
in the direction from which it came
however, i can't seem to find a command of something like
"on player unit - stop"
i wanted to pause the timer once the unit stops,
and resume it ones it continues
but as i said, i can't find the on unit stop command. ( i tried the unit ordered "stop" in the
condition part. didnt seem to work either)

thanx:)

Vlad Shulman "
07-06-2002, 03:29 PM#2
3DGuy
In order to make the unit stop is:

Unit - Issue order with no target - action

If you are trying to make ur hero get back from a specific point when it moves, then you should make something like this:

E: unit owned by (player) is issued an (order targeting a point)
C: (Ordered unit) is a hero (equal to) (true)
A: wait 6 seconds
order (ordered unit) to move to <theregion>

if u want to make a checker do this: make a variable that would represent the player hero then,

E: Every 6 secs
C: <Hero Variable> is in <theregion> not equal to true
A: order <Hero Variable> to move to <theregion>
07-06-2002, 04:28 PM#3
Guest
Let me re-explain...
i want simply this:
Event: On unit stop.

which i can't find:\
07-06-2002, 04:39 PM#4
3DGuy
sorry didnt really understand... but try this instead

unit owned by (player) is issued an order with no target

it will be either hold position or stop, but i cant tell whether u can specifically identify the "order with no target".
07-06-2002, 06:23 PM#5
Guest
order comparision
(issued order) is equal to order(stop)
07-06-2002, 09:34 PM#6
Guest
i will probably write a different code or dont do it at all
cause there is just no way to make it work like i want. there is no
event: on unit action: stop / on unit action hold position - events...
2bad:\
07-06-2002, 10:29 PM#7
dataangel
Yes there is.

Event
Unit is given an order with no target
Condition
order is order(stop)
Action
....
07-07-2002, 02:30 AM#8
Extrarius
I think maybe he means when the unit stops by itself (gets where it is going) and not when a unit is given the order to stop. To do this you would need to move a region to the target of a move order (which can have a point or an object target), and then test for when the unit gets to the region (which should be small so it wont enter the region before it actually gets there).
07-07-2002, 06:41 AM#9
dataangel
In case what you want is what Extrarius is suggesting, here's how you'd do it:

Event
Unit is given an order with target
Conditions
order is move or attack move
Action
Center region on target
set moveunit = triggering unit


Event
Unit enters region
Condition
Triggering unit == moveunit
Action
Center region back somewhere where another unit won't step on it.
do stuff
07-07-2002, 02:22 PM#10
Guest
Quote:
Originally posted by Extrarius
I think maybe he means when the unit stops by itself (gets where it is going) and not when a unit is given the order to stop. To do this you would need to move a region to the target of a move order (which can have a point or an object target), and then test for when the unit gets to the region (which should be small so it wont enter the region before it actually gets there).

That's what i meant:)

Quote:

In case what you want is what Extrarius is suggesting, here's how you'd do it:

Event
Unit is given an order with target
Conditions
order is move or attack move
Action
Center region on target
set moveunit = triggering unit


Event
Unit enters region
Condition
Triggering unit == moveunit
Action
Center region back somewhere where another unit won't step on it.
do stuff


think i tried it, but i'll try again. 10x
07-07-2002, 06:38 PM#11
Guest
if u tried to make an event unit enters region
it will only activate on the ORIGINAL location of the region
no matter where you move the region later on

you'll notice all events works liek that
ie: you can't make an event that occurs on a unit that hasn't been made yet etc..

what you COULD do is use the Unit within range event, and set it on a unit(premade), then move the unit around.

you can record in a variable the position of a unit tho when it makes its move order, so u know where to move it back..
07-07-2002, 11:56 PM#12
Extrarius
Well, if the event wont trigger on a moved region, just use a periodic event with the condition "<region> contains <unit>"
I know that works as I use it in a map I'm currently working on
07-08-2002, 01:20 AM#13
dataangel
Umm.... I know for a fact, I've did this in my CTF map -- that moved regions WILL work. I have no idea why you think otherwise. Unless the retail changed this (which wouldn't make any sense) unit enters region should work on moved regions in their new location.