Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

6 Neutral

About Megalocerous

  • Rank

Profile Information

  • Gender
  • Location
    New York

Recent Profile Visitors

3,135 profile views
  1. Any tips for getting a handle on the GUI/Widget system? I feel like my Beach Roll remake is coming along well I just need to work on understanding the GUI

    1. aiaf


      this blog may help,

      or just experiment with the Scripts/Menu.lua.

  2. I think I fixed this by re-writing my player script differently and then using 2 different triggers. One that triggers the wind, one that disables it. Now when the player enters the "wind zone" they will be fighting against the force constantly and if they get pushed out of the zone they will stop having the force applied. Script.playerSpeed = 10.0 --float "Player Speed" Script.windForce = 20.0 --float "Wind Force" Script.windVector = Vec3(0,0,-1) --vec3 "Wind Vector" local isWindActivated = false function Script:Start() self.world = World:GetCurrent() self.isAlive = true -- Create camera self.camera = Camera:Create() -- self.camera:SetFOV(90) self.camera:SetProjectionMode(Camera.Orthographic) self.camera:SetZoom(50) --load the font self.font = Font:Load("Fonts/Ranchers-Regular.ttf",48) --update the camera self:UpdateCamera() end function Script:UpdateWorld() self:UpdateCamera() end function Script:UpdatePhysics() self:MovementInput() end function Script:UpdateCamera() self.camera:SetRotation(45, -35, 0) self.camera:SetPosition(self.entity:GetPosition().x, self.entity:GetPosition().y, self.entity:GetPosition().z) self.camera:Move(0, 0, -30) end function Script:MovementInput() local moveVector = Vec3() local window = Window:GetCurrent() if window:KeyDown(Key.W) then moveVector.z = 1 end if window:KeyDown(Key.S) then moveVector.z = -1 end if window:KeyDown(Key.A) then moveVector.x = -1 end if window:KeyDown(Key.D) then moveVector.x = 1 end local normalizedVector = moveVector:Normalize() * self.playerSpeed local vectorWithWind = (moveVector:Normalize() * self.playerSpeed) + (self.windVector * self.windForce) if isWindActivated then self.entity:AddForce(vectorWithWind) else self.entity:AddForce(normalizedVector) end end function Script:EnableWind()--in isWindActivated = true end function Script:Disable()--in isWindActivated = false end
  3. Just to follow up on this - This seems to work better in 4.5 then in 4.6. 4.6 seems to keep calling entity:AddForce() even after exiting the trigger zone, which I am guessing is not supposed to happen?
  4. Yeah I apologize I was working on it late last night and its possible that I over complicated it. That is similar to how the bounce block or bounce zone works, which is good on the initial collision. But for this I am thinking design wise that it will be a constant force added while you are inside the zone, but removing the force when you are outside of it. Just adding the force on collision like this doesn't check on exit and keeps applying it no? At least that is what seems to happen when I write it like that.
  5. First off - hello! It has been a while since I've used Leadwerks, but I have decided to install it again and actively use it. I figured the best way to remember how to use the engine would be to re-create my Beach Roll entry submitted for one of the summer jams a few years back, but make it less bad and add a lot of fun level design obstacles/features, updated camera view, actual game menu etc. So for most of this I have been creating scripts in lua and making them usable in flowgraph. This way I can just script what the object should do, then I can just wire it up in the level as its needed. The current issue I have is with creating a "Wind Zone" trigger script. Basically when the player rolls into the trigger, it should add force in a given direction based on the scripts force vector property. Then when the player leaves the trigger it should stop applying the force. I used the collision-enter-exit script from the wikidot to achieve this. The only problem is that when I move into the first zone, it applies the correct force, the second zone works properly, the third zone does...but then if I move back into any of the previous zones it will still apply the last zones force. Upon re-entering the same zone (after it applied the incorrect force the first time) it applies the right force. I'm sure it is either a logic issue or the way I am handling the variable for it, but I've attached a test project with a map and everything wired up in case anyone wanted to take a look. Thanks! WindZoneTest.zip
  6. Hoping to have my Summer Games entry submitted by the end of the week. Can't wait to see what everyone else submits.

  7. Thanks so much SGB! I completely overlooked that when I was reading through my script before. It is working fine now. Thanks again really appreciate it!
  8. Hey guys, Not sure if anyone can help me out. I have a weird issue right now where the running animation for the character I am using does not play when I am running to the right. However the idle animation seems to run no matter which direction I am facing. Script.movespeed = 5 --float Script.cameradistance = 40 --float Script.camerazoom = 8 --float Script.orthographicseffect = 1 --float "Flatness" Script.camerarange = 10 --float Script.jump = 15 --int Script.ismoving = false --bool Script.isjumping = false --bool --Animation variables Script.animationspeed = 1.0 --float Script.idlesequence = 0 --int Script.runsequence = 0 --int Script.jumpsequence = 0 --int function Script:Start() self.playerangle = -90.0 self.camera = Camera:Create() self.entity:SetPhysicsMode(Entity.CharacterPhysics) self.camera:SetRotation(0,0,0) self.camera:SetZoom(self.camerazoom*self.orthographicseffect) self.camera:SetRange(self.cameradistance*self.orthographicseffect-self.camerarange, self.cameradistance*self.orthographicseffect+self.camerarange) if self.entity:GetMass() == 0 then self.entity:SetMass(10) end end function Script:UpdateWorld() --Update the camera self.camera:SetPosition(self.entity:GetPosition()) self.camera:Move(0,1.8/2,-self.cameradistance*self.orthographicseffect) end function Script:UpdatePhysics() local window = Window:GetCurrent() local move = 0 local jump = 0 --Set the players direction if they move left or right if window:KeyDown(Key.D) then self.playerangle = -90.0 self.ismoving = true move = move - self.movespeed else self.ismoving = false end if window:KeyDown(Key.A) then self.playerangle = 90.0 self.ismoving = true move = move - self.movespeed else self.ismoving = false end --Set the players jump if space is hit if window:KeyHit(Key.Space) then jump = self.jump end self.entity:SetInput(self.playerangle,move,0,jump,false,1.0,1.0,true) end function Script:Draw() local t = Time:GetCurrent() if self.ismoving == true then self.entity:SetAnimationFrame(t/100.0*self.animationspeed,1,self.runsequence) elseif self.ismoving == false then self.entity:SetAnimationFrame(t/100.0*self.animationspeed,1,self.idlesequence) end end
  9. Though I totally would buy a Leadwerks shirt...
  10. Yes, now I just need to put something on the launcher that is not a marble game rip off
  11. I just published another update to it. The problem was before it was not even showing up in the list for the games launcher. Now it seems to be there again.
  12. Yes I just played the Asteroids game with it. Worked very well! Now if I could only try it with my game right now! lol
  13. I was just curious if it is possible to get the steam controller to work with the games being played in the game launcher or if that was reserved for the green lit games.
  • Create New...