Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Left 4 Dead style spawning help

Author
Message
Ikey
14
Years of Service
User Offline
Joined: 17th Apr 2010
Location: Look in the back seat of your car
Posted: 16th May 2010 22:20
I've been messing about with some script,and I am trying to make it so zombies spawn in the way that they do on Left 4 Dead, so Zombies spawn in places around you, but only so many can be around you at one time. I would also need a 'whorde' one, so that a load of Zombies run at you in a group. I have already started this, but it is going nowhere fast. If anyone has seen something like this, or are willing to put forward a couple of lines of script, please post.
Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 16th May 2010 23:56
Firstly, bond1 has released some great horde zombies which are similar to those in Left4Dead (very fast ones), so it's worth checking out those. To add a limit to spawning, you'd need to use variables to check how many are alive (add 1 when spawned) and then subtract one when dead. Scripting is the key here


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
Bugsy
15
Years of Service
User Offline
Joined: 24th Nov 2008
Location: another place in time
Posted: 17th May 2010 02:09
or just do spawn when dead or spawn after delay. I've noticed that even if enemies spawn, and delete corpse when dead, they don't go away. they still lag as if they are in the engine.

imageflock.com/img/1272671763.jpg[/img]
skype = isaacpreston. I want to talk to YOU
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 17th May 2010 17:18
Quote: "so Zombies spawn in places around you, but only so many can be around you at one time."

