RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Problem with event

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 81
Ok so im trying to make it so when the player touches or is on this event, it inflicts damage. But its like holes in the ground that spikes poke out of every few seconds. So I only want it to inflict damage if touching it while spikes are up of course. What ive got so far, an event with the sprite of the holes thats a parralel process, it waits twenty frames then turns a self switch on. When self switch is on, it uses the move route to play the spikes poking up and going back down, followed by turning self switch back off. So it looks right, but I dont know where to go from there. I would want it to inflict damage on players touch, but if its set to that, it of course wouldnt play animation or turn switch until the player touches it. So I probably did it entirely wrong, please enlighten me

***
Rep:
Level 81
it's time to poke
Use variables--- You'll need four.

If the map x and y of the player matches the map x and y of the spike trap when the spikes are up, deal damage.


**
Rep: +0/-0Level 81
Ok I kinda know what variables are, but I cant figure out how to set or find the x and y variables or whatever. Do I do like a conditional branch?

***
Rep:
Level 81
it's time to poke
Just set them up like this:
1 == This Event's Map X
2 == This Event's Map Y
3 == Player Map X
4 == Player Map Y

Make sure that you "set" the variables instead of add/sub/mul/div. Since it's a parallel process, it will be happening the whole time.

And have a conditional check for when they are equal to each other.


**
Rep: +0/-0Level 81
Yes! Thats exactly what I needed. Thank you so much!

***
Rep:
Level 81
it's time to poke
Ah, no problem.


**
Rep: +0/-0Level 81
So so terribly sorry, but I guess I spoke too soon. Do I need to make another event on autorun which sets the variables? Sorry im not very experienced

**
Rep: +0/-0Level 81
Oh got it! for real this time. Im a retard

***
Rep:
Level 83
Kidfox70. It happens.
Actually, I have a simpler way of doing this. It uses no Varibles and only one Switch. You can also copy and paste this as many times as you like, therefore if you need many of this traps, you don't need extra Variables to account for where and when the player is on the trap.

I'm using a Spike Trap for the example. First make an Event, name it Spike Trap. Next set Move Route (Or Pattern) to Custom. When editing the Move Route, in the Define Route window, have a wait command for how long as you want it. Lets say 40 Frames. Next have a switch turn on, say Switch: Spikes (All the Switches, being turned on or Off are done within the Move Route Commands) Set it to repeat. Press Ok, you're done with the move route command. You'll need to change the Frequency to Highest. Now you need to make the Evet a passive Event, or at least on the First Page. Next Set it to Parrallel Proccess. Alright, TO THE NEXT PAGE! On the Second page, Change the Graphic to the Spikes being fully up (if you want the Spikes to slowly raise, and then slowly go down, see the spoiler). We're going to do basicly the very same thing as before, but add some things. First of all, the preconditions of the Second Page, have to be the Spike Switch On. The next thing you'll do is set it to Custom and Set the Move Route, like before. Clcik Define Route and put a wait command for 40 seconds and then turn the Spike Switch off. Make it Repeating and then click OK. You'll need to change the Frequency to Highest, like before. The very last thing you need to do is set the Trigger to Hero Touch. You are now done and a proud owner of a trap, which is far easyer than before.

Spoiler for:
Ok, so to have moveing spikes, do everything as before. BUT! Add something to the second page Move Route. Also, keep the Graphic from the first page, and set it for the second page, instead of changing the Graphic. In the Second Page Move Route, you need to add this:

Face left
Wait:4
Face Right
Wait:4
Face up
Wait:40
Face Right
Wait:4
Face Left
Wait:4
Face Down
Switch: Spikes Off

Of course set this to repeating and you're done!

That should be everything. I hope it helped and was simple!  :D
I don't say bless you when people sneeze, cause i'm not God. Blessing people is his job. Lolo?