Jump to content

Megalocerous

Developers
  • Posts

    23
  • Joined

  • Last visited

Everything posted by Megalocerous

  1. 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
  2. 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?
  3. 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.
  4. 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
  5. 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!
  6. 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
  7. Though I totally would buy a Leadwerks shirt...
  8. Yes, now I just need to put something on the launcher that is not a marble game rip off
  9. 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.
  10. 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
  11. 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.
  12. Yeah that's it. Beach Roll. I was trying to play it via the launcher but did not see it listed. I see the change notes from the update I published yesterday listed so I thought it went through no problem.
  13. It seems I published and update to my summer games tournament entry and now it has disappeared from Steam? Did I mess something up on my end?
  14. Oh man I can't wait for this to be released!
  15. Congrats to everyone who submitted games. I am looking forward to playing through all of the entries.
  16. Here is our entry for the Leadwerks Summer Games Tournament...Beach Roll! As stated it is a just a small variation on the Marble Game Tutorial that Leadwerks provides. Our small four person team works under the name Aphelion Games and we were previously working on a 2D platformer prototype in Unity. However after some delays and that project losing a bit of momentum we decided that we needed to shake things up and get some of our enthusiasm back. I had previously purchased the Leadwerks engine but never really tried to create anything with it. So after a period of not using it I decided to re-download the engine and check out the website. That is when I noticed the Summer Games Tournament was taking place and realized this is just what we needed to get our creative spark back. So while we did not create anything groundbreaking, I can say that we did have a ton of fun throughout these last couple of weeks. With the help of the free Summer Assets pack as well as some other workshop items we were able to create a small game consisting of 5 levels. The major changes are camera control (using Q and E to change the rotation), and being able to bounce on the top of the beach umbrellas. There was a lot more that we wanted to add, and we plan on updating the game over the next couple of weeks to gain more experience with Leadwerks. After that we will be starting our next game project in Leadwerks, so look for more updates to come on that. The Aphelion Games team includes John (me), Leo, Ashley and Robert. Thanks for reading!
  17. Easiest thing to do after finishing one of the Leadwerks tutorials (in my opinion anyway) is to take the template that you have just completed, and try to make small additions. This is part of what I am working on for the Summer Games Tournament, it is simple but it is helping me really get my feet wet with the engine. Now that you have the marble game template, what other small gameplay elements could you create that would enhance the game? (Moving platform, jump etc...) Then design new levels around the new mechanic.
  18. I was not using the FPS prefab Thirsty, but for the time being I think I figured it out. I am using Window:SetLayout to change the window that is created from the editor to what I want. I am still not sure if this is the correct solution but I will try it again with Window:Create later. Whenever I use Window:Create it doesn't seem to render the world that I have created in the editor. So I believe somewhere I am missing something really dumb on my end (wouldn't be the first or the last time )
  19. Initially I just had the camera added in my scene, then used Window:Create but I don't believe that worked. Then I deleted the camera from the scene and used Window:Create and created a camera via code, but now I had two completely black windows. I am assuming I need to also create a light in my code now since it is not using the light that I added through the editor itself? Sorry if I am not making any sense, but I really appreciate all your help thus far cassius!
  20. Yeah I have something similar in lua, it just shows a black screen. If I am calling Window:Create I am guessing I need to create the light through code as well right? Right now I have one in the editor but it does not seem like it is applying that to the Window:Create scene. Unfortunately I can't test right now. I'm at my soul destroying full time job
  21. Thanks cassius! I will mess with it more later tonight. Last night I had the window drawn through Window:Create but it wasn't showing anything other than a black screen. I'm obviously doing something wrong so I will keep plugging away until it's fixed. Thanks again!
  22. Hello everyone! I am new here and come from using Unity and UDK previously. I purchased this engine quite some time ago but never got far with it. However I have returned to give it another shot over the last few weeks and have really been enjoying it. I am hoping to have a simple game submitted for the Summer Games tournament and then roll into my next project from there. Now that my brief introduction is over... I just had a quick question in regards to creating a window. It seems that if I am not using windows create and I test my level I only have one window created. Using Window:Create will create two windows, one in the background and the one that I have created. Is there anyway to have just one window created? Is this just something that happens when using the editor? If I compile it to an exe will it just be the one window? Sorry if this was answered somewhere already, I've been messing around with it for the last couple of days and figured it was time to log on and ask. Thanks in advance!
×
×
  • Create New...