Scripts / Runtime Error (301)

Author
Message
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 16th Oct 2020 18:06
Wondering why I'm getting a runtime error;
>>Level runs for a few minutes<<, I essentially do nothing, suddenly
Runtime error (301) pops on the screen. Any ideas?
There's nothing in the level except ONE barrel running ONE script!

All the script does is ((testing sprite on screen)) -- is there a memory
problem required to delete and respawn sprites? Hmmm... strange.

This is done ONE time within init.............
onescifitile_icon = LoadImage ( "scriptbank\\images\\onescifitile.png" )
onescifitile_sprite = CreateSprite ( onescifitile_icon )
SetSpritePosition (onescifitile_sprite, 50, 50)
end -- init ...................................

It also assigns a few variables to arrays[1200] level.
Also, the script just shows some variable info [text] on screen- that's it.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Oct 2020 18:59
shouldn't be, you probably made a spelling mistake somewhere - any chance you can post the script?
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 16th Oct 2020 19:08 Edited at: 16th Oct 2020 19:18
Should I make these variables local?
(I did not), in fact forgot to >>declare<< them before the sprite assignments...?

should I example:

local onescifitile_icon = {}
local onescifitile_sprite = {}

init........................
onescifitile_icon = LoadImage ( "scriptbank\\images\\onescifitile.png" )
onescifitile_sprite = CreateSprite ( onescifitile_icon )
SetSpritePosition (onescifitile_sprite, 50, 50)
end -- init ...................................
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 16th Oct 2020 19:20 Edited at: 16th Oct 2020 19:57
Okay, made them local, and it seems like
the script runs for about 5 minutes (didn't time it)
before the runtime error occurs-- but it still did.

Edit.............
Thanks, fixed-- just user error because I didn't know what I was doing!
I guess when I change out sprites, I will need to delete all the current
ones? I will try that soon.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 16th Oct 2020 19:24
Just post the script.
Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-05-01 22:49:53
Your offset time is: 2024-05-01 22:49:53