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
;Artificial Intelligence Script
;Header
desc = guard with real brains
;Triggers
:state=0:globalvar=1
:state=0,varequal=1:state=1
:varequal=10:state=4
:shotdamage=5:state=4
:state=1,waypointstate=0:animate=2,waypointstart
:state=1,waypointstate=3:animate=2,waypointnext
:state=1,waypointstate=4:animate=2,waypointrandom
:state=1,waypointstate=5:animate=2,waypointreverse
:state=4:globalvar=1,setvar=10,rotatetoplr,shootplr
;End of Script
type B guard script
;Artificial Intelligence Script
;Header
desc = guard with real brains
;Triggers
:state=0:globalvar=1
:state=0,varequal=1:localvar=1,setvar=0,state=1
:varequal=10:state=4
:shotdamage=5:state=4
:state=1:hudreset,hudx=50,hudy=90,hudimagefine=gamecore/text/sorrysir.png,hudname=warni,hudmake=display,hudunshow=warni
:state=1:hudreset,hudx=50,hudy=90,hudimagefine=gamecore/text/i'llshoot.png,hudname=warnii,hudmake=display,hudunshow=warnii
:state=1,waypointstate=0:animate=2,waypointstart
:state=1,waypointstate=3:animate=2,waypointnext
:state=1,waypointstate=4:animate=2,waypointrandom
:state=1,waypointstate=5:animate=2,waypointreverse
:state=1,plrdistwithin=500,plrdistfurther=100,plrcanbeseen:waypointstop,rotatetoplr,movefore=50,animate=5,localvar=1
:state=1,plrdistwithin=100,localvar=1,varequal=0:rotatetoplr,state=7
:state=1,plrdistwithin=100,localvar=1,varequal=1:rotatetoplr,state=9
:state=1,localvar=1,varequal=2,plrdistwithin=400,plrcanbeseen:state=4
:state=2,plrdistfurther=100:localvar=1,setvar=1,waypointstart,hudunshow=warni,state=5
:state=3,plrdistfurther=100:localvar=1,setvar=2,waypointstart,hudunshow=warnii,state=5
:state=4:globalvar=1,setvar=10,rotatetoplr,shootplr
:state=5:timerstart,state=6
:state=6,timergreater=3000:state=1
:state=7:hudshow=warni,timerstart,state=8
:state=8,timergreater=2000:state=2
:state=9:hudshow=warnii,timerstart,state=10
:state=10,timergreater=2000:state=3
;End of Script
startup triggerzone
;Artificial Intelligence Script
;Header
desc = Plr In Zone change global var#1 to 1
;Triggers
:state=0,plrwithinzone=1:globalvar=1,setvar=1,state=1
;End of script
Restricted area trigger zone
;Artificial Intelligence Script
;Header
desc = Plr In Zone change global var#1 to 10
;Triggers
:state=0,plrwithinzone=1:globalvar=1,setvar=10
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