Jump to content

Noob LUA Scripting Question


Guest Red Ocktober
 Share

Recommended Posts

Guest Red Ocktober

ok... first off all this is all Aggror's fault... he's the one who's got me trying to come to grips with this lua stuff with his video tutorials... :lol:

 

here's my problem...

 

i can't figure out why i can't get the camera to move when i press the appropriate keys...

here is the code...

 

while  AppTerminate()==0 do



 if(KeyDown(KEY_A)) then cam:Turn(Vec3(0,1,0)) end
 if(KeyDown(KEY_D)) then cam:Turn(Vec3(0,-1,0)) end 

 if(KeyDown(KEY_W)) then cam:Move(Vec3(0,0,1)) end
 if(KeyDown(KEY_S)) then cam:Move(Vec3(0,0,-1)) end

 cube:Turn(Vec3(1,1,1));


 fw:Update();
 fw:Render();

 Flip(0);
end

 

 

do i need to include a key constants file or something, or is the code totally off in deep space...

 

thx

 

 

also... strange things to note...

 

1- i can load the tunnels.sbx scene into the editor in beta 2.32, but not in the 2.31 editor... it just quits...

 

2- i can load the tunnels.sbx scene from a lua app in both 2.32 beta and 2.31, but can't load it from bmax app... it says can't find query.vert error but i know it's in the pak...

 

3- lua compiler is super quick... and compiled apps seem to be running pretty swiftly compared to earlier LW versions... probably my imagination...

 

 

anyways... thx again in advance for any and all help...

 

 

 

--Mike

Link to comment
Share on other sites

Guest Red Ocktober

i thought we already covered this here :lol:

 

yes... yes we did... you're absolutely right... doing a refresher on it now...

 

 

THANKS again Mack...

 

 

--Mike

Link to comment
Share on other sites

Guest Red Ocktober

yeah... i just got done filing a supplemental legal brief that wore me out, and it seems as if my mind is still recovering from it :lol:

 

 

also, i'm too many programming languages in one sitting... i was doing something on the mac in c++ and trying to come to grips with this lua stuff again... and i wrote the lua code as i would in c++... i forgot to explicitly test the conditionals in the lua script...

 

if(KeyDown(KEY_A)) doesn't seem to want to test true... i need to code it like this if(KeyDown(KEY_A)==1) for it to work...

 

i'll be alright... it's almost bed time... :D

 

 

hey, thx again for the help...

 

 

--Mike

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...