- Joined
- Aug 1, 2013
- Messages
- 47
- Reaction score
- 26
- First Language
- English
- Primarily Uses
- N/A
I understand the logic behind RGSS but I'm not up to snuff on the proper syntax, callwords, etc.
Here's what I'm trying to do.
I've got a line of events like spikes or lava or whatever behind the player that continually move up in a straight line together forcing the player to keep running forward or else he takes damage. The event id's are 3 - 17.
I could use events to check for collision between the player's mapx,y and each event's x,y but I would need to create a x,y variable for all 15 events.
So I'm trying to use a script or a conditional branch-script to check for player collision between the player's position and any of the events' x,y.
I don't know how I could squeeze this into a conditional branch, it would need some sort of line break I think but I'm not sure.
Here's what I tried to use as a script in a parallel process event to check for player/event collision.
common event 4 makes the screen flash, plays a damage sound, reduces HP and bumps the player forward
eventrange = [3..17]for val in eventrangeif $game_player.x == $game_map.events[eventrange].xand $game_player.y == $game_map.events[eventrange].ythen $game_temp.reserve_common_event(4)endendI'm pretty sure that I've got the idea...but that my syntax is all jacked up.
Edit: Woops, forgot to put had [eventrange]x instead of [eventrange].x but still getting an error.
Now it says, unexpected keyword_and
I keep trying to reword or adjust the line breaks and I just keep getting different errors.
So to replicate this, create 2 events (they don't have to move) and a player.
I want to check if the player's x,y = the event's x,y of each event, then do something if it does.
So instead of if player's x, y = event1's x,y then do something; if player's x,y = event2's x,y then do something and so on...
I want if player's x,y =event(1...2)'s x,y then do something or alternatively an array with specified event id's like event(1, 3, 5, 6, 10, 13) whatever.
Here's what I'm trying to do.
I've got a line of events like spikes or lava or whatever behind the player that continually move up in a straight line together forcing the player to keep running forward or else he takes damage. The event id's are 3 - 17.
I could use events to check for collision between the player's mapx,y and each event's x,y but I would need to create a x,y variable for all 15 events.
So I'm trying to use a script or a conditional branch-script to check for player collision between the player's position and any of the events' x,y.
I don't know how I could squeeze this into a conditional branch, it would need some sort of line break I think but I'm not sure.
Here's what I tried to use as a script in a parallel process event to check for player/event collision.
common event 4 makes the screen flash, plays a damage sound, reduces HP and bumps the player forward
eventrange = [3..17]for val in eventrangeif $game_player.x == $game_map.events[eventrange].xand $game_player.y == $game_map.events[eventrange].ythen $game_temp.reserve_common_event(4)endendI'm pretty sure that I've got the idea...but that my syntax is all jacked up.
Edit: Woops, forgot to put had [eventrange]x instead of [eventrange].x but still getting an error.
Now it says, unexpected keyword_and
I keep trying to reword or adjust the line breaks and I just keep getting different errors.
So to replicate this, create 2 events (they don't have to move) and a player.
I want to check if the player's x,y = the event's x,y of each event, then do something if it does.
So instead of if player's x, y = event1's x,y then do something; if player's x,y = event2's x,y then do something and so on...
I want if player's x,y =event(1...2)'s x,y then do something or alternatively an array with specified event id's like event(1, 3, 5, 6, 10, 13) whatever.
Last edited by a moderator:
