• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Terrain Moving

Status
Not open for further replies.
Level 15
Joined
Feb 9, 2006
Messages
1,598
Do you want them to die or something if the don't walk on the terrain you want them to ?

Well, this is the condition you would have to use:

  • (Terrain type at (Center of (Playable map area))) Equal to Lordaeron Summer - Dirt
 
Level 7
Joined
Apr 3, 2007
Messages
293
Heres something more descriptive.

I want a car to be able to drive only on the road, and the car CAN'T MOVE on any other terrain. So that way they can't run into things, or cheat. But if theres no way to not move on any other terrain, that's fine.
 
Level 7
Joined
Apr 3, 2007
Messages
293
Thanks : )
I was going to put the blockers, but then ppl cant cross the street, it would take to much space, and im to lazy to put them all down, lol.

Oh, two more thing, how can I make it where it hurts the car when It goes off road?
Also, does anyone know where I can get a police car model?
 
Last edited:
Level 9
Joined
Jun 26, 2007
Messages
659
but then ppl cant cross the street
use ground blockers, and define ppl as flying units
it would take to much space
i don't think add hundreds of doodads take more space than a periodic trigger
(there is hundreds of tree on all the blizzard map, and no lag)

but i've not solution for your lazyness (but after all, you've unit to select the doodad, hold the clic and slow slide along the border of your road)
 
Well then modify it to be like this:
  • Events
    • Time - every 0.10 seconds of game time
  • Conditions
  • Actions
    • If, Then, Else
      • If - Conditions
        • (Terrain type at TempPoint) Not equal to Asphalt
      • Then - Actions
        • Unit - Move (Car) instantly to TempPoint
      • Else - Actions
        • Unit - Set (Car)'s life to ((Current life of (Car)) - X)
    • Set TempPoint = Position of (Car)
Where X is the amount of damage you want to be dealt. I suggest this to be very low, like anywhere from 1 to 5.

Again, add conditions as necessary.
 
Level 1
Joined
Jul 19, 2007
Messages
2
Quite easy, if I understood correctly.

Firstly, how does one obtain a car? is it like a hero (1 per player) or perhaps it is a unit that can be trained many times (maybe even 200!),

I need to know so I can write the code for you.

The code simply involves checking the terrain type at the car, if it is not 'Road' then we move it backwards based on the direction it is driving
 
Quite easy, if I understood correctly.

Firstly, how does one obtain a car? is it like a hero (1 per player) or perhaps it is a unit that can be trained many times (maybe even 200!),

I need to know so I can write the code for you.

The code simply involves checking the terrain type at the car, if it is not 'Road' then we move it backwards based on the direction it is driving

That's exactly what I've posted earlier.
 
Level 7
Joined
Apr 3, 2007
Messages
293
Ok, The map is called Cops and Robbers. THe Cops and Robbers can get into a car, "already pasted onto the map," and drive it aound the city. If the car goes of the road, it takes 3 dammade a second. Also, I havent been useing Asphalt, Im useinf White Marble (Cityscape). If you know where I can get Ashalt, I would apreashiate t.
 
Why are you asking for something I already made? Just change the Asphalt to your white marble then.

  • Events
    • Time - every 0.33 seconds of game time
  • Conditions
  • Actions
    • If, Then, Else
      • If - Conditions
        • (Terrain type at TempPoint) Not equal to Dalaran - White Marble
      • Then - Actions
        • Unit - Move (Car) instantly to TempPoint
      • Else - Actions
        • Unit - Set (Car)'s life to ((Current life of (Car)) - 1)
    • Set TempPoint = Position of (Car)
 
Level 7
Joined
Apr 3, 2007
Messages
293
5:08PM: What type of variable is tempoint? And (car) is a unit variable, right?

6:26PM: Crud, I just ran into another proublem. I am trying to get the car to load the unit into it, but it's not working. The ability is fine, and I even remade the ability twice. For some reason, Load can't pick up the Cops, OR the Robbers, they r ground units, and Load can pick up ground. An even better way would to remove the unit, but I dont know how to creat the same unit once they get out of the car. I cant just say, "Creat Robber" Because what if it's a cop in the car... Can you please help me with this problem as well, thanks. : )
 
Last edited:
Level 7
Joined
Apr 3, 2007
Messages
293
It's, still not working, look, I did EXACTLY as you' said, or as I understood.
 

Attachments

  • 1.jpg
    1.jpg
    132.2 KB · Views: 106
  • 3.jpg
    3.jpg
    38.5 KB · Views: 110
  • 2.jpg
    2.jpg
    38.3 KB · Views: 108
