Hi Nathan38,
This should do what you want.
I have placed comments in the script to help step you through the sequence.
See the link below for more details on the commands.
http://steamcommunity.com/sharedfiles/filedetails/?id=398177770&insideModal=1
Cheers
-- The player enters into a TriggerZone and the game pauses and an image is displayed.
local reading
function plrinzone_test_init(e)
LoadImages("Tutorial",0)
SetImagePosition(50,50) -- sets the image to the centre of the screen
SetImageAlignment(0)
HideImage(0) -- Hides image 000.png
reading = 0
end
function plrinzone_test_main(e)
-- player has just stepped inside the trigger zone.
if g_Entity[e]['plrinzone']==1 and g_Entity[e]['activated']==0 then -- You need to use g_Entity[e]['plrinzone'] to do the check for trigger zones.
SetActivated(e,1) -- changes g_Entity[e]['activated']==0 to g_Entity[e]['activated']==1
FreezeAI()
FreezePlayer()
ActivateIfUsed(e)
PlaySound(e,0)
ShowImage(0) -- Shows image 000.png
end
-- player is inside the trigger zone and waiting for the keypress.
if g_Entity[e]['plrinzone']==1 and g_Entity[e]['activated']==1 then
if g_KeyPressE==0 and reading==0 then
Prompt("Press E to continue")
end
-- Keypress has just happened.
if g_KeyPressE==1 and reading==0 then
UnFreezeAI()
UnFreezePlayer()
HideImage(0) -- Hides image 000.png
reading = 1
end
end
-- Player is outside the trigger zone and the note has been read.
if g_Entity[e]['plrinzone']==0 and reading==1 then
Destroy(e)
end
end
Desktop: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 CPUs), ~3.6GHz, Windows 8.1 64-bit, 16 GB Ram, NVIDIA GeForce GTX 750 Ti, Display Memory: 4018 MB. Resolution 1360x768, Passmark 3528.
Laptop: Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)