I have some codes. I am using this in my game. There is a feature in my game that is there is no weapon or fighting or dying.....You will know why after reading this all...OK
1. A civilian follows waypoint to the very end and stops. If he sees player, he comes to the player and says "Go go restricted area..." or something like that.
Then he follows the waypoints...
;Artificial Intelligence Script
;Header
desc = Follow Waypoints and If plr can be seen talk to plr and walk
;Triggers
:state=0::state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\waitergogo.tga,hudname=talk1,hudhide=1,hudmake=display,state=10
:state=10,waypointstate=0:animate=2,waypointstart
:state=10,waypointstate=3:animate=2,waypointnext
:state=10,waypointstate=4:animate=2,waypointrandom
:waypointstate=5:waypointstop
:state=10,plrcanbeseen:waypointstop,state=1
:state=10,nearactivatable=0:settarget,activatetarget=2,waypointstop,timerstart,state=15
:state=15,timergreater=1000:waypointnext,state=10
:state=1,plrdistfurther=101:followplr=1,animate=5
:state=1,plrdistwithin=100:animate=1,timerstart,hudshow=talk1,state=2
:state=2,plrdistfurther=101:animate=5
:state=2,timergreater=5000:animate=5,waypointstart,hudfadeout=talk1,state=10
;End of Script
2. A guard follows waypoint to the very end and stops. If he sees player, he comes to the player and says "You have been caught" or something like that.
Then the game is over...
;Artificial Intelligence Script
;Header
desc = Follow Waypoints and If plr can be seen talk to plr and gameover
;Triggers
:state=0:state=0
:state=0,waypointstate=0:animate=2,waypointstart
:state=0,waypointstate=3:animate=2,waypointnext
:state=0,waypointstate=4:animate=2,waypointrandom
:waypointstate=5:waypointstop
:state=0,plrcanbeseen:waypointstop,state=1
:state=1,plrdistfurther=101:rotatetoplr,movefore=10000000,animate=5
:state=1,plrcannotbeseen:waypointstart,state=0
:state=1,plrdistwithin=100:animate=1,timerstart,state=2
:state=2:freeze
:state=2,timergreater=5000:newgame
;End of Script
3. A door that can be opened and then closed. Then we cannot open.Use- If a guard enters a room, we can lock the room from outside, then he never comes out. how's that?
;Artificial Intelligence Script
;Header
desc =The door can be opened and closed(locked)
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\doorlocked.tga,hudname=doorlocked,hudhide=1,hudmake=display,state=10
:state=10,plrdistwithin=60,scancodekeypressed=33:activate=2
:state=10,activated=2:state=1,setframe=0,sound=$0
:state=1:incframe=0
:state=1,frameatend=0:state=2,coloff
:state=2,plrdistwithin=60,scancodekeypressed=33:activate=0
:state=2,activated=0:state=3,sound=$1,colon
:state=3:decframe=0
:state=3,frameatstart=0:state=20,setframe=0,suspend
:state=20:hudshow=doorlocked,hudfadeout=doorlocked
;End of Script
I know these are low ranked scripts, but I just started scripting in detail today...
If someone wants take these and change to your convenience
and last...
4 Disguise....
instructions....
Make an entity pickup and script that pickup to like this
;Artificial Intelligence Script
;Header
desc = change clothes and check health for disguise
;Triggers
:state=0,plrdistwithin=100,plrusingaction=1:state=1,plraddhealth=1,plrsound=audiobank\items\healthup.wav,destroy
:state=1,plrusingaction=0:state=0
;End of Script
This script adds one point health to player
Set player health to 100 default
Then put a hurtzone to hurt at one point at the same position of player.Thus when the game loads, the players health will be 99/100.
Then script this to a character....
;Artificial Intelligence Script
;Header
desc = Follow Waypoints and If plr can be seen talk to plr and gameover
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\guard.tga,hudname=guard,hudhide=1,hudmake=display,state=10
:state=10,waypointstate=0:animate=2,waypointstart
:state=10,waypointstate=3:animate=2,waypointnext
:state=10,waypointstate=4:animate=2,waypointrandom
:waypointstate=5:waypointstop
:state=10,plrcanbeseen,plrhealthless=100:waypointstop,state=1
:state=10,nearactivatable=0:settarget,activatetarget=2,waypointstop,timerstart,state=15
:state=15,timergreater=1000:waypointnext,state=10
:state=1,plrdistfurther=101:rotatetoplr,movefore=10000000,animate=5
:state=1,plrcannotbeseen:waypointstart,state=10
:state=1,plrdistwithin=100:hudshow=guard,animate=1,timerstart,state=2
:state=2:freeze
:state=2,timergreater=3000:hudfadeout=guard,newgame
;End of Script
Test the game
The character will not respond at you if you pickedup the cloth, else he talks and game over. I think you got the idea and answer to why I made hurtless game?
Thank you...
drakul