The script is done. But since I couldnt make the hudtext to get any colour (hudred=xx etc. doesnt seem to work)its just rawtext.
The example script is for a key that can be picked up:
;Artificial Intelligence Script
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,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=an old key
: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 take the key
:state=7,plrusingaction=1,etimergreater=500:state=20
: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=an old key
: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 take the key
:state=17,plrusingaction=1,etimergreater=500:state=20
:state=17,pickobject=0:etimerstop,state=16
:state=20:playertake,coloff,plrsound=audiobank\thestoryteller01\keypickup.wav,state=90
:state=90:
;End of Script
What does it do?
1. when the player moves the crosshair over the object a "?" is displayed.
2. after pressing ENTER "an old key" is displayed.
3. after pressing ENTER again "press <enter> to take the key" is displayed
4. and after pressing ENTER a 3rd time the key is finally picked up.
To make the whole thing a little less boring, the player is not frozen while the script is running (as in my previous AGSP scripts).
Instead the text display disappears when the player moves the crosshair away from the object AND the script stores the 'state of exploration'. That means if the crosshair is removed at stage 3, the next time the player moves the crosshair over the object again, the text from stage 3 will be displayed and the player can immideately take the object.
I hope this is what you wanted @Burger
In case you find my grammar and spelling weird ---> native German speaker ^^