Zombie style enemy

I want to create a zombie style enemy that's an event, and when the player touches it, the player loses a certain amount of life. So far I have the graphic set, the autonomous movement set, the changer hp set, allow knockout checked, even a sound effect. however I can't figure out why it just kills me one hit no matter what. how can I make it so that the zombie only attacks one time once the player is touched?
 

My even command looks like this.

page 1

Autonomous Movement

     Custom

     Move Route

          Move toward player

               Repeat action (checked)

               Skip if Cannot Move (checked)

Contents:

Play SE

Change HP: [],-1

the reason why i don't have a name in the brackets is because I am using an in game character design script designed by Kai Monkey. I am also using Falcao Pearl ABS Liquid v2 for an ABS system.
Is your event set to parallel process? If it is, change it to Event Touch instead.


If it isn't, then show us a screenshot of the entire event window - it contains a lot more important information than people usually think to include when they're describing it.
I suppose the enemy I am trying to describe is similar to the zombies in Mad Father...? Anyways here is a screenshot.

 

I feel like an idiot now... I can't find the button to upload the picture.... haha
You need to use the full editor, or just type it in manually, like this:

Code:
[img=http://image.url.here.png]
You don't upload images to the forum. You need to upload them to a photo sharing site (photobucket et al), then put the link in your post.
[IMG]https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-frc3/q71/s720x720/1236072_717468918267384_2083622407_n.jpg[/IMG]


Here it is. It may be difficult to see.
You can add a wait to the enemy after attacking by doing something like this.

First, at the end of your event, activate a self switch (ex. A). Then make a new page, activated by the self switch you just used. Now on the new page, inside the custom route (automatic motion?):

<>Wait X frames

<>Call script: $game_self_switches[[@map_id,@id,"A"]]=false ; $game_map.refresh

$game_self_switches[[@map_id,@id,"A"]]=false ; $game_map.refreshThis code will turn the event self switch A off. Second part ( ; $game_map.refresh) refreshes Game_Map, because if not there is a 70% chance of changes not taking effect x'D.

Spoiler
I'm probably not going to do this more than once, but here it goes. Worst is nothing (?).
$game_self_switches : The object that contains all self-switch information. You can access every self-switch by giving it the following terms inside of double-brackets (see more about arrays on the RMVXA manual to comprehend why).

[[map_id,event_id,'the letter between quote marks (either single or double, ' or ")']]

false : a boolean value. 1 or 0. true or false. Life or death. In this case true or false only.

$game_map : This manages all in the map. Events, tilemap, you name it.

refresh : This is a common name for a method that refreshes all information within an object. You call it by putting the object's name period method name: $game_map.refresh
Hope this helps you,

Orochii Zouveleki
You could just add a Wait X Frames at the end of those event commands, rather than going to all that trouble with additional pages.


John, how many HP does your actor have at this point? Instead of a custom move route, just change it to Approach. That will do the same thing.


You could also add a Call Script command just after damage is done, and play with the console turned on, so you can SEE that it's only doing 1 damage at a time and how many times it's happening (then of course, once the problem is resolved, take it out). This is what you'd put in the command, where id is the actor's id:

Code:
p $game_actors[id].hp
The actors hp as of right now is 20, however I would rather it be lower if this works the way I want it to. I would like a similar effect of the Call of Duty: Black Ops Zombies, where if the player gets hit twice its game over, or something to that effect.

Also, I tried to wait command... it made it so the player couldn't move away from the zombie, so the zombie would deal more than 1 damage, with the battle system I am using it comes with a hud so it's easy for me to see what damage is dealt.

As for the custom move route, I know have it set at approach, and it works great. I had it at custom because I was trying something using the battle system I have set.

*Edit, I am watching a video of Mad Father, this time a little closer, I see that when the zombie hits, it does the exact same thing mind is doing. So maybe I should just keep it as is, have the zombies drop potions (unless there is a way for life to regain slowly back to normal similar to a Regen Spell but always on) for the play to regain health so they game isn't overpowered.
What if, instead of the Wait, you add a Set Move Route (this event): Wait X frames and make sure the wait for completion box is UNchecked?


I just don't remember, when an event has autonomous movement and you apply a move route to them, which one takes precedence.


If that doesn't work, the best solution MAY be the one suggested above by muramasa (though you need to use @event_id instead of @id, and you don't need to do the game map refresh, as that's done in $game_self_switches anyway).
Good news is, is that the autonomous movement takes precedence. Also I left the wait for completion box UNchecked, I set the wait time for 60 seconds (to see if it would allow the player to move away before the next attack comes) and it worked. Now if I set the wait time to something I like, I will have the desired effect! 

Now only 1 more issue that has to deal with this but it is somewhat different. should I post it into another post or would it be alright if I asked for help on this one?
The autonomous movement taking precedence would be a bad thing, because that means it'd ignore the wait you put in your Move Route command 🙂


Well ... since your thread heading doesn't actually state anything about one-shotting your player, if your other issue is still to do with the 'zombie style enemy' go ahead and post it here. If it's something else, a new thread would be better.
Well, whatever its doing now, on how it's set up, I'm getting the desired effect.

Alright, so let's say after the zombie hits the player, the player regains health without using an item, but automatically, a little over a set period of time.

Would it be a completely different event, a setting on the actor/class, or would it be a setting the zombie event contains. I ask it this way because I am using an Active Battle System similar to the original Legend of Zelda.
If you wanted something like, say, ONLY after being hit by a zombie, add 1HP every 10 steps until 100 steps are taken, I would do something like this:

In your zombie event, add the following code (use whatever variable and switch IDs you have available):

Control Variables [0001: Steps When Hit] = Steps (from Game Data > Other)Control Switches [0001: Zombie Hit] = ONthen set up a common event which runs as a parallel process and is conditioned by that switch, with the following commands:
Code:
Control Variables [0002: Current Steps] = StepsConditional Branch: Variable [0002: Current Steps] > Variable [0001: Steps When Hit]  Control Variables [0002: Current Steps] -= Variable [0001: Steps When Hit]  Conditional Branch: Script: $game_variables[2] % 10 == 0 (change [2] to be whatever variable you're using)    Change HP: [] + 1    Conditional Branch: Variables [0002: Current Steps] == 100      Control Switches [0001: Zombie Hit] = OFF    Branch End  Branch EndBranch EndWait 1 Frame(s)
So, if I've done that right, here's what will happen when the player gets hit by a zombie:Variable 1 will record the current number of steps (at the point where the player was hit)

The parallel process event will start running

Each loop:

- Variable 2 will hold the current number of steps (variable 1 will stay the same as the player moves around, but variable 2 will change)

- Every 10 steps, the player will gain 1HP

- After 100 steps, the parallel process will stop running
I will try that, should this be set after the zombie's set move route: wait command?
No, put it before the wait command I think, so it starts counting steps while the player gets the opportunity to get away.
I set it up exactly like that, however I ran around for a while after being hit and i didn't regain health.
Can you do a screenshot of your zombie event, and another of the common event?


This time, add it to your post, rather than just linking to facebook. In fb, you can click on the image to enlarge it, then right-click and choose Copy Image URL.
Common Event

Spoiler
[IMG]https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-prn2/1271099_717606591586950_1579144426_o.jpg[/IMG]

Zombie Event

Spoiler
[IMG]https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-ash3/1279008_717606598253616_785789217_o.jpg[/IMG]

I hope I did it correctly.
No, for some reason it's putting them in as URLs and not just the image paths. But I fixed them and put them into spoilers because they're so big (much easier to read than the first one, though). If you edit your post, you can see what I did.


You can also do Alt+PrintScreen to just capture the current window (the event window) instead of the whole desktop, to give you a slightly smaller image.


Here's your error:


In the common event, you've got this:

Control Variables [0002: Current Steps] = Variable [0001: Steps When Hit]but it should be this:
Code:
Control Variables [0002: Current Steps] -= Variable [0001: Steps When Hit]
You're using the Set operation instead of the Sub operation. Change it to Sub and see if that makes a difference.
And actually, just to be on the safe side, let's also change that innermost conditional branch from this:

Code:
Conditional Branch: Variables [0002: Current Steps] == 100
to this:
Code:
Conditional Branch: Variables [0002: Current Steps] >= 100
I don't THINK it'll skip the 100, but we'd better play it safe, otherwise it'll just keep on giving you more HP even after the 'set period' has expired.
WOW! THAT IS SO GREAT! it works now!

Original thread: https://forums.rpgmakerweb.com/threads/zombie-style-enemy.17993/