じ☆ve冰风 发表于 3 天前

How To Set Up A Spike Trap

I have searched the forums and the net, and was unable to find a direct answer. Now that I have figured it out I though I would share. There may be a better way to do this, and if so, please share and I will update and credit.

On with the show...

For this event you will want to set up 2 tabs, each set to 'Priority' Below Characters and 'Trigger' Parallel Process.

Tab 1:


[*]Set your 'Graphic' to the spikes down image (located in the !Other1 graphics).
[*]Set a 'Conditional Branch' based on this 'Script' (Uncheck 'Set handling when conditions do not apply'):

$game_player.x == $game_map.events[@event_id].x && $game_player.y == $game_map.events[@event_id].y


[*]Inside the branch use a 'Flash Screen' command set to 10 frames.
[*]Next we want to 'Play SE' for the damage. I used 'Damage1', 80, 100
[*]Reduce the parties HP by your desired value (I used -10 HP) with the 'Change HP: Entire Party'.
[*]Lastly, set 'Control Self Switch' A to On


Spoiler
http://oi61.tinypic.com/r05x6r.jpg





Tab 2:


[*]Set your 'Graphic' to the spikes up image (located in the !Other1 graphics).
[*]Set the 'Self Switch' on the left to check if  'A is On'.
[*]Set a 'Conditional Branch' based on this 'Script'(This time leave 'Set handling when conditions do not apply' checked):

$game_player.x == $game_map.events[@event_id].x && $game_player.y == $game_map.events[@event_id].y
[*]Leave the first condition blank
[*]In the 'Else' condition, set 'Control Self Switch' A to Off.


Spoiler
http://oi59.tinypic.com/iljfyo.jpg





You can turn it off/on through the use of a lever or switch by making a third tab:
Tab 3:

Leave the 3rd tab blank, but place a check in the upper left 'Conditions' with your switch enabled (1st image) and set your graphic to the spike down position. For my example it is 'Condition 085: Spike T1 Deactivated'. If you do this you will want to set up a lever, button, switch, etc. with two tabs as follows:


[*]Tab 1​​For this tab, set your graphic of your choosing to what you consider to be the 'On' setting.
[*]Set the 'Priority' to 'Same as Characters.
[*]If using a lever, set 'Trigger' to 'Action Button'. If using a button that you step on, set 'Trigger' to 'Player Touch'.
[*]Set your 'Control Switch' to the Onposition. For this example mine is: Switch 085: Spike T1 Deactivated.
[*]Set your 'Control  Self Switch' to A = On.

[*]​Tab 2

[*]​For this tab, set your graphic of your choosing to what you consider to be the 'Off' setting.
[*]On the left, check the box for 'Self Switch' A to On.
[*]Set the 'Priority' to 'Same as Characters.
[*]If using a lever, set 'Trigger' to 'Action Button'. If using a button that you step on, set 'Trigger' to 'Player Touch'.
[*]Set your 'Control Switch' to the Off position. For this example mine is: Switch 085: Spike T1 Deactivated.
[*]Set your 'Control  Self Switch' to A = Off.




Spoiler
http://oi58.tinypic.com/2z707ky.jpg


Lever/Switch/Etc.

Tab 1


http://oi57.tinypic.com/sx2hwi.jpg


Tab 2


http://oi57.tinypic.com/5tisx.jpg




How does this work?

The first page of the event begins running as a parallel process with the graphic of the spikes down and checks to see if the condition applies. The condition has the script inside it that checks to see if the players X, Y position is the same as this event. Once the player steps on the event the condition activates which causes the screen to flash, a sound effect to play, the parties HP to reduce and then causes the event to go to the 2nd page. 

The 2nd page has the graphic of the spikes up and is set to see if the player is still standing in that location. As long as the player stands there the page is active. Once the player moves from that location the page is turned off and reverts back to the first page, showing the spikes in the down position.

What does the 3rd tab and lever/switch/etc. do?

This sets it so that when you activate the lever/switch/etc. it will deactivate the traps by turning on appropriate switch on the 3rd tab of the spikes. When that tab is active all that will happen is will display the trap in the down position. You can then re-engage the lever/switch/etc. to turn the trap back on.

References:

I used this thread to get started with this. It is thanks to the tips, notes and questions by Mahoken, Shaz and Orathan that I was able to get this set up.


本贴来自国际rpgmaker官方论坛作者:Shinma处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/how-to-set-up-a-spike-trap.38658/
页: [1]
查看完整版本: How To Set Up A Spike Trap