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 / Make a hitman game. AI is here...

Author
Message
myfrm
17
Years of Service
User Offline
Joined: 12th Jul 2007
Location: India
Posted: 16th Jun 2008 19:48
I am going to make a game. A great fan of hitman games, will try to make the hitman like games. So I wrote some scripts which can make guards behave like the guards in hitman games. There is a problem. I'll tell it later.

Features:

There are two type of guards. Say, type A and type B

type A guards:

Follows waypoints, will not react to the player's movement.
But if the player shoots him or anyone, he shoots the player.
He will also shoot if we are entering a restricted area with/without a disguise(user's choice).

type B guards:

Follows waypoints,if he sees the player, he will give a first warning "This area is restricted." (This is the time for the player to go away from him).
If he sees the player second time, he will give last warning.
Next time he sees, he shoots us.
If the player shoots him or anyone, he shoots the player.
He will also shoot if we are entering a restricted area with/without a disguise(user's choice).


OK. The problem is if we put two or more type B guards, the hud will not stay, it flickers and we cannot read that.
You can try and correct the problem.
Another problem is, if the player has gun and is not holstered, they won't react to that.("Look, he has a gun"."I don't care until he shoots")
They react only if we shoots. Can you correct that also?

Installation:
Change the guards main AI to this script, and shoot Ai to chase10.fpi
Put a trigger zone at the player marker starting position and change its AI to the given one.
Put a trigger zone to the entrance of the restricted area and change its AI to the given one.
(put wherever you want to make that area restricted).


type A guard script



type B guard script




startup triggerzone



Restricted area trigger zone




I didn't made the disguise script. I'll look into it later.Looking into these scripts, you can understand how to implement a disguise. Also you can make a simplified, easily tweakable version of the above code. If done, please post it.
Make an entity that looks like a cloth, and in the pickup script set the global variable to a number.
Check that number with the script using in the trigger zone and in the guard script to change the restriction. So you can script it outside whether the player's cover has blown or not.
Hope you understand. Then make a hitman game,atleast a level...

drakul
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 16th Jun 2008 22:50
Have you tested these at all?


The one and only,


myfrm
17
Years of Service
User Offline
Joined: 12th Jul 2007
Location: India
Posted: 17th Jun 2008 19:46
I have tested it. And found some small errors.
Today I reprogrammed typeA guard and tested it. It is working with no problem.
The version2 codes will upload tomorrow with type A and B guards.
I am not a code writer who thinks "what new code I have to make today".
I make this codes for my own game. So I definitely tests it all the time.
If an error is found anywhere, anytime, I update the scripts to a working condition and I'll post here.


The version2 script comes with atleast three AI scripts for a guard.
Now you can shoot a guard when no one near.

OK;It will be here tomorrow..

drakul
Rampage
16
Years of Service
User Offline
Joined: 4th Feb 2008
Location: New Zealand
Posted: 18th Jun 2008 07:52
Wow...Came out of nowhere! I will test this out and see if it is effective, In the mean time great, great job myfrm!


Visual Game Studio Express Lead Programmer.
myfrm
17
Years of Service
User Offline
Joined: 12th Jul 2007
Location: India
Posted: 18th Jun 2008 19:38 Edited at: 18th Jun 2008 19:40
Installation:


Copy all ai files except into scriptbankuser folder
Copy all png files into languagebankenglishgamecoretext


Character setup:

Main AI:guard_ex_AI_no_prob_v2.fpi OR guard_ex_AI_v2.fpi

Shoot AI:peoplechase10.fpi or any of your shoot scripts. This script will run when the player's cover has blown.

Destroy AI:userfadecorpse.fpi

Triggerzone setup:

Main AI:setglobalto1.fpi OR setglobalto3.fpi

Triggerzone difference:

Triggerzone with this script setglobalto1.fpi will reset our wanted level to low. If we didn't enter this triggerzone, the guards won't shoot or warn, they simply follows the waypoints, until we shoot them or if they see the player is entering a restricted area. Place this triggerzone where you want to make a guarded area.

Triggerzone with this script setglobalto3.fpi will raise our wanted level to high, thus the guards will shoot. Place this triggerzone wherever you want to make a restricted area.

Character AI difference:

Guard with this script guard_ex_AI_no_prob_v2.fpi will follow waypoints.

Guard with this script guard_ex_AI_v2.fpi will follow waypoints, if he see player, he comes and warns twice, then shoots.

Both guards will shoot, if they see the player shooting another guard or himself or any guard shooting the player.

Both guards will shoot, if they see the player is entering a restricted area.

Both guards will not shoot if they didn't see anything.

If the guards are shooting, we run into the setglobalto1.fpi triggerzone, they won't stop shooting, because they know we are the enemy.

They respond to sounds.



Caution:
If you are using the lockpicking feature, then you have to change the globalvar number in pickuplockpicks.fpi and doorlockpick.fpi scripts.


All the above said is working perfectly.
Readme is included.

drakul

Attachments

Login to view attachments
Luke314pi
18
Years of Service
User Offline
Joined: 11th Apr 2006
Location: Minneapolis, MN
Posted: 21st Jun 2008 00:52
Thanks, I can't wait to try this!

Zeldar
16
Years of Service
User Offline
Joined: 16th Mar 2008
Location:
Posted: 21st Jun 2008 06:40 Edited at: 21st Jun 2008 06:40
Can I make it so that if I shoot certain people, the guards will shoot me?

Signed, Zeldar
.....what?
flickenmaste
16
Years of Service
User Offline
Joined: 2nd May 2008
Location:
Posted: 21st Jun 2008 06:51
woah this is cool!

i might try!


[url=http://userbarmaker.com/][img]
myfrm
17
Years of Service
User Offline
Joined: 12th Jul 2007
Location: India
Posted: 21st Jun 2008 19:38
Quote: "Can I make it so that if I shoot certain people, the guards will shoot me?"


add this line to your "certain people's AI"



drakul
Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 21st Jun 2008 20:58
cool man i might use this or i'll just fool around with it thanks anyway

I know not what WWIII will be fought but I do know that WWIV will be fought with sticks and stones-Albert Einstein
i need help
18
Years of Service
User Offline
Joined: 20th Nov 2006
Location:
Posted: 22nd Jun 2008 15:04
is it possible to get it to display your wanted level so you know when you've been detected
myfrm
17
Years of Service
User Offline
Joined: 12th Jul 2007
Location: India
Posted: 22nd Jun 2008 19:55
Quote: "is it possible to get it to display your wanted level so you know when you've been detected"


There are only three wanted levels. 1,2 and 3.
When the wanted level is 3, the guards will shoot when they see you.

Make a trigger zone or any entity and script like this.

If globalvar=1 & defined key is pressed then display wantedlevel1 hud.
If globalvar=2 & defined key is pressed then display wantedlevel2 hud.
If globalvar=3 & defined key is pressed then display wantedlevel3 hud.

I will look to script this(give me a day or two). And it is 100% possible.

drakul
i need help
18
Years of Service
User Offline
Joined: 20th Nov 2006
Location:
Posted: 22nd Jun 2008 20:42
thanks
Finnish gamer
16
Years of Service
User Offline
Joined: 17th Dec 2007
Location: behind you !
Posted: 4th Aug 2008 16:14
This didnt work for me. I put all the filest o corret folders., changed the nemies main AI an when i go to the "restricted are" triggger zone the guard starts shaking the other guards (Guard A) just runs on its postion and doesnt shoot me if i shoot him. Any ideas whats wrong?

srry a'bout my bad english

Login to post a reply

Server time is: 2024-11-24 09:28:59
Your offset time is: 2024-11-24 09:28:59