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 / New AI script.

Author
Message
David
18
Years of Service
User Offline
Joined: 27th Jun 2006
Location:
Posted: 27th Jun 2006 22:08
My first AI script, and first script, and first post. Try it out. If you find any problems let me know. And feel free to use it for whatever.

David
18
Years of Service
User Offline
Joined: 27th Jun 2006
Location:
Posted: 28th Jun 2006 02:07
;Artificial Intelligence Script

;Header

desc = Test AI

;Triggers


:state=0,animationover=2,random=36:animate=2,rotatey=90,state=1
:state=0,animationover=2,random=35:animate=2,rotatey=-90,state=1
:state=0:animate=2,state=1

:state=1,raycastback=0 30:pivotrandom=180
:state=1,raycastback=0 -30:pivotrandom=180
:state=1:movefore=8
:state=1,plrdistwithin=350,plrcanbeseen:rotatetoplr,state=2
:state=1,plrdistwithin=100,noiseheard=1:rotatetoplr,state=2
:state=1,shotdamage=1:rotatetoplr,state=2
:state=1:state=0

:state=2,random=60:reloadweapon,sound=audiobank\guns\reload.wav,state=3
:state=2,ifweapon=1:state=3
:state=2,ifweapon=0:reloadweapon,sound=audiobank\guns\reload.wav,state=3

:state=3,random=14:state=6
:state=3,random=17:state=7
:state=3,raycastback=0 30:pivotrandom=180
:state=3,raycastback=0 -30:pivotrandom=180
:state=3,healthless=25,shotdamage=1:pivotrandom=360,state=4
:state=3,plrdistwithin=300,plrcanbeseen,random=1:rotatetoplr,settarget,useweapon,rundecal=6,state=2
:state=3,plrdistfurther=300:state=5

:state=4:animate=5,runfore=10
:state=4,animationover=5,plrdistwithin=300,plrcanbeseen:rotatetoplr,settarget,useweapon,rundecal=6,state=2
:state=4,animationover=5:state=5

:state=5:rotatetoplr
:state=5:animate=5,runfore=3
:state=5,animationover=5:state=2

:state=6:animate=4,strafe=90,rotatetoplr
:state=6,animationover=4:state=3

:state=7:animate=3,strafe=-90,rotatetoplr
:state=7,animationover=3:state=3

;End of script
300 win mag
18
Years of Service
User Offline
Joined: 18th Feb 2006
Location: USA
Posted: 28th Jun 2006 06:12
its works fine it is better than the retarded ai script thay give you

Remaking Soul Survivor because compture crashed
David
18
Years of Service
User Offline
Joined: 27th Jun 2006
Location:
Posted: 28th Jun 2006 08:08
Second post was meant to take out the random reload line, but the edit button doesn't seem to work right, for me anyways. Won't affect anything since there's not yet an animation attached to it (forgot), but I have a feeling the occurrence rate is too high, and it doesn't really need to be there anyways. Don't have time for a few days to add the reload animation. And thanks for the feedback Mag.

So, very slightly updated:
brummel
18
Years of Service
User Offline
Joined: 26th Nov 2005
Location: Sweden
Posted: 28th Jun 2006 21:09
Woah, 83 looks and only one single comment...I havent tested this code but i can tell from the look of it that it works good. You seem to be one of the few who knows how to use raycast properly.

Good work!

Dont forget to visit my website for scripts!
gps
19
Years of Service
User Offline
Joined: 16th Dec 2004
Location: England
Posted: 28th Jun 2006 23:19
Very impressive debut! Welcome to the FPSC forums

Cheers

- Graham

Les Horribres
19
Years of Service
User Offline
Joined: 20th Nov 2005
Location: My Name is... Merry
Posted: 29th Jun 2006 07:23
83 looks + 4 posts = 4x3 = 12 83-12 = 72 views, 1 reply.

Why do you raycastback instead of raycast (i think) and why twice? either he is gonna hit a wall going forward... but I don't think he goes backward...

Isn't there a straftrandom or etc? Don't know if it works but...

Your Mod was deleted by the Government.
David
18
Years of Service
User Offline
Joined: 27th Jun 2006
Location:
Posted: 29th Jun 2006 07:30
Well, after about an hour of testing I figured out raycast works really oddly, and seems to detect bullets. Strangely, raycastback works perfectly. Took me about another hour to figure out you need one raycast for front and back walls and one for side walls.
David
18
Years of Service
User Offline
Joined: 27th Jun 2006
Location:
Posted: 29th Jun 2006 07:37
Thanks for the welcome. Antimatter, thanks for the Intellimatter script, helped a lot to figure out some stuff. :p

