Status
Not open for further replies.

Mahoken

Veteran
Veteran
Joined
Nov 24, 2013
Messages
41
Reaction score
3
First Language
English
Primarily Uses
I made floor spikes, and when your player walks over them, your screen flashes, and you take damage and also take a step back. Then I decided to make spikes that retract into the ground every once in awhile, then come back up, then go back down, and so on. It works perfectly besides one problem! If you're on the spikes when they come up from being completely retracted, nothing happens. You take no damage, the screen doesn't flash, and you don't take the step back. You can just stand there as if the spikes weren't there!

How can I make it so when the spikes come up while you're on them, they still do the normal properties of the spikes?

SCREENSHOT.png
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,086
Reaction score
15,499
First Language
English
Primarily Uses
RMMV
You'd have to have a page for them being down that runs as a parallel process event, and the moment they come up, have it check if the player's location is the same as its own location.
 

Mahoken

Veteran
Veteran
Joined
Nov 24, 2013
Messages
41
Reaction score
3
First Language
English
Primarily Uses
You'd have to have a page for them being down that runs as a parallel process event, and the moment they come up, have it check if the player's location is the same as its own location.
I know I'll sound nooby, but how do I make it so it checks if the player is on the same space as the event?
 

orathan

Villager
Member
Joined
Oct 11, 2013
Messages
27
Reaction score
3
Primarily Uses
Put this in a conditional branch:

$game_player.x == $game_map.events[event id].x && game_player.y == $game_map.events[event id].y
I'll apologize now in case the code is incorrect.
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,086
Reaction score
15,499
First Language
English
Primarily Uses
RMMV
Instead of [event id] you can actually type [@event_id] - this way you can copy and paste your spikes all over, and don't have to manually enter each event's id. It says "the id of THIS event".
 

orathan

Villager
Member
Joined
Oct 11, 2013
Messages
27
Reaction score
3
Primarily Uses
@Shaz - Thanks for correcting the error in the code.  I just wrote it based from what I recall.  Sadly, it was more than a month ago when I last used VXA that is why I wasn't able to remember every detail.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,086
Reaction score
15,499
First Language
English
Primarily Uses
RMMV
You did pretty well even if you'd only used it yesterday :)


Oh - that game_player.y should have a $ in front of it too. Apart from that typo, I think the syntax looks just about perfect :)
 

demmozero

Veteran
Veteran
Joined
Aug 12, 2012
Messages
41
Reaction score
0
First Language
English
Primarily Uses
I was having this issue and tried the script but I got an unexpected tIDENTIFIER error saying that it wants one of these ']' but I have no idea where to put it I did copy and paste it and make the changes shaz suggested also.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,086
Reaction score
15,499
First Language
English
Primarily Uses
RMMV
Are you saying you got it to work, or that you're still having troubles? The [ and ] should be around both instances of @event_id
 

demmozero

Veteran
Veteran
Joined
Aug 12, 2012
Messages
41
Reaction score
0
First Language
English
Primarily Uses
no it isn't working [and] are around both of the @event_id  this is the full error message

Script 'Game_Interpreter' line 450 SyntaxError Occured

unexpeted tIDENTIFIER, expecting ']'

...r.x==$game_map.events[@event

id].x&&$game_player.y==$game_ma...
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,086
Reaction score
15,499
First Language
English
Primarily Uses
RMMV
@event_id has a _ in the middle. In both places.
 
Last edited by a moderator:

demmozero

Veteran
Veteran
Joined
Aug 12, 2012
Messages
41
Reaction score
0
First Language
English
Primarily Uses
thank you thought it was odd that there was a space instead of an "_" that fixed it. also thanks for the solution to the retracting spikes and dmg orathan and shaz and thank you mahoken for saving me the trouble of asking myself.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,086
Reaction score
15,499
First Language
English
Primarily Uses
RMMV
Going to close this now, as I assume the OP would have come back by now if there was a problem implementing any of that.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

To my horror, I found out I got zero Jack Vance books in my bookshelf! :kaoback: Where do y'all go in the internet to buy used books? Like, not Amazon?
Marquise* wrote on Mrs_Allykat's profile.
Your new logo is sooooo attractive! Feels like those sour liquid candy mixed with the wrapping of the popping candy rocks ones. ^^ It gives flavor and taste to our eyes. ^^
Sorry I couldn't comment before, I relogged here for someone's B-Day yesterday. ((Yeah yeah... been scared got on the throne and all as usual. Being social seems harder than walking now. So sorry to everyone and especially you.))
How goes the game make?
Took me almost a year to flesh out this concept but hey, now it works.

Forum statistics

Threads
116,990
Messages
1,103,603
Members
152,872
Latest member
Applegreed
Top