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 / My AI script

Author
Message
SWokt0r
15
Years of Service
User Offline
Joined: 19th Jul 2009
Location: At the end of the rainbow...
Posted: 14th Aug 2009 20:03
Hey all

I don't expect you guys to understand why I'd want to script my own AI, but please just bear with me.

Heres the first piec of code: the main script



Don't worry about the desc= and the header, I've just omitted them. Heres the shoot script:



Now heres a list of probs I'm having .

1. The character I use the shoot script on does not deal damage to the player.
2. The character is always in a crouching position with the gun pointing down.
3. The character does not strafe randomly and advances everytime the player touches it instead of advancing and backing away respectively.

I have tried variations of the above script and none of them worked. I have written a main and shoot script before that worked but can't remember what I did .

Rest assured that I am working tirelessly to bring you an advanced AI script that is compatible with FPSC without using MODS. In future the AI will include an animation for aligning the gun with the player vertically as well as AI that randomly strolls around.

Any help would be greatly appreciated .

Angola - The game
Coming soon
zeza
16
Years of Service
User Offline
Joined: 27th Jun 2008
Location:
Posted: 14th Aug 2009 20:30
First:
:state=1:plrcanbeseen:settarget
there are three colons in this line,try this
:state=1,plrcanbeseen:settarget
Second:
try using animate=5 for moving and animate=6 for reloading
Third:
choosestrafe only chooses the direction, it needs to be followed by strafe for the character to move

I'm not sure what you mean by
Quote: "advances everytime the player touches it instead of advancing and backing away respectively"

Do you want the enemy to charge the player?
SWokt0r
15
Years of Service
User Offline
Joined: 19th Jul 2009
Location: At the end of the rainbow...
Posted: 14th Aug 2009 21:33 Edited at: 14th Aug 2009 21:33
Thanks for the help and responding so fast.

1. I fixed the 3 colon problem thanks. I've also downloaded FPI Editpad so that I can prevent such syntax errors.

2. Thats worked so far but the character is still crouched apon spawning and until the player is seen and targeted. Also, The character will run on the spot for a short while after moving and then stop.

3. Ooooh, right . Sorry.

It seems the 3 colon correction has fixed the damage problem.

What I meant when I said
Quote: "advances everytime the player touches it instead of advancing and backing away respectively"
was that the character does not back away when the player comes within 100 units (or 1 segment) of the character, rather, it moves forward. The part where the character moves forward to catch up with the player works.

Thank you for the help.

Angola - The game
Coming soon
Bugsy
16
Years of Service
User Offline
Joined: 24th Nov 2008
Location: another place in time
Posted: 15th Aug 2009 01:22
ok, as for damage dealing,

1: make the shooting on a different state, and the reloading on a different state

under the shooting, on the same state, do something like this

:state=2,random=1:plraddhealth=-20
:state=2,random=2:plraddhealth=-25
:state=2,random=2:plraddhealth=-15

that (if on the same state as the shooting) will make the enemy hit.
SWokt0r
15
Years of Service
User Offline
Joined: 19th Jul 2009
Location: At the end of the rainbow...
Posted: 15th Aug 2009 10:37
Here's a general update on the scripts:





The damage prob was already fixed as stated in my second post, but thanks for the tip on different state orders.

Is it normal for entities not to be able to climb stairs? Mine doesn't.

Thank you all.

Angola - The game
Coming soon

Login to post a reply

Server time is: 2024-11-25 05:24:17
Your offset time is: 2024-11-25 05:24:17