HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Instant Unit Move

02-26-2005, 10:46 PM#1
Zoxc
I've made a trigger when someone enter a relgion all units of the player will be moved to a relgion, but when I do this:
Code:
Pick every unit in (Units in (Playable map area)
owned by (Owner of(Entering unit)
) and do
 (Unit - Move (Picked Unit) instalty to
(Random point in MoveToRelgion <gen>)
) 

only the entering unit moves o_O ?
02-27-2005, 12:55 AM#2
Guest
I'm not sure, but shouldn't be:

Quote:
Pick every unit in (Units in (Playable map area)
owned by (Owner of(Picked Unit))
) and do
(Unit - Move (Picked Unit) instalty to
(Random point in MoveToRelgion <gen>)
)

In your case, only the units owned by the ENTERING unit will move...
What's the trigger idea, pehraps i could help. (If that doesn't work)
02-27-2005, 01:35 AM#3
Uther
Shouldnt it be owner of the triggering unit, because it moved into the region in the first place:

Code:
Pick every unit in (Units in (Playable map area)
owned by (Owner of TRIGGERING UNIT) 

I would help you more, but i cant get into my WE cause i cant find the disc... :\
02-27-2005, 01:41 AM#4
Guest
Damn it, if i had no WE i think i would cry ;~

Anyway, post the main idea, be specific, more specific the question, faster we shall respond =D
02-27-2005, 08:28 AM#5
Raptor--
Quote:
Originally Posted by Uther
Shouldnt it be owner of the triggering unit, because it moved into the region in the first place:

Code:
Pick every unit in (Units in (Playable map area)
owned by (Owner of TRIGGERING UNIT) 

I would help you more, but i cant get into my WE cause i cant find the disc... :\

there is no difference between triggering unit and entering unit in the case of entering a region

and as for reNard's response, that doesn't exactly make sense because you're conditioning a picked unit, yet the group doesn't even exist yet

as for the trigger snippet, i don't see anything wrong with it, u'd have to give more
02-27-2005, 09:04 AM#6
Daelin
If it activates only for a single unit entering the region, then you should only move that unit. So it would be no pick up every unit but instead just Move (Entering Unit) instantly to
(Random point in MoveToRelgion <gen>).

~Daelin
02-27-2005, 09:21 AM#7
yuripro84
Heres what i think you want

Unit Group-Pick Every Unit In Unit Group And Do Action
Pick every unit in (Units owned by (Owner of (Triggering Unit))) and do (Unit - Move (Triggering Unit) instantly to (Random point in (Region <gen>)))

Hope this helps, if you want the exact code, just ask!

btw, im still learning, so im probably wrong, but doesnt "selected units" refer to the units being selected by the player ;) lol, not the units you were reffering to in the trigger??just curious
02-27-2005, 09:29 AM#8
Anitarf
Quote:
Originally Posted by Zoxc
I've made a trigger when someone enter a relgion all units of the player will be moved to a relgion, but when I do this:
Code:
Pick every unit in (Units in (Playable map area)
owned by (Owner of(Entering unit)
) and do
 (Unit - Move (Picked Unit) instalty to
(Random point in MoveToRelgion <gen>)
) 

only the entering unit moves o_O ?
If you copied the trigger exactly from the editor (you can copy it by right-clicking on the trigger name and selecting "copy as text"), maybe we could help better. Also, yuri's solution seems like it should work.
02-27-2005, 10:35 AM#9
mogmiester
Code:
Move
    Events
        Unit - A unit enters YourRegion <gen>
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Owner of (Picked unit)) Equal to (Owner of (Entering unit))
                    Then - Actions
                        Unit - Move (Picked unit) instantly to (Random point in MoveToRegion <gen>)
                    Else - Actions

there you are, should work

ps its region not relgion
02-27-2005, 11:01 AM#10
oNdizZ
Quote:
Originally Posted by yuripro84
Heres what i think you want

Unit Group-Pick Every Unit In Unit Group And Do Action
Pick every unit in (Units owned by (Owner of (Triggering Unit))) and do (Unit - Move (Triggering Unit) instantly to (Random point in (Region <gen>)))

Hope this helps, if you want the exact code, just ask!

btw, im still learning, so im probably wrong, but doesnt "selected units" refer to the units being selected by the player ;) lol, not the units you were reffering to in the trigger??just curious


First off:

Quote:
Originally Posted by Zoxc
I've made a trigger when someone enter a relgion all units of the player will be moved to a relgion, but when I do this:


he wanted to move ALL units not just the unit that entered. so it should be (picked unit) at the green colored text.

Second: yes, "Units Selected" refers to the units that is currently selected by (choosable player).
02-27-2005, 09:08 PM#11
Raptor--
Quote:
Originally Posted by Anitarf
If you copied the trigger exactly from the editor (you can copy it by right-clicking on the trigger name and selecting "copy as text"), maybe we could help better. Also, yuri's solution seems like it should work.

no, yuri's won't work

"Unit Group-Pick Every Unit In Unit Group And Do Action
Pick every unit in (Units owned by (Owner of (Triggering Unit))) and do (Unit - Move (Triggering Unit) instantly to (Random point in (Region <gen>)))"

directly translates to "for every unit in Unit Group, move the entering unit to a random point in Region"

which means the entering unit will be moved X number of times where X is the number of units in the Unit Group

which means only 1 unit will be moved like 40 times instantaneously (which ends up looking like 1 move)


the only correct solutions were Zoxc's original (something else must be messed up or he copied it wrong) and mogmiesters

you guys should really learn to differentiate the use between picked and triggering, it'll save you a lot of fuss in the future
02-27-2005, 11:20 PM#12
Anitarf
Quote:
Originally Posted by Raptor--
no, yuri's won't work

"Unit Group-Pick Every Unit In Unit Group And Do Action
Pick every unit in (Units owned by (Owner of (Triggering Unit))) and do (Unit - Move (Triggering Unit) instantly to (Random point in (Region <gen>)))"

directly translates to "for every unit in Unit Group, move the entering unit to a random point in Region"

which means the entering unit will be moved X number of times where X is the number of units in the Unit Group

which means only 1 unit will be moved like 40 times instantaneously (which ends up looking like 1 move)
Yes, my mistake, I should read other people's code more thoroughly before agreeing with them. Anyway, the first part of yuri's trigger was correct, I mean the part where he used the unit group function "units owned by player" rather than "units in region matching condition". I supposed Zoxc made an error with the condition, like using picked unit instead of matching unit or something similar (because otherwise, his trigger should be working from start), and using a different unit group function seemed like a good way to avoid such possible mistakes.
02-28-2005, 01:04 PM#13
Zoxc
If an unit entered my relgion all his units is moved to another relgion

Enter Relgion
Events
Unit - A unit enters Relgion <gen>
Conditions
((Entering unit) is A Hero) Equal to True
Actions
Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of (Entering unit))) and do (Unit - Move (Picked unit) instantly to (Random point in GoTo <gen>))