Level 4
Joined
Jun 1, 2007
Messages
92
It's, still not working, look, I did EXACTLY as you' said, or as I understood.

Well the terrain where the car is at in the picture is NOT Cityscape - White Marble.

Edit: There are 2 ways you can do the trigger...

1. Set each car to a variable for use in Damage Car.
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Car[1] = Siege Engine 0001 <gen>
      • Set Car[2] = Siege Engine 0008 <gen>
      • Set Car[3] = Siege Engine 0005 <gen>
      • Set Car[4] = Siege Engine 0002 <gen>
      • Set Car[5] = Siege Engine 0004 <gen>
      • Set Car[6] = Siege Engine 0003 <gen>
      • Set Car[7] = Siege Engine 0006 <gen>
      • Set Car[8] = Siege Engine 0007 <gen>
Then use For Each Integer to set Temp_Point to the position of the Car and if it isn't Square Tiles, it will take up to 20 damage per second.
  • Damage Car
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set Temp_Point = (Position of Car[(Integer A)])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at Temp_Point) Not equal to Cityscape - Square Tiles
            • Then - Actions
              • Unit - Set life of Car[(Integer A)] to ((Life of Car[(Integer A)]) - 1.00)
            • Else - Actions

2. This way is a lot easier because it uses groups to find the Cars and deal damage if it isn't on Square Tiles, however you will need to remove the leaks afterwards.
  • Damage Group
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Siege Engine) and do (Actions)
        • Loop - Actions
          • Set Temp_Point = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at Temp_Point) Not equal to Cityscape - Square Tiles
            • Then - Actions
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 1.00)
            • Else - Actions
 
Last edited:
Try adding this into the Then part of the thingy
  • Events
    • Time - every 0.33 seconds of game time
  • Conditions
  • Actions
    • If, Then, Else
      • If - Conditions
        • (Terrain type at TempPoint) Not equal to Dalaran - White Marble
      • Then - Actions
        • Unit - Move (Car) instantly to TempPoint
        • Unit - Order (Car) to stop
      • Else - Actions
        • Unit - Set (Car)'s life to ((Current life of (Car)) - 1)
    • Set TempPoint = Position of (Car)
 
Level 7
Joined
Apr 3, 2007
Messages
293
I have no idea what I just typed in,but it works, lol. The only problem is, I can't get it to only take away 2 HP repeatedly, I put in, set Hp-2, it gives the car 2 HP... I put in Set Hp- -2, it's gives the car negative 2 HP/ kills the car.
 
Level 8
Joined
Jun 13, 2007
Messages
313
What you need to do is:

1. Under the Actions selection, go to unit.

2. Find Set Life (To Value)

3. You should see something like Set life of (triggering unit) to (life of(triggering unit)

4. The bit you need to change is bolded. First click on life of(triggering unit)) and then change the function to arithmatic. Now you should set to to Unit property (Life of (unit)) - 2

So what that does, is every second or whatever, it sets the life of a unit to the unit's current life minus one.
 
Level 4
Joined
Jun 1, 2007
Messages
92
You should use this trigger to get that part done, if a Car steps off the road, it will take about 3-10 damage and move back slightly, so it cannot go off the road at all, which should solve the problems if you did it correctly.
  • Damage Car
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set Temp_Point = (Position of Car[(Integer A)])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at Temp_Point) Not equal to Cityscape - Square Tiles
            • Then - Actions
              • Unit - Move Car[(Integer A)] instantly to (Temp_Point offset by 5.00 towards ((Facing of Car[(Integer A)]) + 180.00) degrees)
              • Unit - Set life of Car[(Integer A)] to ((Life of Car[(Integer A)]) - 1.00)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_Temp_Point)
 
Level 7
Joined
Apr 3, 2007
Messages
293
Once again, I have no idea what I just typed in, BUT IT WORKS! THANK YOU! Now we can get down to what realy matters, lol. How do I make a unit constantly walk on only 1 type of terrain? Oh, one moret thing. Is there a way to only do an action wile a unit is moving?
 
Level 9
Joined
Jun 26, 2007
Messages
659
I asked 2 ppl if icould look at their maps
Have you said "with the world editor"?

you can simply add blockers along the road, but with a margin to allow car to go out of the road.

________________________________

[car}
________________________________ < road
________________________________ < space between road and blockers

________________________________ < blockers

\o/
[.]
/ \
villagers (can't go through blockers)
 
Status
Not open for further replies.
Top