| 05-18-2004, 03:23 PM | #1 |
I got a little boy with a dog, and I can get the dog to run from one region to another, but what i'm trying to do is get the dog to run, to like a random of 1 of 3 regions one at a time, that way it looks more natural like a real dog is runing some where, rather than a unit going to a specific point! I've been looking and I just can't figure out how to do this, anybody have any ideas? Sincerely, Strom Stonebeard |
| 05-18-2004, 04:03 PM | #2 |
(If i understand right) You can make 1 big region and 3 small ones in that big one. Then make the dog to move to a random point in the big region so that the dog could enter a random region ^_^ |
| 05-18-2004, 04:58 PM | #3 | |
Quote:
So what your saying is, if I make one big region and then make 3 small regions inside that one, and set the dog to go to a random point in the big region the dog will go to one of the 3 regions in the big region randomly? Sincerely, Strom Stonebeard |
| 05-18-2004, 05:27 PM | #4 |
I've done a map as a simulation for a biology course (I'm serious) where a mouse goes randomly from one region to the neighbouring ones. Here it is. What I basically did is create , let's say, 3 regions (r001, r002 and r003), and a region-type variable (we'll name it "regions") that is "deployed" (free translation from French, means that there can be "regions[1]", "regions[2]", "regions[3]",... as many as you specify in the variable edition screen). I also created an integer variable (we'll name it "numberX"). First, I made a trigger that said : -event : map initialization -action : set regions[1]=r001 set regions[2]=r002 set regions[3]=r003 Then I created a trigger that says : - event : when you want the unit to move -action : set numberX=random number between 1 and 3 unit issue order targetting a point : order your unit to go to center of regions[numberX] It should work. |
| 05-18-2004, 11:39 PM | #5 |
Arrays are always the way to go with anything involving numbers. |
| 05-19-2004, 05:38 AM | #6 | |
Quote:
I think it would be easier do what i said :\ |
