PDA

View Full Version : Gaming Engin Version 0 HELP


rexzooly
02-09-2009, 08:24 PM
Hey all i was board again and i wanted to this time go a GE my self from scratch
wat was all fine until i tryed doing this

EG
Perload for firefire


Globle:

X = {};
X.FF = 0;
X.Health = 100;
""

All good but i want to editing the glodle stats with one funtion EG

X.UpdateGS = function(sUpdate)
X.sUpdate = X.."."..sUpdate;
X.sUpdate = X.sUpdate+1;
Label.SetText("Label1", "Health: "..X.Health.." Hunger: "..X.Hunger.." Ammo: "..X.Ammo.." Weapon: "..X.Weapen_Is.." Hidden Gem's: "..X.Hidden_Gems);
end;

Also Tried


X.UpdateGS = function(sUpdate)
X.U = sUpdates
X.sUpdate = X.."."..X.U;
X.sUpdate = LuaX.sUpdate+1;
Label.SetText("Label1", "Health: "..X.Health.." Hunger: "..X.Hunger.." Ammo: "..X.Ammo.." Weapon: "..X.Weapen_Is.." Hidden Gem's: "..X.Hidden_Gems);
end;

Preload
X.UpdateGE(FF);

How do i get X and sUpdate to = X.FF or X.what eva sUpdate is set as?

Thanks:p

Worm
02-09-2009, 09:00 PM
X.UpdateGS = function(sUpdate)
if X[sUpdate] then
X[sUpdate] = X[sUpdate]+1;
Label.SetText("Label1", "Health: "..X.Health.." Hunger: "..X.Hunger.." Ammo: "..X.Ammo.." Weapon: "..X.Weapen_Is.." Hidden Gem's: "..X.Hidden_Gems);
end
end;

rexzooly
02-09-2009, 09:03 PM
So i don't need the . then ? .. ok i try this now thankis worm :p

Worm
02-09-2009, 09:08 PM
Lua let's ref the tables in different ways. This is probably not the only way to do it, but its what I'm familiar with.

rexzooly
02-09-2009, 09:08 PM
Another problem where is the best place to stick the states that the game engin will need
X.FF =0;
X.Heath = 100;

so on are not showing in the Lable?

Worm
02-09-2009, 09:10 PM
not sure I understand what you are asking.

rexzooly
02-09-2009, 09:14 PM
X.Health = 100;
X.Hunger = 0;
X.Ammo = 0;
X.Weapen = 0;
X.Hidden_Gems = 0;
X.FF = 0;

It dose not update unles is X.[sUpdate] ?
I wanted to set them globle so when i have complated the engin people will be able to make games on top of the engine.

Worm
02-09-2009, 09:18 PM
If you're saying you want to give them an initial value, then put them in the Global Functions, but not within a function. Or you could put them in a function called InitVars() or something like that.

rexzooly
02-09-2009, 09:21 PM
If you're saying you want to give them an initial value, then put them in the Global Functions, but not within a function. Or you could put them in a function called InitVars() or something like that.

I will send you the APZ in a PM as its also my Point and click what i dont what to give out until complete lol :P you will see what i mean :yes

Worm
02-09-2009, 09:33 PM
Line 13 in the Globals, change to

LuaX.Weapen_Is = "None";

rexzooly
02-09-2009, 10:27 PM
That simple? OK thanks lol i will try that :P this is a long term project so i guess there will be other little problems like this thanks worm/