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 first ever script! :D

Author
Message
Zdrok
17
Years of Service
User Offline
Joined: 19th Dec 2006
Location: Pittsburgh
Posted: 8th Apr 2007 18:22
;Artificial Intelegence Script

;Header

desc = Tactical Script

;Triggers

:ifweapon=0:reloadweapon,state=1,animate=31,sound=audiobank\guns\reload.wav
:plrcanbeseen:settarget,rotatetotarget,resethead
:plrdistwithin=155:rotatetoplr,resethead

:state=0,random=50:rotateheadrandom=71
:state=0,shotdamage=5:state=6
:state=0,ifweapon=1,plrcanbeseen:state=3

:state=1,random=45:rotateheadrandom=75
:state=1,random=100:state=0,animate=31
:state=1,plrcanbeseen:state=0,animate=1


:state=5:useweapon,rundecal=6,state=0
:state=4:state=5
:state=3:state=4
:state=2:state=3

:state=7,random=1:state=8
:state=7,random=1:state=10
:state=7:settarget,rotatetotarget,state=1,animate=31

:state=8:state=9,setframe=3
:state=9:incframe=3,strafe=-90,rotatetoplr
:state=9,frameatend=3:state=1,animate=1
:state=10:state=11,setframe=3
:state=11:incframe=3,strafe=90,rotatetoplr
:state=11,frameatend=3:state=1,animate=1

;End of Script

There's my first script. The enemy pops up to shoot, then crouces down. But, I've got a problem: The enemy still fires behind cover, and can fire through it. I want the enemy to stop firing when he crouches.

Just copy the script into NotePad, then save is as tactics.fpi, in the scriptbank/people folder. Please comment, and help me on my problem stated above.

Zdrok
17
Years of Service
User Offline
Joined: 19th Dec 2006
Location: Pittsburgh
Posted: 9th Apr 2007 16:47
C'mon, 44 views and no replies?! I wanna know what you think, and if you can help me with my problem!

xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 9th Apr 2007 17:30
Well, your script is all over the place and very hard to follow.

Quote: "
:state=0,shotdamage=5:state=6"

There is no state 6

Quote: "
:state=5:useweapon,rundecal=6,state=0
:state=4:state=5
:state=3:state=4
:state=2:state=3
"

What's up with that?

Quote: "
:plrcanbeseen:settarget,rotatetotarget,resethead
"


Yes, the enemy doesn't recognize cover, unless it's a segment and even then not always. You will need to separate the crouch animation portion from the settarget portion...

Quote: "
:plrcanbeseen:settarget,rotatetotarget,resethead"


Since the player can always be seen even through cover, he always has a target.

Quote: "
:state=5:useweapon,rundecal=6,state=0"


Best.

I'm sorry, my answers are limited. You must ask the right question.

Zdrok
17
Years of Service
User Offline
Joined: 19th Dec 2006
Location: Pittsburgh
Posted: 9th Apr 2007 17:42
Well, I copied/pasted some pieces of the snipe.fpi, and I used the snipe.fpi for reassurance.

Remember, I'm fairly new to scripting, so I'm not familiar with states and all that crap. Time to read some stickies.

Slayer Simon
18
Years of Service
User Offline
Joined: 11th Oct 2006
Location:
Posted: 11th Apr 2007 00:35
Congadualations AI, I'm glad you finally started scripting.

It's alot more complex then my first script.

As a general guideline you should try to keep large scripts as organized as possible.
Slayer222
17
Years of Service
User Offline
Joined: 19th Mar 2007
Location: Wherever I feel like
Posted: 11th Apr 2007 07:47
Well, well, well looks like you have attempted (quite successfully it seems too) to make a tactical script guess that's why you didn't need my help after all hey
Slayer_2
Zdrok
17
Years of Service
User Offline
Joined: 19th Dec 2006
Location: Pittsburgh
Posted: 11th Apr 2007 22:51
LOL, Slayer222.

But the enemy fires through a table or whatever his cover is!

But, it's a good first attempt, right? RIGHT? RIIIIIIIGHT!?


Slayer222
17
Years of Service
User Offline
Joined: 19th Mar 2007
Location: Wherever I feel like
Posted: 12th Apr 2007 05:57
Ha ha well unfortunately the only cover that actually works is segments enemies can shoot through ANY entityts
Slayer_2
foxking
18
Years of Service
User Offline
Joined: 10th Dec 2005
Location:
Posted: 16th Apr 2007 18:01
unless you place special invisible entities that enimies recognise?

The More You Study The More You Know, The More You know The More You Forget, The More You Forget The Less You Know,
So Why Study?
Slayer222
17
Years of Service
User Offline
Joined: 19th Mar 2007
Location: Wherever I feel like
Posted: 16th Apr 2007 18:29
I don't think that would work...

EOT
[img][/img]
Check it out here: http://eliteops.piczo.com/?cr=6&rfm=y
Zdrok
17
Years of Service
User Offline
Joined: 19th Dec 2006
Location: Pittsburgh
Posted: 16th Apr 2007 23:07
Isn't there a way to make a script that makes the enemy lean around the wall's corner?


Slayer222
17
Years of Service
User Offline
Joined: 19th Mar 2007
Location: Wherever I feel like
Posted: 17th Apr 2007 23:41
leaning just looks like sliding...

EOT
[img][/img]
Check it out here: http://eliteops.piczo.com/?cr=6&rfm=y
Nomad Soul
Moderator
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location: United Kingdom
Posted: 18th Apr 2007 03:07
AI

Quote: "But, it's a good first attempt, right? RIGHT? RIIIIIIIGHT!?"


The main thing is that your having a go and providing you take the communities advice on board, this should help give you ideas to refine your script and produce something of a high quality.

People are using your script and giving you some positive feedback which is an achievement in itself so yes this is a good first attempt.

Regarding your point about enemies shooting through cover and crates etc, butter fingers has a thread where he created some cover as segments rather than entities and this prevented the enemy fire through cover issue. Here is the link, which also contains a video demonstration so you can see it in action.

http://forum.thegamecreators.com/?m=forum_view&t=82913&b=24

Keep up the good work

Login to post a reply

Server time is: 2024-11-23 14:49:29
Your offset time is: 2024-11-23 14:49:29