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 / AI Script Problem...

Author
Message
Slayer1918z
14
Years of Service
User Offline
Joined: 18th Jun 2010
Location:
Posted: 1st Jul 2010 19:18 Edited at: 2nd Jul 2010 00:33
Well, I've been working on a script to make AI better and for some reason it no longer works. The AI is supposed to shoot you, strafe, follow you, and all that stuff but instead the AI just stands there even when I am in plain sight or shooting him but the AI does still rotate my direction. I'm not sure why so if anyone can help then thanks. Here is the script...

<EDIT>
My First Problem is solved but I have encountered I new one, for some reason the AI doesn't attack me unless I shoot at him. Any help with this one? It is still the same script just without the plralive=1 line. He is supposed to attack if the player is within a distance of 200, if the player can be seen, and if a noise of 400 is heard, not just when shot.

ctm
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 1st Jul 2010 20:30
Quote: ":plralive=1:state=0,animate=1"


As long as the plr is alive the state gets reset to zero.

Maybe it's working better this way:

:plralive=1,state=0:animate=1

or this way:

:state=0:animate=1

Don't know what "plralive=1" is good for...should'nt matter what the npc theoretically does when the plr already sees the game menu again

If it's meant as a script reset after the plr has died you could write it this way:

:plralive=0:state=0
:state=0:animate=1
...

The question is: is such a script reset necessary at all, when the script is attached as main script?
(i have no experience with AI scripts)
Slayer1918z
14
Years of Service
User Offline
Joined: 18th Jun 2010
Location:
Posted: 1st Jul 2010 21:06
I took out that line completely and now it works again, now I just need to improve it, thanks for the help!

And if anyone has any suggestions how to make the AI any better or what else the AI should do in the script just let me know, I want to make this the best that I can.
ctm
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 3rd Jul 2010 15:55 Edited at: 3rd Jul 2010 16:43
Editing the first post was'nt a good idea...i only saw it accidentally

By testing your script i found out, that the script got stuck in a loop caused by the losetarget=X condition.

If you dont have a settarget action in your script losetarget=X will stay true forever and ever.

I do strongly recommend a update to FPSC v.1.16 (if you have'nt made it yet) to be able to use the rawtext.

Without the rawtext i wouldnt have found the endless loop.

You can use it like that:
(changed additionally the position of some lines in state=1)



Attachments

Login to view attachments
ctm
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 3rd Jul 2010 15:57 Edited at: 3rd Jul 2010 16:00
ouch..double posting

now...at least some space for a penguin:
Slayer1918z
14
Years of Service
User Offline
Joined: 18th Jun 2010
Location:
Posted: 3rd Jul 2010 16:11
Thanks, problems are solved and I am now adding to the script
Slayer1918z
14
Years of Service
User Offline
Joined: 18th Jun 2010
Location:
Posted: 3rd Jul 2010 23:49
ok well i've added on to my script and ran into the same problem again, here is the script

Login to post a reply

Server time is: 2024-11-24 21:22:42
Your offset time is: 2024-11-24 21:22:42