Andy Gilbert
Members-
Posts
533 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Andy Gilbert
-
This is related too http://www.leadwerks...d-force-result/ but not directly so ive started a new topic. In that thread Josh says: Could someone explain what that means? As, ive noticed that trying my game on different computers results in different force results? Im currently doing all calculations for physics then mulitplying the final force and torque by AppSpped. But this obviously isnt the correct way as there somthing with the physics that i dont understand, the wiki states: UpdatePhysicsCallback This will be called 60 times per second, regardless of framerate. This should be used for physics updates because the physics simulation will be interpolated and smoothed each frame. The physics callback is performed during the UpdateWorld() routine, but it might not be called each frame, or it might be called multiple times in one frame. Ive looked at the example but its old and doesnt use the FW, so im not sure how i impliment it? Plus i would rather understand i than just copy and paste it from an example. Thanks Andy
-
ok, apologise for sounding snappy. Just find it fustrating when you cant find something. Andy
-
Well i certainly wouldnt make up posts for no reason Marley? I assume its because i was searching for terms like, sleep, delay, pause. Which wernt findng much in regards to lua. I did search the forum and found one particlar post that refered the method above but ended on saying you shouldnt use the method as it pauses everything, including loading of assets? So i ignored it... http://www.leadwerks...h__1#entry21594 Andy
-
ok ill give this a go. I dont understand why ive been searching for time functions for lua and read everywhere that lua doesnt have any time functions built in to it, yet it obv has? Thanks Andy
-
ok, but its the "wait" or the "delay" command i cant seem to find for LUA? A wait or pause is exactly what i want, but i cant find a way in lua to do this? Andy
-
Ok, i guess that will do for now, the loading time is around 2 seconds, which is fine enough. Would still know how to do it for n seconds though? Thanks Andy
-
HI Metatron, doesnt in my case? The whole game is ready pretty much instantly... I dont get any "black screen" or anything, it just immidiatly puts me in otthe game. I want to show a splash either before or "over" the game for at least 2 - 3 seconds. Andy
-
HI, im trying to find a way to impliment a splash screen? Just simply show a 2D image for n seconds at the start of the app? With lua not having any build in commands its not a great styart. Ive tryed using Leadwerks timing functons but cant find a way to do it? Anyone had any luck with doing this? Thanks Andy
-
Drawing 2d Rectangle keeps jumping to 0,0?
Andy Gilbert replied to Andy Gilbert's topic in Programming
Ok thanks, I'll implement that and see how it goes. Thanks Andy -
Drawing 2d Rectangle keeps jumping to 0,0?
Andy Gilbert replied to Andy Gilbert's topic in Programming
HI, roll is just : roll = Curve(KeyDown(KEY_LEFT) - KeyDown(KEY_RIGHT),roll,40) Which when printed is long number generally below 1 like 0.0023345 (example) Ive tried getting screent shots but it "flickers" from line to normal and everytime it never gets it, it isnt "all" the time, like once every 2 - 3 seconds? Thanks Andy -
HI, im drawing a couple of rectangles for a simple GUI. They show "levels" of dynamic values withing the game. Problem im having is i keep getting "lines" going from 0,0 (top left corner) to where the rectangle cooords are? They keep jumping from showing the rectangle correctly to then lines going to 0,0? Ive checked my code but cant even see how they would goto 0,0 becasue the function to draw the rect is Xpos,Ypos,width,height and my Xpos and Y pos are static values which never change, along with width too. Only "height" changes. --GUI SetColor(Vec4(0,1,0,0.6)) DrawRect(GraphicsWidth()-50,GraphicsHeight()-100,10,roll*100) DrawRect(GraphicsWidth()-90,GraphicsHeight()-100,10,0-(roll*100)) Why would it be doing this? Thanks Andy
-
Managed to do it in the end, thats for the help, appreciated. Andy
-
Ok, ive give it a go and think i understand it now, but the issue now is that how to declare a "Tpick" in lua? Do i just use a table/array? Thanks Andy
-
HI Macklebee, maybe im not understanding the pick commands correctly. Ive took out the code i tried (as it wasnt working) but ill give it another go then return with it if i dont have any luck. as i want to check the distance of between the entity and the terrain directly below, i thought a "linepick" is what i would want, but i was just returning an error. Ill try again. Cheers Andy
-
Ok. the problem i immidiatly came up against with raycasting in lua was finding the "terrain", i tryed using FindChild("terrain") but it doesnt find it? How can i return the terrain from a scene loaded ion, for use as an entity, for raycasting? Andy
-
HI YouGroove, Ive had a look like i always do, but seing as the wiki doesnt even list the lua commands for ray casting (nevermind examples) its a bit of a guessing game. Hence im now here. Im a little confused about what you mean by the documentation sub forum, i cant find any lua collision or ray casting examples in the documentation, but i might just not being seeing it?? Thanks Andy
-
lol, that would be simple if i new exactly how, but as stated in my first post, i cant seem to get it to work? (was looking for maybe an example) Thanks Andy
-
Hi, im struggerling with getting the collision callback for a single entity and lua? Ive tried both ways, using the colision callback and also raycasting. Raycasting would be my preffered way as i would prefer to know if the entity is wihin a certain distance fromthe terrain directly below. How do i go about doing this? Thanks Andy
-
Josh, i posted just before you saying it seems to work if i Scale the force with AppSpeed()? Andy
-
Josh, im sure your right, if i scale the final force by AppSpeed() then it seems to work correctly? Andy
-
ahh right, ok. Any chance of it being looked at? I have spent hours and hours trying to get my code to work until i finally figured this out, and now of course im stuck without being able to do anything. Thanks Andy
-
Ok, so wen you say somthing funny is going on there, is that somthing funny thats needs to be fixed by me in my code or a bug? If so how do i make it not do this? Andy
-
Yes, but your not understanding the problem?? If you watch the 2nd video, it shows that when the object is below the camera, the force to keep the object bobbing up and down is about 80, but when above the camera the force is only about 20? Yet i have changed nothing, this is causing massive issues with forces? How can the force to appose gravity be one value when its below the camera and a completly different value when above the camera? Andy
-
Surely this needs looking at? Josh, any chance of an answer to what might be going on here? Thanks Andy
-
Here is the code for the above. (Lua) require("Scripts/constants/engine_const.lua") RegisterAbstractPath("") Graphics(800,600) fw = CreateFramework() camera = fw.main.camera camera:SetPosition(Vec3(0,10,10)) scene = LoadScene("abstract::ADDSCENE.sbx") MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) HideMouse(1) camrotation = Vec3(0) --box box = CreateBodyBox(1,1,1) box:SetPosition(Vec3(0,7,0)) box:SetMass(1) box:SetCollisionType(1) boxv = CreateCube() boxv:SetParent(box) box:SetFriction(0,0) box:SetDamping(50,1) Collisions(1,1,1) DebugPhysics(1) temp_up = 0 while KeyHit(KEY_ESCAPE)==0 do camera:Point(box,0,1,1) --move camera move = KeyDown(KEY_W) - KeyDown(KEY_S) strafe = KeyDown(KEY_D) - KeyDown(KEY_A) camera:Move(Vec3(strafe/2,0,move/2),1) --body inputs pitch = Curve(KeyDown(KEY_UP) - KeyDown(KEY_DOWN),forward,1) roll = Curve(KeyDown(KEY_LEFT) - KeyDown(KEY_RIGHT),roll,1) yaw = KeyDown(KEY_Z) - KeyDown(KEY_X) if KeyDown(KEY_2) == 1 then temp_up = temp_up + 0.5 end if KeyDown(KEY_1) == 1 then temp_up = temp_up - 0.5 end upvec = TFormVector(Vec3(0,temp_up,0),nil,box) torque = Vec3(pitch*80,0,roll*80) force = upvec box:SetForce(force) box:SetTorque(torque) fw:Update() fw:Render() SetBlend(1) DrawText("KEEP AN EYE ON THIS VALUE: "..temp_up,10,20) DrawText("BOX UP FORCE: "..upvec.y,10,60) SetBlend(0) Flip(0) end