Main Menu

Spawning vehicles reletive to player[resolved]

Started by popopo169, August 14, 2009, 03:24:26 PM

0 Members and 1 Guest are viewing this topic.

popopo169

I was wondering if there was a way to spawn vehicles relative to the players x,y coords? Or make the player seem like a vehicle which can be toggled through a spell?

modern algebra

Yeah, the event command set vehicle location will put the vehicle anywhere you want it.

All you need to do to make it relative to the player is use variables - set three variables:

Contorl Variable -> Other -> Map ID
Control Variable -> Player -> Map X
Control Variable -> Player -> Map Y

Then you can play around with those variables to put it where you want.

If for instance, you wanted to put it directly in front of the player, you would need to grab direction as well, then have a command like this:

Control Variable[1] -> Other -> Map ID
Control Variable[2] -> Player -> Map X
Control Variable[3] -> Player -> Map Y
Control Variable[4] -> Player -> Direction
Comment: Direction; 2=> Down; 4 => Left; 6=> Right; 8 => Up
Conditional Branch: Variable 4 <= 4
  Conditional Branch: Variable 4 == 4
    Control Variable[2] -= 1
  Else
    Control Variable[3] += 1
  END
Else
  Conditional Branch: Variable 4 == 6
    Control Variable[2] += 1
  Else
    Control Variable[3] -= 1
  END
END
Set Vehicle Location: Variable [1], [2], [3]
 

popopo169


NPC

then put [RESOLVED] in the title of the original post
Why do 1 lined nameless NPCs never get taken seriously?