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 / Working on a stealth AI script

Author
Message
Disturbing 13
19
Years of Service
User Offline
Joined: 12th Apr 2005
Location: Murder Capital of the World
Posted: 19th Aug 2013 06:54
OK guys, I am working on a stealth AI script that allows the player to sneak up on a guard that is walking a waypoint and stab him from the back for a 1 hit kill, but if you alert the guard you have to fight him with his normal health. I have all this accomplished. The one thing I don't have is if the guard sees you and then you hide, how does he reset to his calm waypoint walking state? I have tried variations of plrcannotbeseen with no luck. Any help would be appreciated. Here is what I have so far.


Model pack 66-99 high quality items...cheap!!
"Who loves ya baby!"
uman
Retired Moderator
20
Years of Service
User Offline
Joined: 22nd Oct 2004
Location: UK
Posted: 19th Aug 2013 13:12
Hi Disturbing,

I am no expert scripter but have worked of Classic AI a long time ago quite extensively.

Today there are a lot more commands though I don't know if any are specifically AI related and in any case I do not have knowledge of them.

As Classic was updated I found my bespoke older AI scripts no longer worked correctly so was always playing catch up trying to update them which was never easy in the first place.

Anyway I see you are using :nearactivatable

I often found the plrcanbeseen command to be less stable and successful than player proximity commands so I would use those if your need is to manage the scenario and can use a player distance command successfully within it so that when the player is beyond a certain distance at the stage you require the enemy goes back to his patrolling.

I am sure that wont be very helpful but I have always found proximity commands to work well so worth a try if you can fit them in.

Must be a good scripter around who could help.



There are those that said this day would never come. What have they to say now?
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 19th Aug 2013 14:15 Edited at: 19th Aug 2013 14:17
ok, let´s help you.

plrcanbeseen is a command which ask if the player is in an angle of 120(I thought) in front of the npc. So there is no difference between dark and bright.

(I have anywhere a stealth script on my hd, maybe I should include that in my AI Script Pack)

For your problem:

You can use triggerzones, place them in the dark and if the player is in it, the AI can´t see him.
then you must modify the npc script like this

and use a triggerzone with this:

of course you must name all your enemies the same.

But for me there is a better solution(more accurate, i think):
Place a invisible item under your lights(no collision) and make a script like this!!!

Name all your enemies the same....
then you must modify the npc script like this


I did not test it, so you must be a scripter to understand what you should do.

Make this forum to something a little bit better and release more stuff. So we can push the Request/NoobHelp threads aside.
Disturbing 13
19
Years of Service
User Offline
Joined: 12th Apr 2005
Location: Murder Capital of the World
Posted: 19th Aug 2013 22:50
The script that I posted is just the pace script with 2 extra commands added to it. It's mainly for altering the health. I'm grateful for the stealth script you guys provided but what I need is some way to make the enemy return to a calm state and continue along the waypoint if he loses sight of the player. I will however see if I can use the scripts you provided in conjunction.

Model pack 66-99 high quality items...cheap!!
"Who loves ya baby!"
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 20th Aug 2013 00:32
Sorry, I missunderstand you.

You must place a line in your shootscript, which goes to your main script. There you place the line:
:state=0:waypointstart,state=1

Hope this help you

Make this forum to something a little bit better and release more stuff. So we can push the Request/NoobHelp threads aside.
Disturbing 13
19
Years of Service
User Offline
Joined: 12th Apr 2005
Location: Murder Capital of the World
Posted: 20th Aug 2013 04:25 Edited at: 20th Aug 2013 04:26
Thanks! I will give this a try when I get home in a few hours.

Model pack 66-99 high quality items...cheap!!
"Who loves ya baby!"
Disturbing 13
19
Years of Service
User Offline
Joined: 12th Apr 2005
Location: Murder Capital of the World
Posted: 20th Aug 2013 09:35 Edited at: 20th Aug 2013 09:43
Didn't work. Right now his shoot script is the chase10 script available in people. i added the line to no avail.

Model pack 66-99 high quality items...cheap!!
"Who loves ya baby!"
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 20th Aug 2013 17:28
Ok i will work on it.

If I can get it to work, can I include it in my Script Pack.
I mean your modified Pace Script.

Make this forum to something a little bit better and release more stuff. So we can push the Request/NoobHelp threads aside.
Disturbing 13
19
Years of Service
User Offline
Joined: 12th Apr 2005
Location: Murder Capital of the World
Posted: 20th Aug 2013 19:23
Absolutely! I was giving it away freely anyway. My next move (once we get this guy going) is altering the script to work with a close combat character. This script will be good for making a MetalGear type game, but I also want to make one for an AssassinsCreed type game. This is why it's important to get the enemy back onto the waypoint when he looses sight of the player. Thanks for the help.

Model pack 66-99 high quality items...cheap!!
"Who loves ya baby!"
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 21st Aug 2013 13:41
Ok I want you to show my small success. It needs a lot of tweaks, but sometimes it works. So I must find some bugs.



Corno_1

Make this forum to something a little bit better and release more stuff. So we can push the Request/NoobHelp threads aside.
Disturbing 13
19
Years of Service
User Offline
Joined: 12th Apr 2005
Location: Murder Capital of the World
Posted: 22nd Aug 2013 03:12
I gave the script a go, but he no longer starts off following the way-point. When he does see me he does come after me, but when I hide he continues running strait in the original direction till he comes to an obstacle or maps end. He does however revert to a calm state allowing for the one hit kill from behind.

Model pack 66-99 high quality items...cheap!!
"Who loves ya baby!"
J0linar
14
Years of Service
User Offline
Joined: 3rd Feb 2010
Location: Vienna, AT
Posted: 25th Aug 2013 00:47
hey guys, that looks great
i wonder would this work the opposite way?

the ai keeping distance - moving in shadows only
to get to the player from behind for a 1 hit stab.

and no my intention wasnt to fill this thread with sauce
i just think it would make a interesting enemy type.

http://j0linar.carbonmade.com/

Login to post a reply

Server time is: 2024-11-23 10:40:04
Your offset time is: 2024-11-23 10:40:04