DUAL EVENT TRIGGERS?
Posts
Pages:
1
Hey guys, this is my first request for advice here, hope somebody can help.
I'm making a *surprise* survival horror-esque game right now and the way I want my enemy mechanics to work is thus:
Enemies are visible in-field, they'll pretty much all be programmed to move "toward hero". Some (depending on enemy type) will engage you (Call Enemy Encounter) upon collision with hero, along with some horrible effects to transition into battle.. I've got that ALL sorted, that's fine.
However, with some types of monster I'm trying to get this to happen:
On collision - simulated enemy attack (plus screen/sprite flash and sound effects).. . If the player wishes to dispatch the enemy and remove them from the field map they must press the action key to initiate an enemy encounter and defeat them, otherwise the enemy will continue to pursue them and deal damage on collision.
This is an aspect I REALLY want to be able to implement as the nature of my game is intended to be about choices. You can evade enemies, choose to fight or not (and as you're nearly always somewhat underpowered, fighting is often-times not the best option)
Now.. I can't get this to work because only one event page operates at a time. I get either the collision damage page working... Or the "press key to begin fighting" page working.. Is there ANY way I can have both conditions working at the same time?
(Silly) things I've tried are:
a) Having both pages become active on the same switch operation (doesn't work, just goes to whatever the last page is)
b) Having one page with no switch preconditions and one WITH preconditions. That didn't work either.
I'm hoping there's a simple way around this. Any advice or ideas? I'm using RM2K3 by the way.
I'm making a *surprise* survival horror-esque game right now and the way I want my enemy mechanics to work is thus:
Enemies are visible in-field, they'll pretty much all be programmed to move "toward hero". Some (depending on enemy type) will engage you (Call Enemy Encounter) upon collision with hero, along with some horrible effects to transition into battle.. I've got that ALL sorted, that's fine.
However, with some types of monster I'm trying to get this to happen:
On collision - simulated enemy attack (plus screen/sprite flash and sound effects).. . If the player wishes to dispatch the enemy and remove them from the field map they must press the action key to initiate an enemy encounter and defeat them, otherwise the enemy will continue to pursue them and deal damage on collision.
This is an aspect I REALLY want to be able to implement as the nature of my game is intended to be about choices. You can evade enemies, choose to fight or not (and as you're nearly always somewhat underpowered, fighting is often-times not the best option)
Now.. I can't get this to work because only one event page operates at a time. I get either the collision damage page working... Or the "press key to begin fighting" page working.. Is there ANY way I can have both conditions working at the same time?
(Silly) things I've tried are:
a) Having both pages become active on the same switch operation (doesn't work, just goes to whatever the last page is)
b) Having one page with no switch preconditions and one WITH preconditions. That didn't work either.
I'm hoping there's a simple way around this. Any advice or ideas? I'm using RM2K3 by the way.
I think the collision damage page has to be parallel process and seperate to the choose to fight event. That way you'll incur damage while the choose fight dialouge is apparent? Dunno, could be wrong...
take the getting hit by the enemy on touch page, and add a 'key input processing' that only accepts the confirm key, set it to not wait until key pressed. Then have a loop after it that waits a set amount of time in .1 second intervals, and every interval checks to see if the confirm key was hit in the key input earlier. Have another fork inside the loop that breaks the loop after the set amount of time is over (let's say 1 whole second).

What this will do is basically add a 'when hero key pressed' event to the end of your 'when hero touched' event. The hero has 1 second to make up his mind about running or fighting, after which the monster has the ability to attack again (by having the loop break, you can be touched again)
I don't think the loop will mess up the ability to walk away from the touch event, you'll have to test though.

What this will do is basically add a 'when hero key pressed' event to the end of your 'when hero touched' event. The hero has 1 second to make up his mind about running or fighting, after which the monster has the ability to attack again (by having the loop break, you can be touched again)
I don't think the loop will mess up the ability to walk away from the touch event, you'll have to test though.
My suggestion would be to have a parallell event run on the side with a key input process at the top which waits for key to activate. once this key is hit, you take the coordinates of the hero and adjust it to become the tile infront of the hero. if hero is facing up, that would mean to subtract 1 from the hero y coordinate.
now make use of the "check event ID" with those coordinates, and store the result in some variable, which you then run against some list containing the event ID's of the different enemies. if there's a match you'll trigger a fight, if not, nothing will happen and the parallel process event will wait for another key input
now make use of the "check event ID" with those coordinates, and store the result in some variable, which you then run against some list containing the event ID's of the different enemies. if there's a match you'll trigger a fight, if not, nothing will happen and the parallel process event will wait for another key input
EDIT: No, I got Ramza's method to work :) thanks everyone. Now I'm trying to figure out if I can fiddle with it so the player can avoid incurring damage in-field by pre-emptively starting the combat. :)
I also have the problem that the engine insists on completing the page before activating the switch that removes the enemy from the field map after defeating it in battle (even though that switch activation is listed directly after the combat and the in-field enemy attack is below that)... Which means it gets to deal another blow in-field before disappearing. That WOULD make a cool effect with SOME enemies (allowing them to get a final blow in before dying) however it's a little unfair on the player this early on in the game and it for to be the case with most enemies.
I'm thinking I'll need to make some huge parent variable/conditional branch to contain both the standard collision behavior and this additional key-press event stuff.. However.. I only recently got to grips with variables/conditional branches (they seem to work backwards to me? :S) and I think it's a little beyond my understanding right now. Anybody have any suggestions?
Here is my current page codez.

I also have the problem that the engine insists on completing the page before activating the switch that removes the enemy from the field map after defeating it in battle (even though that switch activation is listed directly after the combat and the in-field enemy attack is below that)... Which means it gets to deal another blow in-field before disappearing. That WOULD make a cool effect with SOME enemies (allowing them to get a final blow in before dying) however it's a little unfair on the player this early on in the game and it for to be the case with most enemies.
I'm thinking I'll need to make some huge parent variable/conditional branch to contain both the standard collision behavior and this additional key-press event stuff.. However.. I only recently got to grips with variables/conditional branches (they seem to work backwards to me? :S) and I think it's a little beyond my understanding right now. Anybody have any suggestions?
Here is my current page codez.

Create a label below the damage calculations for if you don't fight, then make a jump to label just after the switch is turned on. It should bypass the damage.
Labels are fun friends to have. ^.~
Labels are fun friends to have. ^.~
post=147112
Create a label below the damage calculations for if you don't fight, then make a jump to label just after the switch is turned on. It should bypass the damage.
Labels are fun friends to have. ^.~
That should do it.
Glad to help :)
Pages:
1

















