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 / Waypoint Scripting Problem

Author
Message
Blahguy
14
Years of Service
User Offline
Joined: 12th Dec 2010
Location: The Void
Posted: 13th Dec 2010 04:09
Hey I am having a problem with my waypoints and shooting scripts. What I want to happen is that an NPC walks back and forth on a simple waypoint (like a guard on patrol), and if he sees the player, react and shoot. I can do this, but what I want to happen is that if he sees me, starts shooting, and I run away, he should go back into the waypoint and continue walking back and forth. I almsot got it to work I think, because when he cant see me he looks the other way, like he's trying to move, but he doesn't. Then when he can see me, he starts shooting at me again. Attached is the .fpi file I used for the character's shooting property. Hopefully I can get the character's Main script here too.

Attachments

Login to view attachments
TZap
19
Years of Service
User Offline
Joined: 29th Aug 2005
Location:
Posted: 13th Dec 2010 12:04 Edited at: 13th Dec 2010 12:08
This might help. I wanted a character to follow a waypoint. Fine the script with fpsc will do this. Then when player is seen, shoot close. Fine there is a script to do this.

What I then wanted was if the player moved more than 200 units away AND could not be seen, the character would follow the nearest way point.

See attached. Add paceTzap.fpi as the main script and shootcloseTzap.fpi as your shoot script. You will need a "taunt" sound in the pace script if you want the character to shout out when it sees the player (remove the code if you don't want this).

It adds a lot of "randomness" to your game play.

Attachments

Login to view attachments
Blahguy
14
Years of Service
User Offline
Joined: 12th Dec 2010
Location: The Void
Posted: 13th Dec 2010 16:24
Thanks a bunch, It works perfectly! Just one quick question, If i get rid of the 200 units away condition, will it still work? So then the only condition that would let the character move back is if he cant see the player. So like if I close a door, then he cant see me, he should move back.
TZap
19
Years of Service
User Offline
Joined: 29th Aug 2005
Location:
Posted: 13th Dec 2010 17:38 Edited at: 14th Dec 2010 09:47
Yes it will work but adding the 200 units condition ensures the character is still 'alerted' to the players location. If the 200 units code was not there, you could get the situation occurring where ducking out of sight and reappearing makes it too easy to shoot the character. The character might have turned away to follow a waypoint.
Blahguy
14
Years of Service
User Offline
Joined: 12th Dec 2010
Location: The Void
Posted: 13th Dec 2010 21:10
Thanks for all of your help, it is very appreciated!

Login to post a reply

Server time is: 2025-06-04 21:11:33
Your offset time is: 2025-06-04 21:11:33