Merranvo, I think choosestrafe is supposed to choose a random strafe direction but I couldn't get it to work.
brummel
18
Years of Service
User Offline
Joined: 26th Nov 2005
Location: Sweden
Posted: 29th Jun 2006 18:43
I tested the code and i deleted the lines that had the raycast in them but it did no difference. Seems like they dont work.

Dont forget to visit my website for scripts!
FredP
Retired Moderator
18
Years of Service
User Offline
Joined: 27th Feb 2006
Location: Indiana
Posted: 29th Jun 2006 22:11
Thanks for the script.

David
18
Years of Service
User Offline
Joined: 27th Jun 2006
Location:
Posted: 29th Jun 2006 22:16
It works for me. It's not a huge difference, but if you watch closely enough, you'll notice that the entity will turn around and go a different way when it runs into a wall. Before I put that in I had a lot of problems with the entity trying to chase me through walls instead of using the door. If you really wanna test it just throw an entity into a single room and use a script like

::movefore=8
:raycastback=0 30:pivotrandom=180
:raycastback=0 -30:pivotrandom=180
Les Horribres
19
Years of Service
User Offline
Joined: 20th Nov 2005
Location: My Name is... Merry
Posted: 2nd Jul 2006 21:02
I will have to lookinto the raycast issue (p.s. Bullets are NOT models... they are raycasts)

Your Mod was deleted by the Government.
David
18
Years of Service
User Offline
Joined: 27th Jun 2006
Location:
Posted: 3rd Jul 2006 05:03
What did you mean by bullets are raycasts?
Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 20th Jul 2006 17:49 Edited at: 20th Jul 2006 17:50
he means that there are no bullet models. They just... ugh I cant explain basically IF YOU COULD do slow-motion, there would be no bullet, just a wait for the target to take damage.. But you CANT do slow-motion.

MY FPSC SITE AND FORUMS: www.quantumelectronics.cjb.net - Please register there certain peeps will get MOD.
Wrycu
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location:
Posted: 20th Jul 2006 19:44
Lol. It calculates where it would go, and how long it would take to get there. Then, after the time is up, it subtracts health.

3.0GHz Pentium 4HT, 512MB RAM, NVidia 5200 128MB PCI

<--Wrycu-->
DJ TJJ
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: mobius
Posted: 21st Jul 2006 12:17 Edited at: 21st Jul 2006 12:18
yay time to make a ai tes agian, one room defualt, one room intallmatter 1.2, one room intallmatter 2, and one room this!

edit: allmost forgot the penguin

http://www.freewebs.com/djtjj3/
Wrycu
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location:
Posted: 21st Jul 2006 15:49
Lol. Thats a good idea.

3.0GHz Pentium 4HT, 512MB RAM, NVidia 5200 128MB PCI

<--Wrycu-->
David
18
Years of Service
User Offline
Joined: 27th Jun 2006
Location:
Posted: 23rd Jul 2006 18:58
Oh okay, still doesn't seem like raycast should detect when the entity is shot, but oh well.

That's a great idea, DJ. Lemme know how it turns out.
Phlum
18
Years of Service
User Offline
Joined: 30th Jul 2006
Location:
Posted: 10th Aug 2006 21:35
I'll test this out now!
By the comments it sounds quite amazing.
Saved as script, now working on a team game.
Oh and btw, do they follow u into the next room? That would be useful.

Various Model Pack #1
Buy it now!! Only £3
David
18
Years of Service
User Offline
Joined: 27th Jun 2006
Location:
Posted: 11th Aug 2006 07:58
They usually follow you but sometimes they get stuck near doors. I updated the code a little bit a few nights ago but I can't remember if I fixed that or not. Probably not. I gotta get to bed, but I'll attach the new code just in case there's something I forgot about.

DJ TJJ
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: mobius
Posted: 12th Aug 2006 11:14
i'll test this the moment i get fpsc

http://www.freewebs.com/djtjj3/
Bongo
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location:
Posted: 15th Aug 2006 01:53
This is the best AI I've used so far. No annoying animation glitches. The enemy doesn't walk into walls and it paces around untill it spots you all on it's own and then hunts you. You can use this FPI as main or shoot and it works fine. (just in case you want the enemy walking a waypoint or just standing in place before it spots you.)

I like pie.
David
18
Years of Service
User Offline
Joined: 27th Jun 2006
Location:
Posted: 25th Aug 2006 05:10
Thanks a lot Bongo. Best comment I've ever heard. <3 Actually inspired me to stop procrastinating for a few minutes.

Login to post a reply

Server time is: 2024-11-22 19:21:28
Your offset time is: 2024-11-22 19:21:28