So yeah I'm having some issues with a picture I want to display in the game. The main purpose of the picture is for it to pop up when the player uses a switch (so it's like a number code thingy to unlock a door). That part of the code works, but when the game loads the image something weird happens. It's hard to describe, so I'll upload the snapshots of the game in this post and the next one.
Also, when the correct code is entered, I want the image to change to an image with the green light on as opposed to the red light. I can get the red one to go away, but for some reason the green one won't appear. Here is all my code:
The MAIN script for the switch5:
;Artificial Intelligence Script
;Header
desc = Switch Activate (toggle on and off)
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10
:plrdistwithin=50:hudshow=useswitchprompt,hudfadeout=useswitchprompt
:state=10,plrdistwithin=50,plrusingaction=1:state=1,hudfadeout=useswitchprompt,runfpi=user\RED.fpi,activate=0
:state=1,activated=1:activateifused=1,state=2,plrsound=$0,alttexture=1
:state=2,plrdistwithin=50,plrusingaction=1:state=3,plrsound=$1,activateifused=0,alttexture=0
:state=3,plrusingaction=0:state=10
;End of Script
RED.fpi:
;Artificial Intelligence Script
;Header
desc =Number Pad security image
;Triggers
:plrwithinzone=0:state=0,hudfadeout=locked
:state=0,varnotequal=1:localvar=0
:state=0:state=1
:state=1,plrwithinzone=1,varequal=0:hudreset,hudx=50,hudy=50,hudimagefine=texturebank\user\RED.dds,hudname=locked,hudhide=0,hudmake=display,state=20,localvar=1
:state=1,plrwithinzone=1,varequal=1:hudshow=locked
;For correct number pressing (1142)
:state=10,timergreater=500,scancodekeypressed=79:state=11,sound=audiobank\switches\click.wav,timerstart
:state=11,timergreater=500,scancodekeypressed=79:state=12,sound=audiobank\switches\click.wav,timerstart
:state=12,timergreater=500,scancodekeypressed=75:state=13,sound=audiobank\switches\click.wav,timerstart
:state=13,timergreater=500,scancodekeypressed=80:state=21,sound=audiobank\switches\click.wav,timerstart
;For incorrect number pressing (not 1142)
:state=10,scancodekeypressed=81,timergreater=500:sound=audiobank\switches\click.wav,state=31,timerstart
:state=10,scancodekeypressed=80,timergreater=500:sound=audiobank\switches\click.wav,state=31,timerstart
:state=10,scancodekeypressed=82,timergreater=500:sound=audiobank\switches\click.wav,state=31,timerstart
:state=10,scancodekeypressed=77,timergreater=500:sound=audiobank\switches\click.wav,state=31,timerstart
:state=10,scancodekeypressed=76,timergreater=500:sound=audiobank\switches\click.wav,state=31,timerstart
:state=10,scancodekeypressed=75,timergreater=500:sound=audiobank\switches\click.wav,state=31,timerstart
:state=10,scancodekeypressed=71,timergreater=500:sound=audiobank\switches\click.wav,state=31,timerstart
:state=10,scancodekeypressed=73,timergreater=500:sound=audiobank\switches\click.wav,state=31,timerstart
:state=10,scancodekeypressed=72,timergreater=500:sound=audiobank\switches\click.wav,state=31,timerstart
:state=11,scancodekeypressed=81,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=11,scancodekeypressed=80,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=11,scancodekeypressed=82,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=11,scancodekeypressed=77,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=11,scancodekeypressed=76,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=11,scancodekeypressed=75,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=11,scancodekeypressed=71,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=11,scancodekeypressed=73,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=11,scancodekeypressed=72,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=12,scancodekeypressed=82,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=12,scancodekeypressed=81,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=12,scancodekeypressed=80,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=12,scancodekeypressed=79,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=12,scancodekeypressed=77,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=12,scancodekeypressed=76,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=12,scancodekeypressed=71,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=12,scancodekeypressed=73,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=12,scancodekeypressed=72,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=13,scancodekeypressed=82,timergreater=500:state=61,timerstart
:state=13,scancodekeypressed=81,timergreater=500:state=61,timerstart
:state=13,scancodekeypressed=79,timergreater=500:state=61,timerstart
:state=13,scancodekeypressed=77,timergreater=500:state=61,timerstart
:state=13,scancodekeypressed=76,timergreater=500:state=61,timerstart
:state=13,scancodekeypressed=75,timergreater=500:state=61,timerstart
:state=13,scancodekeypressed=71,timergreater=500:state=61,timerstart
:state=13,scancodekeypressed=73,timergreater=500:state=61,timerstart
:state=13,scancodekeypressed=72,timergreater=500:state=61,timerstart
:state=31,scancodekeypressed=82,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=31,scancodekeypressed=81,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=31,scancodekeypressed=80,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=31,scancodekeypressed=79,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=31,scancodekeypressed=77,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=31,scancodekeypressed=76,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=31,scancodekeypressed=75,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=31,scancodekeypressed=71,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=31,scancodekeypressed=73,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=31,scancodekeypressed=72,timergreater=500:sound=audiobank\switches\click.wav,state=41,timerstart
:state=41,scancodekeypressed=82,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=41,scancodekeypressed=81,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=41,scancodekeypressed=80,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=41,scancodekeypressed=79,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=41,scancodekeypressed=77,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=41,scancodekeypressed=76,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=41,scancodekeypressed=75,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=41,scancodekeypressed=71,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=41,scancodekeypressed=73,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=41,scancodekeypressed=72,timergreater=500:sound=audiobank\switches\click.wav,state=51,timerstart
:state=51,scancodekeypressed=82,timergreater=500:sound=audiobank\switches\click.wav,state=61,timerstart
:state=51,scancodekeypressed=81,timergreater=500:sound=audiobank\switches\click.wav,state=61,timerstart
:state=51,scancodekeypressed=80,timergreater=500:sound=audiobank\switches\click.wav,state=61,timerstart
:state=51,scancodekeypressed=79,timergreater=500:sound=audiobank\switches\click.wav,state=61,timerstart
:state=51,scancodekeypressed=77,timergreater=500:sound=audiobank\switches\click.wav,state=61,timerstart
:state=51,scancodekeypressed=76,timergreater=500:sound=audiobank\switches\click.wav,state=61,timerstart
:state=51,scancodekeypressed=75,timergreater=500:sound=audiobank\switches\click.wav,state=61,timerstart
:state=51,scancodekeypressed=71,timergreater=500:sound=audiobank\switches\click.wav,state=61,timerstart
:state=51,scancodekeypressed=73,timergreater=500:sound=audiobank\switches\click.wav,state=61,timerstart
:state=51,scancodekeypressed=72,timergreater=500:sound=audiobank\switches\click.wav,state=61,timerstart
:state=61:sound=audiobank\switches\deactivate.wav,state=10
:state=22:hudhide=locked,state=23,runfpi=user\GREEN.fpi
:state=21:sound=audiobank\switches\activate.wav,state=22
:state=20:hudshow=locked,state=10
;End of Script
And GREEN.fpi:
;Artificial Intelligence Script
;Header
desc =Number Pad security image unlocked
;Triggers
:state=0:state=1
:state=1,plrwithinzone=1:hudreset,hudx=50,hudy=50,hudimagefine=texturebank\user\GREEN.dds,hudname=unlocked,hudhide=0,state=2
:state=2:hudshow=unlocked,settargetname=switch5,state=3
:state=3:activatetarget=1
:plrdistfurther=50:hudfadeout=unlocked
All help is greatly appreciated!!! And again attached is what it looks like when the image appears.