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 / Enemy Spawning Machine

Author
Message
fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 25th Oct 2007 21:03
How do I do this, this is something I really need to be able to do.

Enemies are spawned when in radius of trigger, will keep spawing while in trigger zone until number that is set is reached (has to be a total otherwise there would be hundreds) will stop spawning if outside of trigger radius, if you go back in the trigger zone it will start spawning again. If a certain entity is destroyed then the spawning cannot happen.

fpsc game KillTV update 22Oct.http://www.avantivita.com/killtv.html
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 26th Oct 2007 02:50 Edited at: 26th Oct 2007 02:54
I have not tested this script but here ya go:



Put that into a triggerzone where you want the player to be in order to spawn enemies. Set the triggerzone's "IfUsed" field to the name of your enemy entity.

Now alter your enemie's AI script to include this:



Just stick those two lines at the beginning or end of the ";Triggers" section of the the enemy's AI script.

[EDIT]
Oh yeah, you'll need to set this entity's Spawning options as follows:
Spawn at Start = No
Max at any time = <max amount you want at any specific time>
Max Spawned = 9999
Spawn after delay = No
Spawn when dead = No
Number to spawn = 1

The rest of the options can be left as they are.
[/EDIT]

Now, for the third script. You wanted it so when the player kills a certain enemy, then the enemy spawner will not work. Okay make this script:



Set the target enemy's "Destroy AI" script to this script. Also, set that enemy's "IfUsed" field to the name of your triggerzone.


That oughta do it for ya... let me know how it goes. It's kinda complicated, but it should do it's job.


The one and only,
~PlystirE~

Dammit, Jim! I'm a programmer not a graphic designer!!!

(P)suedo code (L)inguist, (Y)ou (Sti)ll (R)eap (E)verything
fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 26th Oct 2007 19:04
Thanks Plystire, but Ive noticed a hick up, seems fpsc only allows 2 enemies doing something at once, put in all latest versions and patches, but its a fluke if you can get more than 2 bots to do an action, so my moster spawning fun looks like a no no. Ive posted in the chat section to see if any other fpsc users gets more than 2 characters moving.

fpsc game KillTV update 22Oct.http://www.avantivita.com/killtv.html
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 26th Oct 2007 19:37
Hmmm, that doesn't seem right! I've almost always had more than 2 enemies shooting at me. It's kinda like... a requirement for FPS games.

Perhaps it's the way that your enemies spawned to life. That may have had an effect on how their AI gets processed, due to the fact that they are, in essence, the same entity. But that doesn't make much sense either because I've had 3 guards spawned from the same entity before, and each of them worked fine.

I take it from your post that the scripts I wrote worked at least?


The one and only,
~PlystirE~

Dammit, Jim! I'm a programmer not a graphic designer!!!

(P)suedo code (L)inguist, (Y)ou (Sti)ll (R)eap (E)verything
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 26th Oct 2007 19:40
Since the latest update, I've had 25 charcters, using the same script, to continuously respond, follow, shoot, etc. I know that the size of the level has an effect on this as well. My test was one room full of characters and me.

Best.

I'm sorry, my answers are limited. You must ask the right question.

Cheese Cake
17
Years of Service
User Offline
Joined: 11th Dec 2006
Location: At the bakery
Posted: 27th Oct 2007 03:35
I have checked your script out plystire....
But it spawned transparent characters...

Also the AI didnt do that correct....

It was just standing there...mostly it spawned in the floor...
So it just collapsed...


Great idea...too bad it didnt worked..


Cheers.
Cheese Cake.


fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 27th Oct 2007 06:28 Edited at: 27th Oct 2007 06:34
Quote: "25 enemies"
, I have a problem that if one has more than 2, then the bots dont do nothing only the closest 2 to the player, I think checking

Always Active under physics, stops that, think thats correct, I tried it and it stoped the closest 2 only problem, not sure if that the correct thing to do.

But 25, no way would I get decent frames, it gets slow at say 8, perhaps you have a real fast comp, mine is mid range, series 6 gforce, and 2.6 gig on the CPU, perhaps you have a more up to date system so can get good frames with 25.

Quote: "I've had 3 guards spawned from the same entity before, and each of them worked fine."


I made a square room, placed an entity monster in the room. Clicked on it placed it down, click place it down click it placed it down, click it places it down, thats how I place entities, not sure if thats spawned from the same entity or not, well to me its not spawning, they are there stood there, they are not spawning. perhaps there is a better way, but Im testing what one can do in fpsc, so I havnt got into every trick to do with it.

fpsc game KillTV update 22Oct.http://www.avantivita.com/killtv.html
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 27th Oct 2007 09:22
Hmmm, I don't see how the script could be faulty. It uses the same principle as having an enemy spawn ONCE when the player runs into a trigger zone.

This is shown in one of the FPSC official video tutorials... simply change the enemies properties to spawn more and allow more at once.

Doesn't that sound correct?


The one and only,
~PlystirE~

Dammit, Jim! I'm a programmer not a graphic designer!!!

FPSC Scripting Tutorials - http://forum.thegamecreators.com/?m=forum_view&t=116527&b=23
Cheese Cake
17
Years of Service
User Offline
Joined: 11th Dec 2006
Location: At the bakery
Posted: 27th Oct 2007 10:43
Hmmm.yeah than i am thinking that i am doing something wrong.

Cheers,
Cheese Cake.


Login to post a reply

Server time is: 2024-11-23 23:47:58
Your offset time is: 2024-11-23 23:47:58