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 / Simple Follow and Shoot script

Author
Message
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 19th Nov 2007 23:22
Someone was asking in another thread about getting a character to follow you around and possibly simulate an ally. This is as close as I could get. The animations seem to work when they want to.

This is a simple "follow the player script" with the appearance of allies thrown in. When you get within range of the character (200 by default) he will take a defensive stance and face you. Now where ever you go, he will follow you (within the confines of the program).



If you only want the character to follow you, comment out the last :state=1 line and adjust the distances with the plrdistwithin conditions.

When you encounter enemies and need help (remember that these allies cannot really help you or hurt you, they are just firing blindly with no assigned target) press Z. The character will come forward and return fire with you. If you move away from the battle, the character will stop firing and follow you again.

NOTES:
1. I don't know of any way to make the character do this automatically (without you pressing a key).
2. The first time you bring the character into battle, his run animation does not work properly. After the first time, it does. Could be my system.
3. This was tested with SciFi characters in V1.07.

Best.

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

Fruitless CRUNK
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: DRINKING MY HOT COFFEE =:-)
Posted: 19th Nov 2007 23:29
Nice script, I'm a bet if a noob to AI scripts. It looks like you've done a good job.

If you can't win, cheat. If you can't cheat, quite.
Nomad Soul
Moderator
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location: United Kingdom
Posted: 20th Nov 2007 17:40
Nice work xplosys

I tried a quick search on this but couldn't see or recall it being asked before.

Do you know if it's possible to have an npc character use a non aggressive ai script e.g. passive but make it so they start attacking the player if he attacks them first?

I'd like to make my npc's a little more believable by having them attack the player in certain situations e.g. players attacks passive npc or npc talk scripts which result in npc attacking if player asks 1 too many questions.

Any help on this appreciated

Nomad
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 20th Nov 2007 19:01
Nomad Soul,

This is the post that was asking about a follow/ally script.

Yes, what you seek is possible using the shotdamage= condition. Set it to 1 and when the character is shot, the condition will be true.

For example, :state=10,shotdamage=1:shootplr

As for the "too many questions" just continue to progress the state after each question/response so that when it reaches the desired level, the shootplr command will call up the characters shoot script.

Best.

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

Nomad Soul
Moderator
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location: United Kingdom
Posted: 20th Nov 2007 21:18
Thanks xplosys

Your like one of the most prolific scripters on the forums so thanks for imparting some of your knowledge here, this is really going to come in handy.

I'll let you get back to whatever complex a.i algorithm your currently working on.

Nomad
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 20th Nov 2007 21:32
Quote: "I'll let you get back to whatever complex a.i algorithm your currently working on."


Small fist full of spaghetti noodles (aprox. 1/2lb)
Boil until tender.
Brown 1lb. lean ground chuck, add onions and bell peppers to taste.
Mix 8oz. tomato paste, 12oz. tomato sauce, 16oz. chopped skinned tomatoes, ground chuck, bay leaf, garlick and oregano in sause pan.
Simmer for 2 hours.
Drain noodes and cover in sauce.


After this I might work on some game stuff.

Best.

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

Login to post a reply

Server time is: 2024-11-24 01:50:00
Your offset time is: 2024-11-24 01:50:00