Jump to content

Driklyn

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by Driklyn

  1. All I see is a "My Media" button, but it won't let me upload anything to it. I have no "Add Attachment" button or anything similar, even on "More Reply Options" page...
  2. Don't see a way for me to attach any files here, so I uploaded the map + scripts here: http://temp-share.com/show/Pf3m6A8W2
  3. Have a player created from a pivot added to my map via the editor with these physics properties set: Physics: Character Controller Mass: 1.0 Collision: Character And a floor underneath, a box with these physics properties set: Physics: Rigid Body Shape: Box Shape size: (Fit Shape) Mass: 0.0 Collision: Scene When running the game, the player falls a few feet and lands on top of the floor correctly. However, once I move in any direction or rotate greater than +/- 45º or so on the y-axis, the player instantly warps into the floor, moving from a y-position of 0.273252 to 0.001953. Any ideas why? Here's my player script: function Script:Start() self.camera = Camera:Create() self.camera:SetPosition(self.entity:GetPosition()) end function Script:Move() local w = window:KeyDown(Key.W) and 1 or 0 local a = window:KeyDown(Key.A) and 1 or 0 local s = window:KeyDown(Key.S) and 1 or 0 local d = window:KeyDown(Key.D) and 1 or 0 return Vec3(d - a, 0, w - s):Normalize() end function Script:Look() local mouse = window:GetMousePosition() local center = Vec2(context:GetWidth() / 2, context:GetHeight() / 2) window:SetMousePosition(center.x, center.y) return Vec3(mouse.y - center.y, mouse.x - center.x, 0) end function Script:UpdatePhysics() local move = self:Move() local look = self:Look() look = look + self.camera:GetRotation() look.x = Math:Clamp(look.x, -85, 85) self.entity:SetInput(look.y, move.z, move.x, move.y) self.camera:SetPosition(self.entity:GetPosition()) self.camera:SetRotation(look) end
  4. Nope. I'm actually running a fresh copy of Windows on my MacBook through Boot Camp. I just partitioned it on Saturday as well. Installed Windows just for Leadwerks, actually
  5. So I just installed the trial on Saturday. Today, when I went to open the editor, it said: "Sorry, but your 30-day trial has expired!" Huh?
  6. Perhaps try looking into Awesomium? It's a HTML UI engine. Never used it before myself, but it'll likely be the one I try next (since my day job is HTML/JavaScript). Looks extremely easy and powerful to use.
  7. Thank you, Josh. Finally got it working! (I had nearly exactly what you wrote before creating this topic, but I placed SetGlobal before PushObject.) bool App::Start() { // create window, context, world... int stacksize = Interpreter::GetStackSize(); Interpreter::PushObject(window); Interpreter::SetGlobal("window"); Interpreter::PushObject(context); Interpreter::SetGlobal("context"); Interpreter::PushObject(world); Interpreter::SetGlobal("world"); Interpreter::SetStackSize(stacksize); // load map, etc... } Then, from any script: function Script:Start() System:Print(context:GetWidth()) System:Print(context:GetHeight()) System:Print(world.gravity) -- prints 0x00000000 window:ShowMouse() end function Script:UpdateWorld() if window:KeyDown(Key.D) then System:Print("D down") end end This is awesome! And was much easier to do than expected... Only hiccup is that I couldn't seem to access any members of `world`, just its methods. I did, however, figure out you can do it this way instead: Interpreter::PushObject(&world->gravity); Interpreter::SetGlobal("worldGravity"); worldGravity.y = worldGravity.y * -1
  8. Yes, I realize this, but I'm not creating the window/world in a script, as is occurring when you start from a Lua project. I need to be able to access the already created window/world (in CPP) via a script. I was thinking I might need to use the `Interpreter` class, but I'm not entirely sure how to.
  9. Started with a CPP project, but using Lua for scripted objects. Need to be able to access things like: window->KeyDown window->SetMousePosition world->gravity ...from within the scripts themselves, even though they are defined in a CPP header file (App.h). How exactly do I access them?
×
×
  • Create New...