Hi Guys! I am quite new to Lua and late to the party...
so maybe my questions will not make much sense to ya, but i will risk asking them anyway. I have search other treads and read a lot but i am still confuse...so here i go;
1-When you load images (for sprites), how much memory do you have to store them? Can i have sprites the size of the entire screen in order to create nice HUDs (using transparent color at saving time) and make them appear on a press of a button? I am asking because i tried this and I keep getting error 301 and GG stop then reboot my level. Here is an exemple i am working on; (but it bug out with 'error 301() 'when i switch them using g_KeyPress and g_Scancode...)
I think GG is great and i am waiting for GGM to hit the steam store. My money is ready!!!
function mydisplay_init(e)
amyHud=0
g_amyHudSprite=0
g_amyHudSprite1=0
HideHuds()
amyHud = LoadImage("scriptbank\\images\\magnanir\\images\\HUD_MagnanirBase1.png")
g_amyHudSprite = CreateSprite ( amyHud )
SetSpriteSize ( g_amyHudSprite, 100 , 100 )
SetSpriteDepth ( g_amyHudSprite, 100 )
SetSpriteColor ( g_amyHudSprite, 255,255,255,250)
SetSpritePosition ( g_amyHudSprite, 0,0)
amyHud = LoadImage("scriptbank\\images\\magnanir\\images\\advsheet1.png")
g_amyHudSprite1 = CreateSprite ( amyHud )
SetSpriteSize ( g_amyHudSprite1, 100 , 100 )
SetSpriteDepth ( g_amyHudSprite1, 99 )
SetSpriteColor ( g_amyHudSprite1, 255,255,255,250)
--to hide the sprite, I move it away from the screen
SetSpritePosition ( g_amyHudSprite1,100,100)
end
function mydisplay_main(e)
if g_PlrKeyJ==1 then
SetSpritePosition ( g_amyHudSprite,100,100)
PasteSpritePosition (g_amyHudSprite1,0,0)
end
--if player use T...
if g_Scancode==20 then
SetSpritePosition ( g_amyHudSprite1,100,100)
PasteSpritePosition (g_amyHudSprite,0,0)
end
end
2-My second question is about variables. How can i make sure i am not overwriting a value with another script attached to another entity? For exemple, if i used g_amyHudSprite1 in this script, how can i be sure that i am not assigning it another value in another script? (sending my sprite in the confusion world...) Should i create a 'global script loading all my HUD first (images)? Where should i put my variable?
Thank you for your understanding. I have learn so much in 3 weeks, but i am hitting a wall here...
When I died, I want to be buried in Cyrodil!
The author of this post has marked a post as an answer.
Go to answer