The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: popopo169 on August 14, 2009, 03:24:26 PM

Title: Spawning vehicles reletive to player[resolved]
Post by: popopo169 on August 14, 2009, 03:24:26 PM
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?
Title: Re: Spawning vehicles reletive to player
Post by: modern algebra on August 14, 2009, 03:42:32 PM
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]
 
Title: Re: Spawning vehicles reletive to player
Post by: popopo169 on August 15, 2009, 01:45:25 AM
Thanks man that was helpful
Title: Re: Spawning vehicles reletive to player
Post by: NPC on August 15, 2009, 06:40:21 PM
then put [RESOLVED] in the title of the original post