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 / making a zombie get killed when it touches a laser grid.

Author
Message
shadowfire
15
Years of Service
User Offline
Joined: 24th Mar 2009
Location: England
Posted: 23rd Aug 2009 16:19
hello, i'm making a laser grid kind of thing for my zombie survival game where barriers go up around a building and when the zombies touch it they die.

i have the barriers appearing when the players makes them sorted, the only thing i want to know is, how can i make the entity get destroyed when it touches (or is in the same zone as) the lasers?

i know it would have the destroy command in it, but there aren't any
things i can see to tell the script that the NPC is in the zone.

can anyone help me on this?

(btw i'm using fenix mod)

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 24th Aug 2009 01:07 Edited at: 24th Aug 2009 01:09
Try adding this to your laser Barriers Main AI...

:anywithinzone=1:activateallinzone=86

...then add the following to your Zombies Main AI...

:activated=86:runfpidefault=2

...Try that and see if it helps.

shadowfire
15
Years of Service
User Offline
Joined: 24th Mar 2009
Location: England
Posted: 24th Aug 2009 11:51
aw, thanks conjured! i'll try it right now!

shadowfire
15
Years of Service
User Offline
Joined: 24th Mar 2009
Location: England
Posted: 24th Aug 2009 12:22
ok, i spawned a zombie using my waypoint script, placing your commands in state 1 and state 2, it walked through the barriers and then dissapeared with only it's shadow left when it reached the end of the waypoint.

when i tried doing it without a waypoint it just stood there and didn't do anything.

here's the script i'm using:

this is the default script i'm using to test your code:


and this is the zombie script i'm using:


Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 27th Aug 2009 05:17 Edited at: 27th Aug 2009 05:23
Quote: "ok, i spawned a zombie using my waypoint script, placing your commands in state 1 and state 2, it walked through the barriers and then dissapeared with only it's shadow left when it reached the end of the waypoint."


I never said to put them in a state.
You should not have a state as a condition, so put them in like I said before.

They need to be checking for that in all states, so it is a stateless condition like the ones you have for the waypoints. (it checks for it all the time)

Try putting them in like I typed them above (without a state condition) and see what happens.

As far as the shadow; it is calling your destroy script that is assigned to the character, so it should be leaving or not leaving the corpse depending on that.

You could just pass that off as a burn spot left over from the laser disintegrating the body.
That also brings us to the idea of adding a "ZAP" sound for the laser's contact. (much like a patio bug zapper)

shadowfire
15
Years of Service
User Offline
Joined: 24th Mar 2009
Location: England
Posted: 27th Aug 2009 14:19
ohh... that's where i went wrong. i thought they had to be in a state.

as for the sound: i could do that easily.

shadowfire
15
Years of Service
User Offline
Joined: 24th Mar 2009
Location: England
Posted: 27th Aug 2009 21:20
still not working, this time i've applied the same commands on their own, but the zombie still does nothing.

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 28th Aug 2009 05:26
Post the scripts you are using now so I can test them.

shadowfire
15
Years of Service
User Offline
Joined: 24th Mar 2009
Location: England
Posted: 28th Aug 2009 13:17
ok.

laser grid:




main ai



the scripts are also attached.

Attachments

Login to view attachments
meteorite
18
Years of Service
User Offline
Joined: 19th Nov 2006
Location: The Capital Wasteland
Posted: 28th Aug 2009 19:20
Hmmm, try stretching a triggerzone over the lasers and put the


script in it

shadowfire
15
Years of Service
User Offline
Joined: 24th Mar 2009
Location: England
Posted: 28th Aug 2009 21:09 Edited at: 28th Aug 2009 21:21
ok. will try.

EDIT:

tried it, this time when i had no waypoints in the zombie didn't move, and when i had waypoints in the zombie followed it's own script normally and didn't do anything with the lasers.

meteorite
18
Years of Service
User Offline
Joined: 19th Nov 2006
Location: The Capital Wasteland
Posted: 29th Aug 2009 06:31
Maybe try changing the runfpidefault=2 to addhealth=-9999

or maybe 86 is too high of a number, I've been told 1-10 work. I havent tested though, so 86 could be fine for all I know.

If all else fails try 1

shadowfire
15
Years of Service
User Offline
Joined: 24th Mar 2009
Location: England
Posted: 29th Aug 2009 12:38 Edited at: 29th Aug 2009 13:03
what does activateallinzone=86 do anyway? but i'll try it with the health.

EDIT:

ok, i edited the zombies command to activated=86:destroy and activated=86:addhelath=-9999 and still the same thing.

and now i've changed it to activated=86 and activateallinzone=86 to 1, and still the same thing. i'm really stumped.

EDIT 2:

now i've tried it with an entity instead of a trigger zone and the same thing.

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 29th Aug 2009 21:44 Edited at: 29th Aug 2009 21:54
I tried the two scripts you provided above and I found the problem.

For some reason the anywithinzone wasn't acting right.

I replaced that with anywithin=50 and it will work.

So...



Quote: "what does activateallinzone=86 do anyway?"

Not much, except that it puts the entity in the 86th activated state.

That could be any number within range. (not sure of the max but have tested to 99)
I chose 86 because that is a number used to refer to terminating someone. (fired from a job or whacked by a hit man) "86 them"


"In American English, the number 86 used as a verb, to "eighty-six," means to "ignore" or "get rid of". The first recorded usage of this term occurs in the mid-1930s. There are many theories of the origin of this usage, most pertain either to death or to prohibition."...Wikipedia

In this case we are 86'ing the zombie with the laser.


Have Fun!

                             

shadowfire
15
Years of Service
User Offline
Joined: 24th Mar 2009
Location: England
Posted: 29th Aug 2009 22:53
Quote: "In this case we are 86'ing the zombie with the laser. "


lol!

thankyou so much conjured! i'll make an awesome script and post a video of a zombie gettin pwned!

meteorite
18
Years of Service
User Offline
Joined: 19th Nov 2006
Location: The Capital Wasteland
Posted: 31st Aug 2009 04:00 Edited at: 31st Aug 2009 04:02
Hmmm, perhaps a prob within the source. I'd check, but I dont get how a lot of the stock commands work since I'm new.

Or maybe it's just supposed to be anywithinzone with no value. But don't quote me on that.


I'm the exception to every rule, that rule withstanding

Login to post a reply

Server time is: 2024-11-25 06:54:54
Your offset time is: 2024-11-25 06:54:54