Scripts / Error in JETPACK Script Help Please

Author
Message
ozziedave
18
Years of Service
User Offline
Joined: 20th Apr 2006
Location: Australia
Posted: 8th Oct 2014 06:25 Edited at: 10th Oct 2014 02:20
Hi All,



I purchased the JetPack Gold from the store, I downloaded it, installed

automatically.



I placed it in The Escape Scene, and pressed Play in the Editor, when

the Editor got to Initialising Physics the programme froze with Error

In LUA. Script Below...

----------------------------------------------------------------------------------------------------------------------

-- LUA Script - precede every function and global member with lowercase name of script + '_main'



function jetpack_init(e)

end



function jetpack_main(e)

PlayerDist = GetPlayerDistance(e)

if PlayerDist < 150 then

SourceAngle = g_PlayerAngY

while SourceAngle < 0.0 do

SourceAngle = SourceAngle + 360.0

end

while SourceAngle > 340.0 do

SourceAngle = SourceAngle - 360.0

end

PlayerDX = (g_Entity[e]['x'] - g_PlayerPosX)

PlayerDZ = (g_Entity[e]['z'] - g_PlayerPosZ)

DestAngle = math.atan2( PlayerDZ , PlayerDX )

DestAngle = (DestAngle * 57.2957795) - 90.0

Result = math.abs(math.abs(SourceAngle)-math.abs(DestAngle))

if Result > 180 then

Result = 0

end

if Result < 20.0 then

Prompt ("Press E To pick up the jetpack")

if g_KeyPressE == 1 then

PromptDuration("Collected the jetpack",3000)

PlaySound(e,0)

AddPlayerJetPack(e,500)

Destroy(e)

ActivateIfUsed(e)

end

end

end

end



----------------------------------------------------------------------------------------------------------------------

Any Ideas Game Creators, or Forum LUA Boffins, as I haven't learned LUA Yet ?.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 9th Oct 2014 11:52
script works fine for me, make sure you are using 1.0085 and you haven't overwritten the globals.lua file with an old one.

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
ozziedave
18
Years of Service
User Offline
Joined: 20th Apr 2006
Location: Australia
Posted: 10th Oct 2014 02:27
smallg, thanks for your info, any idea what is the date stamp on the
latest version of global.lua ?

Cheers
PM
ozziedave
18
Years of Service
User Offline
Joined: 20th Apr 2006
Location: Australia
Posted: 10th Oct 2014 06:45 Edited at: 10th Oct 2014 06:46
smallg found out I had global.lua dated July 2014, I should have had Aug 2014. Re-installed FPSCreatorReloadedBETA-10085.exe

and now the JetPack works fine.



Thanks again.
PM

Login to post a reply

Server time is: 2024-05-02 10:59:10
Your offset time is: 2024-05-02 10:59:10