First, you would need to detect which part of the map the player is at. (multiple trigger zones covering the entire map that affect a variable's value)

Second, you would need to create a universal destroy script for the zombies that would read that global-location-variable's value.
Then the script would settargetnames for the zombies in that area, and then activate them for the spawn.

As mentioned before by Marc, it is easy to create custom appear and destroy scripts to count the zombies that are spawned.
You could use that number as a condition for the above destroy script, so that you only spawn the targets if the number is lower than your cap.
But, if the destroy is spawning them one at a time, then really you are only adding one for each one killed, so the number should stay the same anyway.
If you set up the zombies to die when the player is far away, then this system would keep popping them up near the player if they try to run.

I've never played Left4Dead, so I'm in the dark on the effect's particulars, but spawning them near the player seems doable.

   Conjured Entertainment

 WARNING: Intense Madness
Ikey
14
Years of Service
User Offline
Joined: 17th Apr 2010
Location: Look in the back seat of your car
Posted: 17th May 2010 19:37 Edited at: 17th May 2010 22:33
Yeah, thanks. I have the zombies, just the fact that they have to spawn in the right places, disappear when you're a certain distance away fom them, but they NEVER spawn where you can see (used with a certain distance required for spawning, ^^). I can already script a little bit in FPI, just not confident with it at ALL. ;D I'll read a couple more tuts, try out some basic scripts before I coninue with this anymore. Also I'll scan the entire forum for this, as it is something I imagine lots of people would use in Zombie games.If I find it, I will post it up here, if not, I'll post anything I manage to make here.
DarkAngelOblivion TM
15
Years of Service
User Offline
Joined: 7th Oct 2009
Location: Down under mate
Posted: 20th May 2010 09:49
lol you want a horde mode, well good luck with that. But seriously i dont even think if FPSC can handle 10 NPC's on screen at the one time. Maybe if you use xara mod to bump the FPS to like 70 then you may have a good go at it but unfortunately xara has crashed and burned for the moment...

Tomorrow never comes until it is too late...
MandoAndy
14
Years of Service
User Offline
Joined: 10th May 2010
Location: New Hampshire
Posted: 20th May 2010 17:02
Yeah, I agree with DarkAngel. I'm making a zombie game too, and I was going to go with a zombie horde sorta thing -- but instead I had to change the feel of the game because the engine couldn't handle so many NPCs at once.

Instead I made the player's movement slower and made the zombies stronger, so 1 zombie is more threatening than 10, and thus, scarier... but if you find a way to make the horde mode work, PLEASE SHARE YOUR TECHNIQUES. Best of luck to you!

Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 20th May 2010 17:40
I'm able to get around 40+ of bond1s mob zombies running at me at once with around 25fps and Project Blue so it all looks smooth. To see it, check out my left4dead car alarm project.


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
Ikey
14
Years of Service
User Offline
Joined: 17th Apr 2010
Location: Look in the back seat of your car
Posted: 21st May 2010 18:16
I had about seventeen of the Zombies on screen at once without the whorde sctripts I have been working on, and I have to say, Bond1's zombies seem to lag less than ANY of the other characters on FPSC. My computer is low spec, and I can have about forty of them working on Fenix mod.

2.30 GHz quad Core PC

2.00 GB ram

But I wasn;t hjust working on the whorde, I was working on a script that spawns zombies in random places around you, within a certain distance.
DarkAngelOblivion TM
15
Years of Service
User Offline
Joined: 7th Oct 2009
Location: Down under mate
Posted: 27th May 2010 13:59
i think even if you have a super computer it still wont make a difference with FPSC because the game engine seems to not make use of multiple cores and doesn't come with dual timer system (i hope they do that for V1.17). Although FPSC X10 does a good job at using multiple cores.

Tomorrow never comes until it is too late...
F22Raptor
14
Years of Service
User Offline
Joined: 10th May 2010
Location:
Posted: 9th Jun 2010 23:48
I 2 was working on a script such as u all except a couple of things went wrong when i set the zombies to respawn they respawn where they die (no no). Also when they do respawn why is it that if you are looking at an entity when it respawns it spawns invisible see through like...?

<F22>
Ikey
14
Years of Service
User Offline
Joined: 17th Apr 2010
Location: Look in the back seat of your car
Posted: 1st Jul 2010 08:29
That part is simple - Appear Script 2 or something.
But the script is giving me hell.
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 1st Jul 2010 14:21 Edited at: 1st Jul 2010 14:26
My approach is not elegant but a reliable one(the example is for 6 zombies).

Place 6 Zombies labeld A-H on the map and edit their properties in this way:
Spawn at Start = No
Max at any Time = 1
Spawn when Dead = Yes
Spawn after Delay = Yes
Delay Random = anything from 5-30 seconds depending on map
Maximum Spawn = how many waves you want.

Then place a trigger zone that activates all 6 for the first time.

Every spawning place needs an excuse for zombies to reappear undetected - like a corner of complete darkness or a hole in the ceiling/floor.

The central area should have 3 entry paths for the zombies while 2 different zombie spawn points lead into a single area entry path each.

The zombies themselves need scripts that don't include plrcanbeseen and have a plrdstwithin=1000 so when they spawn, they immediately set march to the player (their path should be completely obstacle free)

So what happens now?

1. Player enters trigger zone and zombies start to spawn.
2. Whichever path the player takes (the way he entered should be blocked somehow)he will encounter zombies.
3. Whenever a zombie dies, the same one respawns. But since there is a random delay and each 2 zombies share a single entry path to the main area it's not always the same zombie appearing there first - and there is also no obvious correlation between kill and respawn.
4. Since they don't respawn indefinitely, the player can survive if the kills them fast enough.

What's good about this method?
- There is a fixed max number of zombies activated at any time.
- There is no script needed so there shouldn't be any errors
- During playtesting the odds can easily be altered.
- If the paths are build right, no zombie ever will get stuck.

What's bad with this method?
- If a player presses forward to a single path and kills the zombies which just spawned there, he would actually watch the respawns.
- If the player has enough time to think a little about it we will realize that there is a simple system behind the respawns

I used this method with a fantasy graveyard where the skeletons respawned at different crypt entrances to make the impression that they poured out of the crypts. Technically it worked perfectly but it was of course illogical that a skellie walks out of a crypt while the player can't open the door himself.

In case you find my grammar and spelling weird ---> native German speaker ^^
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 2nd Jul 2010 07:32
I had an idea for this a while back and made a quick setup for spawning zombies from SELECT spawnpoints with a RANDOM number of zombies each time.

This doesn't require PB for the most part, but the crucial part of how it works does require PB (And that is... to turn a spawner ON and OFF at will). Some of you may have seen the box spawner that I made for one of my videos, how it would only spawn one crate at a time and never ran out of crates. That isn't easily doable in vanilla (if at all... I tried once and it didn't pan out well)


Here's how it worked:
- Create a few variables... "SpawnArea", "NumToSpawn", "NumSpawned"
- Set up a spawner script (used for the "Appear" script of the zombies) that will check for a specific "SpawnArea" value before attempting to spawn. This will allow you to set which area zombies are to be spawned in. If the value of the variable matches the value it's looking for AND if "NumSpawned" is less than "NumToSpawn", then it will spawn a SINGLE zombie (Spawn, then turn spawner OFF) and increment the "NumToSpawn" variable by 1.
- When you want to spawn zombies, simply; set "SpawnArea" to the area you want zombies to spawn in, set "NumToSpawn" to the amount you want, set "NumSpawned" to 0, and activate the zombie spawners.

That's about it. The spawner scripts handled everything, since once they're activated, they rely upon variables to continue spawning. Since each spawner only spawns ONCE per frame, you're ensured that your zombies will be fairly evenly distributed between the spawner entities.


This would have gone very nicely with DarkAI, so you could set up corridors for them to spawn from and they would find their way out and over to the player.


Sadly, I don't have those scripts anymore. Otherwise, I would have gladly posted them up here for people to use.


The one and only,


Ikey
14
Years of Service
User Offline
Joined: 17th Apr 2010
Location: Look in the back seat of your car
Posted: 3rd Jul 2010 14:38 Edited at: 3rd Jul 2010 14:39
Hehe. Thanks you guys. I'm going to work with what's been posted here. Ply, I'm probably going to be buying PB, so if I do, I'll work on that, and once the scripts are done, I'll post.


Ikey

Login to post a reply

Server time is: 2024-11-24 21:52:43
Your offset time is: 2024-11-24 21:52:43