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 / Requiring Assistance with AI Script

Author
Message
FLAME123
15
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Scotland
Posted: 21st Mar 2013 21:17
So I have just started to learn scripting and I probably should've gone with something a tad bit easier but I wanted something to be proud of. With this script I was aiming to get a TF341 character to:

1. Sit down (animation)
2. Remain seated until a sound is heard.
3. Get up (animation)
4. Head towards the direction of the sound.
5. If they see the player they will engage and pursue them.

The script I came up with (bear in mind it is my first script):


Unfortunately it is not fully operational. The character does animate when sitting down and remains seated, however they don't do much else apart from die when their health gets below 1. They don't react to any sound produced, nor can they see the player.

Any help is appreciated.

(I'm running stock fpsc V120 beta 15)
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 22nd Mar 2013 09:20 Edited at: 22nd Mar 2013 09:21
sry, but I have not much experience with ai, but I also know that the aisound...= not work very good. Also the aimoveto.. work not.
I said that before in the 1.2 beta thread, but nobody hear me

But to your problem:


It is not much, but perhaps...


rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 22nd Mar 2013 14:44 Edited at: 22nd Mar 2013 15:15
At state=0 you set an etimer for 1210 this is 1.21 seconds if the condition is that the animation ends before going to another animation then state=2, then you don't need the timer. Animation being 25frames per second I suspect the timer is unnecessary.
You also have an etimer start at state=2 which does nothing.

healthless=1 wont work likely as by the time the engine catches it from the script then destroy has already been committed automatically.
Think of it this way, if character has 5 health left and gets shot by weapon taking -10 then the destroy script is triggered before this condition you have in aimain can be met.


Also check the characters view cone width to ensure he sees the player, if its 0 then he wont see anything and the condition can never be met.

I don't trip over...I do random gravity checks.

Login to post a reply

Server time is: 2024-11-23 16:50:41
Your offset time is: 2024-11-23 16:50:41