IMPORTANT! How to attract NPCs (Zombies)

Started by JamesTerrano, February 25, 2014, 08:50:20 pm

Previous topic - Next topic

JamesTerrano

Very important request for help!
I need for my game Dead World and The Walking Dead this:

How can I do this?
When I press Q (or any key), playable character makes a whistle or other sound to attract zombies. Zombies must come to the place from where the sound came out, but not chase the player. When I do so that the zombie switched from "random" to "approach", the zombie will chase player around the map. The purpose of this is for example to lure the zombies away from any place, etc.
So what? What I need do?

I already have a whistling sound. But I don't know how to make that Zombie only will come to the place from which the sound came.

I hope someone can help me. I'm currently doing part of the game where I need it most.
My current RMXP projects:
- AMC's The Walking Dead: RPG Fan-Game
- Lonely Warrior
- Dead World
My temporarily postponed RMXP projects:
- Pokemon X (lost after the collapse of my pc)
- High School of the Dead
My Canceled RMXP projects:
- Survivors of War
- Legend of the Seeker: Clones of Evil [trailer]

Jackolas

February 26, 2014, 05:17:35 am #1 Last Edit: February 26, 2014, 05:21:41 am by Jackolas
The way i would do it is to have the "q" press save the X and Y coordinates of the player current location in 2 variables.
then use a script like Advanced Pathfinding (if your using xp) to path find your zombies to that location.


just an idea

PhoenixFire

Honestly, that was actually my suggestion too, though I was looking for a simple way to do that with events. If you can get a simple script together that will read 2 variables and move towards that coordinate, you can always have an event that passes the player x/y coordinates to variables.
Quote from: Subsonic_Noise on July 01, 2011, 02:42:19 amNext off, how to create a first person shooter using microsoft excel.

Quote from: Zeriab on September 09, 2011, 02:58:58 pm<Remember when computers had turbo buttons?

JamesTerrano

And how can I do that? I'm not very good with variables and switches. 
:???:
My current RMXP projects:
- AMC's The Walking Dead: RPG Fan-Game
- Lonely Warrior
- Dead World
My temporarily postponed RMXP projects:
- Pokemon X (lost after the collapse of my pc)
- High School of the Dead
My Canceled RMXP projects:
- Survivors of War
- Legend of the Seeker: Clones of Evil [trailer]

PhoenixFire

Instructions in an image lolz: ShowHide


The script would simply need to read the two variables and make the event move towards the new X/Y coordinates.
Quote from: Subsonic_Noise on July 01, 2011, 02:42:19 amNext off, how to create a first person shooter using microsoft excel.

Quote from: Zeriab on September 09, 2011, 02:58:58 pm<Remember when computers had turbo buttons?

JamesTerrano

Well, let's say that I have set the variables. What else I have to do?  :???:
My current RMXP projects:
- AMC's The Walking Dead: RPG Fan-Game
- Lonely Warrior
- Dead World
My temporarily postponed RMXP projects:
- Pokemon X (lost after the collapse of my pc)
- High School of the Dead
My Canceled RMXP projects:
- Survivors of War
- Legend of the Seeker: Clones of Evil [trailer]

WhiteRose

February 27, 2014, 10:06:53 pm #6 Last Edit: February 28, 2014, 12:28:13 am by WhiteRose
Quote from: JamesTerrano on February 27, 2014, 08:12:08 pm
Well, let's say that I have set the variables. What else I have to do?  :???:


I can put together a tutorial for you. Give me a few minutes and I'll see what I can do.

EDIT: Okay, here we go! (Actually, winkio did most of the work; my mediocre scripting experience only got me so far. But we got it!)

1. Install Blizz's Lagless Pathfinder Script
2. For each zombie, you'll need to make an event page like this:
Spoiler: ShowHide


Make sure that it is set to parallel process. Also, the second conditional branch is cut off in the image. It should be:
$game_map.events[@event_id].has_path_target?


Finally, to change the button used for the whistle, set it as the condition for the first line. (I used the RMXP default "X" button here, which is actually the "A" key on the keyboard by default.)

I hope that helps! I can upload a demo if you need me to do so. :)

EDIT 2: I decided to just go ahead and put together a demo. Here you go! It's really just a modified version of Blizz's demo. Press A on the keyboard to whistle and make the guy come running to the location at which you whistled.

JamesTerrano

Thank you very much! This was very helpful. That's exactly how I wanted it. Thanks...  :)
My current RMXP projects:
- AMC's The Walking Dead: RPG Fan-Game
- Lonely Warrior
- Dead World
My temporarily postponed RMXP projects:
- Pokemon X (lost after the collapse of my pc)
- High School of the Dead
My Canceled RMXP projects:
- Survivors of War
- Legend of the Seeker: Clones of Evil [trailer]

PhoenixFire

The only thing I'm having an issue with on it now, is how do you get them to wander around at random when they're not traveling to their destination? Think zombies again here.. They'll go to the source of the noise (I even made them all slow and stuff to mimic zombies lolz), but when they reach the destination, they just stop.. How do I make it so they then go into wander mode?
Quote from: Subsonic_Noise on July 01, 2011, 02:42:19 amNext off, how to create a first person shooter using microsoft excel.

Quote from: Zeriab on September 09, 2011, 02:58:58 pm<Remember when computers had turbo buttons?

WhiteRose

Quote from: DigitalSoul on March 01, 2014, 12:09:37 am
The only thing I'm having an issue with on it now, is how do you get them to wander around at random when they're not traveling to their destination? Think zombies again here.. They'll go to the source of the noise (I even made them all slow and stuff to mimic zombies lolz), but when they reach the destination, they just stop.. How do I make it so they then go into wander mode?


I'll put my master scripting skills to work (ha) and see what I can figure out.