Random movment

MyNameIsMonky

BattleForums Junior Member
Joined
Feb 24, 2004
Messages
137
Reaction score
0
Location
No place
Website
Visit site
I was wondering how to do, unit enters region 1, 50% go to region 2, other 50% to region 3.
I think it has to do with conditions..
 

ChrisH36

Guy with Most Posts on Quiet Board.
Joined
May 20, 2003
Messages
15,042
Reaction score
4
Location
Temple Prime, Sarajevo
If you mean random movement without locations, there is an ability called Wander that creeps have. For regions, you will need a random int that changes every X seconds. If it is say 0, you make them mvoe right. If its 1, you make them move left.
 

MyNameIsMonky

BattleForums Junior Member
Joined
Feb 24, 2004
Messages
137
Reaction score
0
Location
No place
Website
Visit site
Could you say like the exact trigger. That would be more helpful, becuase i dont not have any idea how htat would work. i want them to move to region 2 when entering 1 if the it is on 1?
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
When a unit enters region 1, use an If-Then-Else action that generates a random number in If and compares it with 0.5. If this number is less than 0.5, then go to region 2, otherwise go to region 3. I'm not sure of this wander thing, though...

Problem: Warcraft III does not have a fully random engine. It generates a seed and this seed is consistent for the map irregardless of time. So you will have to play around a little with random events, such as generating a random number every time a unit is selected, to keep the generator moving. Unless there is a trigger to start the randomising.*
 

Octopor

your whole family is made of meat
Joined
Nov 28, 2003
Messages
2,043
Reaction score
2
This is one way you could do it:

Events
Unit - A unit enters Region 1
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units in (Region 1))) Equal to 1
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 2) Equal to 1
Then - Actions
Unit - Order (Entering unit) to Move To (Center of (Region 2))
Else - Actions
Unit - Order (Entering unit) to Move To (Center of (Region 3))
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units in (Playable map area))) Greater than or equal to 2
Then - Actions
Set Integer_Units = (Number of units in (Units in (Region 1)))
Unit Group - Add all units of (Units in (Region 1)) to UnitGroup_Units
Unit Group - Pick every unit in (Random (Integer_Units - (Integer((((Real(Integer_Units)) x 0.50) + 0.00)))) units from (Units from UnitGroup_Units)) and do (Actions)
Loop - Actions
Unit Group - Remove (Picked unit) from UnitGroup_Units
Unit - Order (Entering unit) to Move To (Center of (Region 2))
Unit Group - Pick every unit in UnitGroup_Units and do (Actions)
Loop - Actions
Unit Group - Remove (Picked unit) from UnitGroup_Units
Unit - Order (Entering unit) to Move To (Center of (Region 3))
Else - Actions
Do nothing

If it's a move instantly thing you want, change the Unit - Order to Unit - Move Instantly.
 

MyNameIsMonky

BattleForums Junior Member
Joined
Feb 24, 2004
Messages
137
Reaction score
0
Location
No place
Website
Visit site
Thanks for the help! but i need more help... i was wondering how to make a range more then 600. I put the range at 1000 but the in-game its only 600. I've Been wondering how to do this, porque its been happening to all the shitty maps i make. Thank you.
 

ChrisH36

Guy with Most Posts on Quiet Board.
Joined
May 20, 2003
Messages
15,042
Reaction score
4
Location
Temple Prime, Sarajevo
Your Target Aquisition Range I think has to be greater than the base attack range.

I had that problem a long time ago.
 

NewPosts

New threads

Top