I will publish some more complex scripts I 've been working on lately in a multi-media format, so there won't be a new pack soon.
That’s why I decided to post the short ones in a seperate thread and update it regularly. Once the scripts will get too many, I'll revise them according to feedback and put them in a small pack again.
Please use this thread for feedback and questions regarding the
posted scripts only. If you have a script that needs to be looked at, please start a seperate thread - after all we have lots of able scripters around (and I am keeping an eye on the script board all the time anyway
)
All scripts use stock sounds only. If you customise the text, please bear in mind that these punctuation marks can not be used: comma, colon, semi-colon, equal sign, slash.
UPDATE 20/08/2012
4 new scripts, mainly for producing random sounds
Ceiling item playing wooden “step” sounds.
;Artificial Intelligence Script: ScaryCeilingWood
by TheStoryteller01 2012
;Header
desc=
This script only works with FPSC 1.18 or higher.
Made for ceiling items on a wooden ceiling to play randomized wooden “step” sounds
that give the impression of something moving in a room above.
This script triggers when the player is in a range between 1 and 4 segments away and stops if the
player comes within one segment near. The sound consists of a row of 1-3 “steps” after which the script
resets and can be triggered again after 1 minute.
The script should be put on a ceiling entity (like a lamp or decal) and it should be obvious that there is
another room above the one the player is in.
;Triggers
:state=0:state=1
:state=1,plrdistwithin=400,plrdistfurther=100:etimerstart,state=5
:state=5,random=5:state=11
:state=5,random=5:state=12
:state=5,random=5:state=13
:state=5,random=5:state=14
:state=5,random=5:state=15
:state=11,etimergreater=100:state=19
:state=12,etimergreater=2000:state=19
:state=13,etimergreater=500:state=19
:state=14,etimergreater=1500:state=19
:state=15,etimergreater=1000:state=19
:state=19:etimerstart,state=20
:state=20,random=5:state=25
:state=20,random=5:plrsound=audiobank\materials\16oldwoodA1.wav,state=25
:state=20,random=5:plrsound=audiobank\materials\16oldwoodA2.wav,state=25
:state=20,random=5:plrsound=audiobank\materials\16oldwoodA3.wav,state=25
:state=20,random=5:plrsound=audiobank\materials\16oldwoodA4.wav,state=25
:state=25,random=5:state=31
:state=25,random=5:state=32
:state=25,random=5:state=33
:state=25,random=5:state=34
:state=25,random=5:state=35
:state=31,etimergreater=450:state=39
:state=32,etimergreater=650:state=39
:state=33,etimergreater=500:state=39
:state=34,etimergreater=600:state=39
:state=35,etimergreater=550:state=39
:state=39:etimerstart,state=40
:state=40,random=5:state=45
:state=40,random=5:plrsound=audiobank\materials\16oldwoodA2.wav,state=45
:state=40,random=5:plrsound=audiobank\materials\16oldwoodA3.wav,state=45
:state=40,random=5:plrsound=audiobank\materials\16oldwoodA4.wav,state=45
:state=40,random=5:plrsound=audiobank\materials\16oldwoodA1.wav,state=45
:state=45:etimergreater=500,state=50
:state=50,random=5:state=90
:state=50,random=5:plrsound=audiobank\materials\16oldwoodA3.wav,state=90
:state=50,random=5:plrsound=audiobank\materials\16oldwoodA4.wav,state=90
:state=50,random=5:plrsound=audiobank\materials\16oldwoodA1.wav,state=90
:state=50,random=5:plrsound=audiobank\materials\16oldwoodA2.wav,state=90
:state=90:etimerstart,state=95
:state=95,etimergreater=60000:state=1
;End of Script
How it works:
Made for ceiling items on a wooden ceiling to play randomized wooden “step” sounds that give the impression of something moving in a room above.
This script triggers when the player is in a range between 1 and 4 segments away and stops if the player comes within one segment near.
The sound consists of a row of 1-3 “steps” after which the script resets and can be triggered again after 1 minute. The script should be put on a ceiling entity (like a lamp or decal) and it should be obvious that there is another room above the one the player is in.
Examples where to use:
In exploration maps where the player has a high chance to cross the room several times to distract and/or alert the player.
Issues:
It should be impossible for the player to actually enter the room where the step sounds are supposedly coming from. There should be only one such script in each level.
Vent playing random metallic “step” sounds
;Artificial Intelligence Script: ScaryVentMetal
by TheStoryteller01 2012
;Header
desc=
This script only works with FPSC 1.18 or higher.
Made for metal vents and tubes (which the player can NOT enter) to play randomized metallic sounds
that give the impression of something moving inside after the player came closer than 2 segments.
The sounds start randomized (0.1-1.5 secs) and will be triggered continuously until the player is further
away than 2 segments OR a random line with a ~20% probability resets the script to be started again
in 60 seconds so it can then again be triggered by the player.
;Triggers
:state=0:state=1
:state=1,plrdistwithin=200:etimerstart,state=5
:state=5,random=5:state=11
:state=5,random=5:state=12
:state=5,random=5:state=13
:state=5,random=5:state=14
:state=5,random=5:state=15
:state=11,etimergreater=100:state=19
:state=12,etimergreater=2000:state=19
:state=13,etimergreater=500:state=19
:state=14,etimergreater=1500:state=19
:state=15,etimergreater=1000:state=19
:state=19,plrdistfurther=200:state=50
:state=19:etimerstart,state=20
:state=20,random=4:plrsound=audiobank\materials\2metalA1.wav,state=25
:state=20,random=4:plrsound=audiobank\materials\2metalA2.wav,state=25
:state=20,random=4:plrsound=audiobank\materials\2metalA3.wav,state=25
:state=20,random=4:plrsound=audiobank\materials\2metalA4.wav,state=25
:state=25,random=5:state=31
:state=25,random=5:state=32
:state=25,random=5:state=33
:state=25,random=5:state=34
:state=25,random=5:state=35
:state=31,etimergreater=700:state=39
:state=32,etimergreater=600:state=39
:state=33,etimergreater=750:state=39
:state=34,etimergreater=550:state=39
:state=35,etimergreater=600:state=39
:state=39,plrdistfurther=200:state=50
:state=39:etimerstart,state=40
:state=40,random=4:plrsound=audiobank\materials\2metalA2.wav,state=45
:state=40,random=4:plrsound=audiobank\materials\2metalA3.wav,state=45
:state=40,random=4:plrsound=audiobank\materials\2metalA4.wav,state=45
:state=40,random=4:plrsound=audiobank\materials\2metalA1.wav,state=45
:state=45:etimergreater=500,state=50
:state=50,random=4:plrsound=audiobank\materials\2metalA3.wav,state=90
:state=50,random=4:plrsound=audiobank\materials\2metalA4.wav,state=90
:state=50,random=4:plrsound=audiobank\materials\2metalA1.wav,state=90
:state=50,random=4:plrsound=audiobank\materials\2metalA2.wav,state=90
:state=90:etimerstart,state=95
:state=95,random=5:state=100
:state=95,random=5:state=101
:state=95,random=5:state=102
:state=95,random=5:state=103
:state=95,random=5:state=104
:state=100,etimergreater=700:state=5
:state=101,etimergreater=600:state=5
:state=102,etimergreater=450:state=5
:state=103,etimergreater=750:state=5
:state=104,etimergreater=60000:state=1
;End of Script
How it works:
Made for metal vents and tubes (which the player can NOT enter) to play randomized metallic sounds that give the impression of something moving inside after the player came closer than 2 segments.
The sounds start randomized (0.1-1.5 secs) and will be triggered continously until the player is away more than 2 segments OR a random line with a ~20% probability resets the script to be started again in 60 seconds so it can then again be triggered by the player.
Examples where to use:
In exploration maps where the player has a high chance to pass by the vent several times to distract and/or alert the player. If there is another vent which the player CAN enter, he will be quite alert while inside.
Issues:
There should be only one such vent/tube in each level unless its very large and the vents are placed far away from each other.
Door playing random metallic banging sounds
;Artificial Intelligence Script:ScaryDoorMetal
by TheStoryteller01 2012
;Header
desc=
This script only works with FPSC 1.18 or higher.
Made for metal doors to play random metallic banging sounds when the player comes closer than 2 segments.
Randomized are the start of the sounds (0.1-2.0 secs), the number of sounds (0-3) and the time in between
the sounds(0.1-0.3 secs). After 2 minutes the script resets and will be again triggered by the player.
;Triggers
:state=0:state=1
:state=1,plrdistwithin=200:etimerstart,state=5
:state=5,random=5:state=11
:state=5,random=5:state=12
:state=5,random=5:state=13
:state=5,random=5:state=14
:state=5,random=5:state=15
:state=11,etimergreater=100:state=19
:state=12,etimergreater=2000:state=19
:state=13,etimergreater=500:state=19
:state=14,etimergreater=1500:state=19
:state=15,etimergreater=1000:state=19
:state=19:etimerstart,state=20
:state=20,random=5:state=25
:state=20,random=5:plrsound=audiobank\materials\2metalI.wav,state=25
:state=20,random=5:plrsound=audiobank\materials\7drumA1.wav,state=25
:state=20,random=5:plrsound=audiobank\materials\7drumI.wav,state=25
:state=20,random=5:plrsound=audiobank\materials\7drumA3.wav,state=25
:state=25,random=5:state=31
:state=25,random=5:state=32
:state=25,random=5:state=33
:state=25,random=5:state=34
:state=25,random=5:state=35
:state=31,etimergreater=100:state=39
:state=32,etimergreater=300:state=39
:state=33,etimergreater=150:state=39
:state=34,etimergreater=250:state=39
:state=35,etimergreater=200:state=39
:state=39:etimerstart,state=40
:state=40,random=5:state=45
:state=40,random=5:plrsound=audiobank\materials\2metalI.wav,state=45
:state=40,random=5:plrsound=audiobank\materials\7drumA1.wav,state=45
:state=40,random=5:plrsound=audiobank\materials\7drumI.wav,state=45
:state=40,random=5:plrsound=audiobank\materials\7drumA3.wav,state=45
:state=45:etimergreater=150,state=50
:state=50,random=5:state=90
:state=50,random=5:plrsound=audiobank\materials\2metalI.wav,state=90
:state=50,random=5:plrsound=audiobank\materials\7drumA1.wav,state=90
:state=50,random=5:plrsound=audiobank\materials\7drumI.wav,state=90
:state=50,random=5:plrsound=audiobank\materials\7drumA3.wav,state=90
:state=90:etimerstart,state=95
:state=95,etimergreater=120000:state=1
;End of Script
How it works:
Made for metal doors to play random metallic banging sounds when the player comes closer than 2 segments. Randomized are the start of the sounds (0.1-2.0 secs), the number of sounds (0-3) and the time in between
the sounds(0.1-0.3 secs). After 2 minutes the script resets and will be again triggered by the player.
Examples where to use:
In exploration maps where the player has a high chance to pass by this door several times to distract or even scare the player. It should be placed in rooms or corridors at least 2 segments wide.
Issues:
There should be only one of these doors in a whole level unless the level is very large and the doors are far apart from each other. The stock sounds used for this script are far from perfect for the job. You might find better.
Banging door which gets eventually destroyed by an enemy behind it
;Artificial Intelligence Script: EnemyDestroyedDoor
by TheStoryteller01 2012
;Header
desc=
This script only works with FPSC 1.18 or higher.
Made for metal doors to play random metallic banging sounds when the player comes closer than 2 segments and to have a high chance to be destroyed.
The door triggers randomly (0.1-2.0 secs) and plays random banging sounds (0-3) before it has a chance to be destroyed (~40%). If the door is not
destroyed, the script resets randomly (3-5 secs) after which it can again be triggered by the player.
To make the door not just disappear upon destruction, a second door has to be put in front of this door
and its name has to be put into the "if used" box of this one. The second door has to be slightly angled to the direction it should fall, "spawn at start"
has to be put to "NO" and "is immobile" has to be put to "NO" as well. Behind this door an enemy should be placed (the reason for the banging at the
door and its eventual destruction) who is now ready to attack the player.
;Triggers
:state=0:state=1
:state=1,plrdistwithin=200:etimerstart,state=5
:state=5,random=5:state=11
:state=5,random=5:state=12
:state=5,random=5:state=13
:state=5,random=5:state=14
:state=5,random=5:state=15
:state=11,etimergreater=100:state=19
:state=12,etimergreater=2000:state=19
:state=13,etimergreater=500:state=19
:state=14,etimergreater=1500:state=19
:state=15,etimergreater=1000:state=19
:state=19:etimerstart,state=20
:state=20,random=5:state=25
:state=20,random=5:plrsound=audiobank\materials\2metalI.wav,state=25
:state=20,random=5:plrsound=audiobank\materials\7drumA1.wav,state=25
:state=20,random=5:plrsound=audiobank\materials\7drumI.wav,state=25
:state=20,random=5:plrsound=audiobank\materials\7drumA3.wav,state=25
:state=25,random=5:state=31
:state=25,random=5:state=32
:state=25,random=5:state=33
:state=25,random=5:state=34
:state=25,random=5:state=35
:state=31,etimergreater=100:state=39
:state=32,etimergreater=500:state=39
:state=33,etimergreater=200:state=39
:state=34,etimergreater=400:state=39
:state=35,etimergreater=300:state=39
:state=39:etimerstart,state=40
:state=40,random=5:state=45
:state=40,random=5:plrsound=audiobank\materials\2metalI.wav,state=45
:state=40,random=5:plrsound=audiobank\materials\7drumA1.wav,state=45
:state=40,random=5:plrsound=audiobank\materials\7drumI.wav,state=45
:state=40,random=5:plrsound=audiobank\materials\7drumA3.wav,state=45
:state=45:etimergreater=200,state=50
:state=50,random=5:state=90
:state=50,random=5:plrsound=audiobank\materials\2metalI.wav,state=90
:state=50,random=5:plrsound=audiobank\materials\7drumA1.wav,state=90
:state=50,random=5:plrsound=audiobank\materials\7drumI.wav,state=90
:state=50,random=5:plrsound=audiobank\materials\7drumA3.wav,state=90
:state=90:etimerstart,state=95
:state=95,random=5:state=100
:state=95,random=5:state=101
:state=95,random=5:state=102
:state=95,random=5:state=103
:state=95,random=5:state=104
:state=100,etimergreater=3000:state=1
:state=101,etimergreater=4000:state=1
:state=102,etimergreater=5000:state=1
:state=103:state=200
:state=104:state=200
:state=200:plrsound=audiobank\materials\2metalD.wav,etimerstart,state=201
:state=201,etimergreater=500:activateifused=1,destroy
;End of Script
How it works:
The script triggers when the player comes closer than 2 segments in 0.1-2.0 secs and plays random banging sounds (0-3) before it has a high chance to be destroyed (~40%). If the door is not destroyed, the script resets randomly (3-5 secs) after which it can again be triggered by the player. There should be an enemy placed behind this door (the reason for the banging at the door and its eventual destruction) who is now ready to attack the player.
To make the door not just dissappear upon destruction, a second door has to be put in front of this door and its name has to be put into the "if used" box of this one. The second door has to be slightly angled to the direction it should fall, "spawn at start" has to be put to "NO" and "is immobile" has to be put to "NO" as well. Check out this thread for a detailed setup:
http://forum.thegamecreators.com/?m=forum_view&t=182353&b=23
Examples where to use:
In exploration maps where the player has a high chance to pass by this door several times, it can distract and scare the player as well as providing an additional (surprise) enemy.
Issues:
Random banging sounds are cool but random enemies should be very carefully placed. There should be only one of these doors in a whole level unless the level is very large and the doors are far apart from each other. The stock sounds used for this script are far from perfect for the job. You might find better.
UPDATE 14/08/2012
In addition to 4 new scripts all CODEs have the scripts name which I use in my own library included in the very first line. This should avoid any confusion or double entry once I include them in a download.
Turn player round (4 text lines)
;Artificial Intelligence Script: PlayerBarrier4lines
by TheStoryteller01 2012
;Header
desc=
This script only works with FPSC 1.19. or higher.
Made for trigger zones to freeze the player and display 3 text lines before turning him around and moving him back a segments length.
After the first time, the script displays a 4th text line before turning him around and moving him back. This 4th line will be repeated
on consecutive times. The trigger zone will stay in game.
;Triggers
:state=0:state=1
:state=1,plrwithinzone=1:etimerstart,plrdisable=100000,state=2
:state=2:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=56
:state=2:fpgcrawtext=What am I doing?
:state=2,etimergreater=500,plrusingaction=1:etimerstart,state=4
:state=2,etimergreater=3000:etimerstart,state=4
:state=4:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=56
:state=4:fpgcrawtext=I can't just run away.
:state=4,etimergreater=500,plrusingaction=1:etimerstart,state=6
:state=4,etimergreater=3000:etimerstart,state=6
:state=6:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=56
:state=6:fpgcrawtext=I have to finish this....at all cost.
:state=6,etimergreater=500,plrusingaction=1:state=20
:state=6,etimergreater=3000:state=20
:state=8,plrwithinzone=1:etimerstart,plrdisable=100000,state=10
:state=10:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=56
:state=10:fpgcrawtext=I have to get myself together!
:state=10,etimergreater=500,plrusingaction=1:state=20
:state=10,etimergreater=3000:state=20
:state=20:fpgcrawtextoff,etimerstart,plrrotatey=10,state=21
:state=21,etimergreater=20:etimerstart,plrrotatey=20,state=22
:state=22,etimergreater=20:etimerstart,plrrotatey=30,state=23
:state=23,etimergreater=20:etimerstart,plrrotatey=40,state=24
:state=24,etimergreater=20:etimerstart,plrrotatey=50,state=25
:state=25,etimergreater=20:etimerstart,plrrotatey=60,state=26
:state=26,etimergreater=20:etimerstart,plrrotatey=70,state=27
:state=27,etimergreater=20:etimerstart,plrrotatey=80,state=28
:state=28,etimergreater=20:etimerstart,plrrotatey=90,state=29
:state=29,etimergreater=20:etimerstart,plrrotatey=100,state=30
:state=30,etimergreater=20:etimerstart,plrrotatey=110,state=31
:state=31,etimergreater=20:etimerstart,plrrotatey=120,state=32
:state=32,etimergreater=20:etimerstart,plrrotatey=130,state=33
:state=33,etimergreater=20:etimerstart,plrrotatey=140,state=34
:state=34,etimergreater=20:etimerstart,plrrotatey=150,state=35
:state=35,etimergreater=20:etimerstart,plrrotatey=160,state=36
:state=36,etimergreater=20:etimerstart,plrrotatey=170,state=37
:state=37,etimergreater=20:etimerstart,plrrotatey=180,state=50
:state=50:plrdisable=0,plrforcemove=200
:state=50,etimergreater=1000:plrforcemove=0,state=60
:state=60:state=8
;End of Script
How it works:
When the player enter the trigger zone he will be frozen and the text line
“What am I doing?” will be displayed. Pressing enter (or waiting a few seconds) displays the text line
“ I can't just run away.” . Pressing enter again (or waiting a few seconds) displays the text line
“ I have to finish this....at all cost. “. After that the player will be turned around 180 degrees and forcemoved out of the trigger zone. From then on, entering the trigger zone consecutively, a new text line
”I have to get myself together!” will be displayed before the player will be sent back again.
Examples where to use:
Outdoor maps or open world attempts where the player shouldn’t just run into invisible walls to become blocked from leaving the playable map area.
Issues:
Although the script works 100% reliably for me, in case that behind the trigger zone is a map edge, it wouldn’t hurt to put an invisible wall there - just in case. Except for very large maps, there should only be one of those scripts in a single level. I strongly recommend, NOT to use my text lines unaltered. The choice of words should depend on the setting of the game, the intended motivation and the social/educational/professional background of the player character. This also includes the number of text lines displayed. Believe me, these are the things that can make or break a game.
Turn player round (single text line)
;Artificial Intelligence Script:PlayerBarrier1line
;Artificial Intelligence Script
by TheStoryteller01 2012
;Header
desc=
This script only works with FPSC 1.19. or higher.
Made for trigger zones to freeze the player and display a single text line before turning him around and moving him back a segments length.
The trigger zone will stay in game and the line will be repeated on consecutively entering the trigger zone.
;Triggers
:state=0:state=8
:state=8,plrwithinzone=1:etimerstart,plrdisable=100000,state=10
:state=10:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=56
:state=10:fpgcrawtext=That's where I came from.
:state=10,etimergreater=500,plrusingaction=1:state=20
:state=10,etimergreater=3000:state=20
:state=20:fpgcrawtextoff,etimerstart,plrrotatey=10,state=21
:state=21,etimergreater=20:etimerstart,plrrotatey=20,state=22
:state=22,etimergreater=20:etimerstart,plrrotatey=30,state=23
:state=23,etimergreater=20:etimerstart,plrrotatey=40,state=24
:state=24,etimergreater=20:etimerstart,plrrotatey=50,state=25
:state=25,etimergreater=20:etimerstart,plrrotatey=60,state=26
:state=26,etimergreater=20:etimerstart,plrrotatey=70,state=27
:state=27,etimergreater=20:etimerstart,plrrotatey=80,state=28
:state=28,etimergreater=20:etimerstart,plrrotatey=90,state=29
:state=29,etimergreater=20:etimerstart,plrrotatey=100,state=30
:state=30,etimergreater=20:etimerstart,plrrotatey=110,state=31
:state=31,etimergreater=20:etimerstart,plrrotatey=120,state=32
:state=32,etimergreater=20:etimerstart,plrrotatey=130,state=33
:state=33,etimergreater=20:etimerstart,plrrotatey=140,state=34
:state=34,etimergreater=20:etimerstart,plrrotatey=150,state=35
:state=35,etimergreater=20:etimerstart,plrrotatey=160,state=36
:state=36,etimergreater=20:etimerstart,plrrotatey=170,state=37
:state=37,etimergreater=20:etimerstart,plrrotatey=180,state=50
:state=50:plrdisable=0,plrforcemove=200
:state=50,etimergreater=1000:plrforcemove=0,state=60
:state=60:state=8
;End of Script
How it works:
Every time the player enter the trigger zone he will be frozen and the text line
“That’s where I came from” will be displayed.
After that the player will be turned around 180 degrees and forcemoved out of the trigger zone.
Examples where to use:
Map dead-ends from where the player has entered or those that fake alternative routes ( “I shouldn’t leave the city”, “I ‘ll only get lost in the dark”, This area is still highly contaminated” )
Issues:
Although the script works 100% reliably for me, in case that behind the trigger zone is a map edge, it wouldn’t hurt to put an invisible wall there - just in case. This script should be used cautiously (like EVERY script forcemoving the player), having more than 2 in a single level and/or being set up so the player constantly runs into it, could become ridiculous. Blocked doors (whether or not displaying text lines) are still the staple.
Playing random sounds (consecutively)
;Artificial Intelligence Script: RandomSoundsRepeat
by TheStoryteller01 2012
;Header
desc=
This script only works with FPSC 1.18 or higher.
Made for trigger zones to play 1 of 10 random sounds in 0 to 2 seconds after the player enters.
After 2 minutes the script resets and the trigger zone will display a random sound again.
;Triggers
:state=0:state=1
:state=1,plrwithinzone=1:etimerstart,state=5
:state=5,random=5:state=11
:state=5,random=5:state=12
:state=5,random=5:state=13
:state=5,random=5:state=14
:state=5,random=5:state=15
:state=11,etimergreater=100:state=19
:state=12,etimergreater=500:state=19
:state=13,etimergreater=1000:state=19
:state=14,etimergreater=1500:state=19
:state=15,etimergreater=2000:state=19
:state=19:etimerstart,state=20
:state=20,random=10:plrsound=audiobank\materials\0groundI.wav,state=50
:state=20,random=10:plrsound=audiobank\materials\3woodI.wav,state=50
:state=20,random=10:plrsound=audiobank\materials\4glassI.wav,state=50
:state=20,random=10:plrsound=audiobank\materials\6clothD.wav,state=50
:state=20,random=10:plrsound=audiobank\materials\6clothI.wav,state=50
:state=20,random=10:plrsound=audiobank\materials\6clothS.wav,state=50
:state=20,random=10:plrsound=audiobank\materials\6clothA2.wav,state=50
:state=20,random=10:plrsound=audiobank\materials\2metalI.wav,state=50
:state=20,random=10:plrsound=audiobank\materials\2metalS.wav,state=50
:state=20,random=10:plrsound=audiobank\materials\18underwaterA3.wav,state=50
:state=50,etimergreater=120000:state=0
;End of Script
How it works:
When the player enter the trigger zone, 1 of 10 sounds will be randomly played after randomly assigned 0 to 2 seconds. After 2 minutes the script resets and upon re-entering the trigger zone it will display a random sound again.
Examples where to use:
Exploration maps that need sounds for immersion or effect without giving the actual trigger zones away. Maps with little action, where the sounds help to distract the player and/or keep him alerted while he is revisiting areas and rooms. Sound paths can be doubled to have them appear more often and/or sound paths can be left blank to provide a chance for the trigger to play no sound at all. This script is NOT suited to scare or shock the player (unless you want your game to have a ghost train feeling). It is recommended to place/size the trigger zone so, that the player cannot bypass it.
Issues:
During testing it appeared to me, that due to the way the engine processes scripts, the chance for a sound to be played is tied to the order, so the sounds at the top of the :state=20 get played more often - therefore the more "logical" the sound, the closer to the top of the list it should be. I used the most generic stock sounds I could find and I strongly recommend, to hand-pick every single sound used for your game - the more generic, the better. This script should be used with caution, random results can still be repetitive. Sound is a main game element and it’s better to have none at all than the wrong ones.
Playing random sounds (once)
;Artificial Intelligence Script: RandomSoundsOnce
by TheStoryteller01 2012
;Header
desc=
This script only works with FPSC 1.18 or higher.
Made for trigger zones to play 1 of 10 random sounds in 0,5 to 2,5 seconds after the player enters.
The trigger zone will be destroyed afterwards.
;Triggers
:state=0:state=1
:state=1,plrwithinzone=1:etimerstart,state=5
:state=5,random=5:state=11
:state=5,random=5:state=12
:state=5,random=5:state=13
:state=5,random=5:state=14
:state=5,random=5:state=15
:state=11,etimergreater=500:state=19
:state=12,etimergreater=1000:state=19
:state=13,etimergreater=1500:state=19
:state=14,etimergreater=2000:state=19
:state=15,etimergreater=2500:state=19
:state=19:etimerstart,state=20
:state=20,random=10:plrsound=audiobank\materials\0groundI.wav,state=21
:state=20,random=10:plrsound=audiobank\materials\3woodI.wav,state=21
:state=20,random=10:plrsound=audiobank\materials\4glassI.wav,state=21
:state=20,random=10:plrsound=audiobank\materials\6clothD.wav,state=21
:state=20,random=10:plrsound=audiobank\materials\6clothI.wav,state=21
:state=20,random=10:plrsound=audiobank\materials\6clothS.wav,state=21
:state=20,random=10:plrsound=audiobank\materials\6clothA2.wav,state=21
:state=20,random=10:plrsound=audiobank\materials\2metalI.wav,state=21
:state=20,random=10:plrsound=audiobank\materials\2metalS.wav,state=21
:state=20,random=10:plrsound=audiobank\materials\18underwaterA3.wav,state=21
:state=21,etimergreater=100:state=50
:state=50:destroy
;End of Script
How it works:
When the player enter the trigger zone, 1 of 10 sounds will be randomly played after randomly assigned 0,5 to 2,5 seconds. The trigger zone will be destroyed afterwards.
Examples where to use:
Action maps where the player is likely to die and repeat an area/level, so he’s going to be distracted and/or surprised when he replays it. This script can be used for shock effects. The trigger zone can be placed, so that the player can also bypass it, to randomize the sound display completely.
Issues:
During testing it appeared to me, that due to the way the engine processes scripts, the chance for a sound to be played is tied to the order, so the sounds at the top of the :state=20 get played more often - this should be considered when assigning the sound paths. I used the most generic stock sounds I could find and I strongly recommend, to hand-pick every single sound used for your game. Sound is a main game element and it’s better to have none at all than the wrong ones.
UPDATE 07/08/2012
Trigger zone one-liner
;Artificial Intelligence Script:Trigger1line
by TheStoryteller01 2012
;Header
desc=
This script only works with FPSC 1.18 or higher.
Made for trigger zones to display a text line as long as the player is within the zone or for 4 seconds after he left it.
The trigger zone will be destroyed then.
IMPORTANT - trigger zones using this script should be far enough apart from each other to not overlap.
;Triggers
:state=0:state=1
:state=1,plrwithinzone=1:etimerstart,state=2
:state=2:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=80
:state=2:fpgcrawtext=I have to be careful from now on.
:state=2,plrwithinzone=0,etimergreater=4000:fpgcrawtextoff,destroy
;End of Script
How it works:
When the player enters the trigger zone, a single text line will be displayed which stays on screen as long as the player is within the zone or for 4 seconds after he left it. The trigger zone will then be destroyed so the text will not be displayed again.
Examples where to use:
Giving the player information about the area, alert him about dangers, displaying his impressions, emotions or thoughts.
Issues:
Since the script is running 4 seconds after the player left the trigger zone, it can overlap with other text scripts if the scripted entity is too close (the solution would be to enlarge the trigger zone to several segments and reduce the ETIMER=4000 accordingly)
Trigger zone two-liner
;Artificial Intelligence Script:Trigger2lines
by TheStoryteller01 2012
;Header
desc=
This script only works with FPSC 1.18 or higher.
Made for trigger zones to freeze the player and display several text lines before he can move on.
Once displayed the trigger zone will be destroyed.
;Triggers
:state=0:state=1
:state=1,plrwithinzone=1:etimerstart,plrdisable=100000,state=2
:state=2:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=56
:state=2:fpgcrawtext=I've been told to meet the captain down here.<enter>
:state=2,etimergreater=500,plrusingaction=1:etimerstart,state=9
:state=2,etimergreater=5000:etimerstart,state=9
:state=9:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=56
:state=9:fpgcrawtext=I wonder what this is about.<enter>
:state=9,etimergreater=500,plrusingaction=1:plrdisable=0,state=10
:state=9,etimergreater=5000:plrdisable=0,destroy
;End of Script
How it works:
When the player enters the trigger zone he becomes frozen and a text line will be displayed that ends with <enter>. The player has to press
enter, then a 2nd text line will be displayed, which again ends with <enter>. After pressing
enter again, the player is free to move and the trigger zone will be destroyed, so the text will not be displayed again.
Examples where to use:
Best at the start of a game so the player learns, that
enter will be used to call text messages. Also useful for giving the player vital information about the level, any objectives or dangers ahead.
Issues:
Since the script is freezing the player, the level should be built so that no enemies are close enough to attack the player while he is in the trigger zone.
UPDATE 09/08/2012: Corrected a reported error and made the script shorter.
Pick-up Item (keycard)
;Artificial Intelligence Script:Keycard
by TheStoryteller01 2012
;Header
desc=
This script only works with FPSC 1.18. or later.
Made for items that can be picked up.
Best ist to set the item properties "Isimmobile" to "Yes" and "Strength" to "0" (=indestructible)
The script starts when the player moves the cursor over the item while not more than 60 units away
;Triggers
:state=0:state=1
:state=1,pickobject=1,plrdistwithin=60:state=3
:state=3:fpgcrawtextsize=48,fpgcrawtextfont=verdana,fpgcrawtextr=190,fpgcrawtextg=190,fpgcrawtextb=190,fpgcrawtextx=50,fpgcrawtexty=46
:state=3:fpgcrawtext=?
:state=3,plrusingaction=1,etimergreater=500:state=4
:state=3,pickobject=0:state=0
:state=4,pickobject=1,plrdistwithin=60:etimerstart,state=5
:state=5:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=190,fpgcrawtextg=190,fpgcrawtextb=190,fpgcrawtextx=50,fpgcrawtexty=56
:state=5:fpgcrawtext=A keycard.
:state=5,plrusingaction=1,etimergreater=500:state=6
:state=5,pickobject=0:state=4
:state=6,pickobject=1,plrdistwithin=60:etimerstart,state=7
:state=7:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=190,fpgcrawtextg=190,fpgcrawtextb=190,fpgcrawtextx=50,fpgcrawtexty=56
:state=7:fpgcrawtext=press <enter> to take the keycard
:state=7,plrusingaction=1,etimergreater=500:state=20
:state=7,pickobject=0:state=6
:state=20:playertake,coloff,plrsound=audiobank\misc\ping.wav,state=90
:state=90:
;End of Script
How it works:
When the player puts the crosshair over the item, a “?” will be displayed. Pressing enter displayes a text line that tells the player he found a key card. Pressing enter again (or waiting a few seconds)displays
“press <enter> to take the keycard “. Pressing
enter again adds the keycard to the players (unseen) inventory. If the player removes the cursor from the object at any time, the text simply stops to display but the script remembers the state it's in, so when later the cursor is moved over the object again, only the last displayed line will be displayed instead of the script starting all over.
Examples where to use:
Exploration games where the player has to pick up objects actively instead of just picking them up them by getting near.
Issues:
The item may not be placed inside a trigger zone displaying text or on top/in front of another item displaying text or requiring the player to press enter.
Health Item (first aid kit)
;Artificial Intelligence Script:FirstAid
by TheStoryteller01 2012
;Header
desc=
This script only works with FPSC 1.18. or later.
Made for health items giving +50 HP.
Best ist to set the item properties "Isimmobile" to "Yes" and "Strength" to "0" (=indestructible)
The script starts when the player moves the cursor over the item while not more than 60 units away
;Triggers
:state=0:state=1
:state=1,pickobject=1,plrdistwithin=60:state=3
:state=3:fpgcrawtextsize=48,fpgcrawtextfont=verdana,fpgcrawtextr=190,fpgcrawtextg=190,fpgcrawtextb=190,fpgcrawtextx=50,fpgcrawtexty=46
:state=3:fpgcrawtext=?
:state=3,pickobject=1,plrdistwithin=60,plrusingaction=1:state=4
:state=3,pickobject=0:state=0
:state=4,pickobject=1,plrdistwithin=60:etimerstart,state=5
:state=5:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=190,fpgcrawtextg=190,fpgcrawtextb=190,fpgcrawtextx=50,fpgcrawtexty=56
:state=5:fpgcrawtext=A first aid kit.
:state=5,plrusingaction=1,etimergreater=500:state=6
:state=5,pickobject=0:state=14
:state=6,pickobject=1,plrdistwithin=60:etimerstart,state=7
:state=7:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=190,fpgcrawtextg=190,fpgcrawtextb=190,fpgcrawtextx=50,fpgcrawtexty=56
:state=7:fpgcrawtext=Press <enter> to use the first aid kit.
:state=7,plrusingaction=1,etimergreater=500:etimerstart,state=50
:state=7,pickobject=0:state=16
:state=14,pickobject=1,plrdistwithin=60:etimerstart,state=15
:state=15:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=190,fpgcrawtextg=190,fpgcrawtextb=190,fpgcrawtextx=50,fpgcrawtexty=56
:state=15:fpgcrawtext=A first aid kit.
:state=15,plrusingaction=1,etimergreater=500:state=6
:state=15,pickobject=0:state=14
:state=16,pickobject=1,plrdistwithin=60:etimerstart,state=17
:state=17:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=190,fpgcrawtextg=190,fpgcrawtextb=190,fpgcrawtextx=50,fpgcrawtexty=56
:state=17:fpgcrawtext=Press <enter> to use the first aid kit.
:state=17,plrusingaction=1,etimergreater=500:etimerstart,state=50
:state=17,pickobject=0:etimerstop,state=16
:state=50:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=204,fpgcrawtextg=000,fpgcrawtextb=000,fpgcrawtextx=50,fpgcrawtexty=56
:state=50:fpgcrawtext= +50 health
:state=50:plraddhealth=50,plrsound=audiobank\items\healthup.wav,state=90
:state=90,etimergreater=1000:destroy
;End of Script
How it works:
When the player puts the crosshair over the item, a “?” will be displayed. Pressing enter displayes a text line that tells the player he found a first aid kit. Pressing enter again (or waiting a few seconds)displays
“press <enter> to use the first aid kit “. Pressing enter adds 50 to the players health and displays
“+50 health” in red for 3 seconds and destroys the first aid kit. If the player removes the cursor from the object at any time, the text simply stops to display but the script remembers the state it's in, so when later the cursor is moved over the object again, only the last displayed line will be displayed instead of the script starting all over.
Examples where to use:
Exploration games where the player has to use objects on purpose instead of just consuming them by getting near.
Issues:
This script does not take into account if the players has full health. The item may not be placed inside a trigger zone displaying text or on top/in front of another item displaying text or requiring the player to press enter. The
+50 health display would look better if faded out, but currently that cannot be done for FPGCRAWTEXT.
In case you find my grammar and spelling weird ---> native German speaker ^^