Help - Search - Members - Calendar
Full Version: [help] Zombie system.
RPG RPG Revolution Forums > Scripting > Event Emporium
ImHiPotion
I was going to make a zombie system.
"Well that's freaking obvious ImHiPotion."
Well yeh... but I ran into some problems.
"Please. Tell me something new."
Uhh okay... Well Here's what I expected it to look like:
Screen Shots


This dude follows the player, when he touches the player it calls this:

Now... This is how I'd imagine it would look. However it doesn't work.
Instead it just goes straight to the "Else" Part.
So I don't really know how to work around this problem. But if anyone could give me some tips or input on how I could make it work just post it, any input is good, even if it doesn't work it's progress.
Thanks

Thanks for your time or whatever.

~ImHiPotion

Edit: I should mention I'm using VX.
thatbennyguy
You shoudn't have 10 branches for button C, you should only have 1. And it should be parallel process, so the computer registers your button presses. And you should use the timer instead of the "wait" command. I'm at school at the moment, so I can't give a demo for you, but I'll try my best to describe it here and then elaborate more later. OK.

In your zombie event, start a timer in a variable TIMER. Then give the message to "Tap Space to break free" (inside the zombie event). Then call the common event (which should be "Parallel Process" so that you can press the C button while it runs).

In the common event, place three conditional branches. The first is one conditional branch checking the C button is pressed, incrementing the variable BREAK. The second is a conditional branch that checks if the TIMER >= 240, then if it is, game over. The third is a conditional branch that checks if the BREAK >= 10, then if it is, you succeed. In that case, remove the event or whatever.

edit
EVENT - Zombie:
Control Timer: Startup (0 min. 5 sec.)
Text: Tap Space to break free! \^
Call Common Event: Zombie Test: Break Free!

COMMON EVENT - Zombie Test: Break Free!
(( Trigger: Parallel Process ))
Conditional Branch: Timer 0 min 0 sec or less
@> Text: The zombie bit you! \^
@> Game Over
: Branch End

Conditional Branch: The C Button Is Being Pressed
@> Control Variables: [0001: BREAK] += 1
: Branch End

Conditional Branch: [0001: BREAK] >= 10
@> Text: You broke free! \^
@> Control Variables: [0001: BREAK] += 1
@> Control Switches: [0099: BREAK FREE!!!] = OFF
: Branch End
ImHiPotion
Ah How could I have forgotten to set it to parallel process!
I just tried your method however whenever I press "C" it breaks free instead of having to tap it 10 times.
Also as soon as you break free it attacks you again, however I presume this can be solved by a simple move route.
Other then that the it works like a dream. :3
The reason I put it in 10 times is so it acts individually so that when you press "C" it moves onto the next one until you press "C" or let the time run out. I assume that either way that method wouldn't work.

I'll tinker with it for a bit now and see how it goes but any more incite would be muchly appreciated.
thatbennyguy
QUOTE (ImHiPotion @ Jun 14 2012, 12:47 PM) *
I just tried your method however whenever I press "C" it breaks free instead of having to tap it 10 times.


Actually, the "C Button is being pressed" condition is looping over and over again so it's just going 10 times over. So we need to get a condition that detects the moment that the C button is pressed. Try this:

Conditional Branch: Script: Input.trigger?(Input::C)
@> \\blah blah blah

So, just input that script in there as a condition instead of "C Button Being Pressed".

QUOTE
Also as soon as you break free it attacks you again, however I presume this can be solved by a simple move route.

Yeah I wasn't sure about this. Do you want it to move away, or be deleted? If so, you can just put the movement route in the "Zombie" event, something like "Blood Animation", "Move Away From Player", "Wait: 30 sec".

QUOTE
The reason I put it in 10 times is so it acts individually so that when you press "C" it moves onto the next one until you press "C" or let the time run out.

Ah but do you see that the common event is a loop? So the first time it looped through, it checked whether the "C" button was being pressed 10 times. It wasn't, so it waited for 240 seconds. Then it checked whether the variable == 10. It wasn't, so it Game Over'd you. So you don't need "C" button condition 10 times, because the whole common event loops anyway (because it's a parallel process).
ImHiPotion
QUOTE (thatbennyguy @ Jun 14 2012, 02:21 AM) *
QUOTE (ImHiPotion @ Jun 14 2012, 12:47 PM) *
I just tried your method however whenever I press "C" it breaks free instead of having to tap it 10 times.


Actually, the "C Button is being pressed" condition is looping over and over again so it's just going 10 times over. So we need to get a condition that detects the moment that the C button is pressed. Try this:

Conditional Branch: Script: Input.trigger?(Input::C)
@> \\blah blah blah

So, just input that script in there as a condition instead of "C Button Being Pressed".

QUOTE
Also as soon as you break free it attacks you again, however I presume this can be solved by a simple move route.

Yeah I wasn't sure about this. Do you want it to move away, or be deleted? If so, you can just put the movement route in the "Zombie" event, something like "Blood Animation", "Move Away From Player", "Wait: 30 sec".

QUOTE
The reason I put it in 10 times is so it acts individually so that when you press "C" it moves onto the next one until you press "C" or let the time run out.

Ah but do you see that the common event is a loop? So the first time it looped through, it checked whether the "C" button was being pressed 10 times. It wasn't, so it waited for 240 seconds. Then it checked whether the variable == 10. It wasn't, so it Game Over'd you. So you don't need "C" button condition 10 times, because the whole common event loops anyway (because it's a parallel process).


QUOTE
Conditional Branch: Script: Input.trigger?(Input::C)
@> \\blah blah blah

So, just input that script in there as a condition instead of "C Button Being Pressed".

Okay just tried the script method, that didn't work. It does the timer conditional branch but then the other two don't happen. The "zombie" just walks into you and then repeats. So it just says "Press C to break free" until he moves away.
Since I know nothing of scripts I wouldn't have even thought of looking into using scripts in any way. But since you said it I might as well take a look at what else would look logical to put in.
thatbennyguy
QUOTE (ImHiPotion @ Jun 14 2012, 02:16 PM) *
Okay just tried the script method, that didn't work. It does the timer conditional branch but then the other two don't happen. The "zombie" just walks into you and then repeats. So it just says "Press C to break free" until he moves away.
Since I know nothing of scripts I wouldn't have even thought of looking into using scripts in any way. But since you said it I might as well take a look at what else would look logical to put in.


Oh OK never mind then. Are you sure you're putting the script in the conditional branch where the "C button pressed" was? Sorry, I'm not at home at the moment, but when I do get home I'll try this out. If I get it going I'll give you the demo or something. When I get the chance.
Mustaklaki
just give em' some bath salts and boom there's your flesh eating event right there.
ImHiPotion
QUOTE (Mustaklaki @ Jun 16 2012, 06:10 AM) *
just give em' some bath salts and boom there's your flesh eating event right there.

That's a great idea but I'd have to event the bath salts too. :/ Hmm this is quite a dilemma we're facing here... Perhaps I'll event both ;P
But in all seriousness my searches have yielded nothing...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.