Scripts / help with sequential image script

Author
Message
Xeethra
8
Years of Service
User Offline
Joined: 23rd Feb 2016
Location:
Posted: 15th Mar 2016 22:27
Not a scripter and try as I might can't get this to work. I'm trying to freeze player and play a series of images each one disappearing with
a click of the "e" key and being replaced by the next, as is common in visual novels. I'd prefer to do this with sprites but I'm having trouble
getting to work even with images. Below is my script so far. It keeps skipping to the second of code and ignoring the first.




function introspeak_init(e)
LoadImages("Master of the Astral",0)
IntroCounter = 0
end

function introspeak_main(e)

if IntroCounter > 0 then
else
SetImagePosition(50,50)
ShowImage(0)
FreezePlayer()
Prompt ("Press E to Continue" )

if g_KeyPressE == 1 then
IntroCounter = 1
HideImage(0)
end
end

if IntroCounter > 1 then
else
SetImagePosition(50,50)
ShowImage(1)

Prompt ("Press E to Continue" )

if g_KeyPressE == 1 then
IntroCounter = 2
UnFreezePlayer()
HideImage(1)
end
end





end

PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 16th Mar 2016 09:09 Edited at: 16th Mar 2016 09:21
you have erroneous "else" in each section your calling an if statement then instantly telling it "else" with nothing inbetween

I think this should fix it, can't check it at work though.



Here's a script that smallg wrote to do this some time ago, it uses images instead of sprites, but maybe it can help you work it out:

notes.lua

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.
Xeethra
8
Years of Service
User Offline
Joined: 23rd Feb 2016
Location:
Posted: 16th Mar 2016 16:28
Thanks, Belidos, just what I needed.
PM

Login to post a reply

Server time is: 2024-05-03 12:58:27
Your offset time is: 2024-05-03 12:58:27