Jump to content

Einlander

Members
  • Posts

    778
  • Joined

  • Last visited

Posts posted by Einlander

  1. Collisions in Leadwerks EXCEPT for character collisions will tend to ignore collision triggers unless swept collision is turned on. If you turn on swept collision, and programatically move the object, all collision types except for character will detect the first trigger, move to the second, fall and then detect that it is in a trigger.

     

    Sadly I don't have a map ready to test on.

     

    Video

     

  2. There were some things that were missing from the platform.lua that I have added. It is commented with what I changed.

     

    Basically what happened is if you start disabled or disable it in game, The script set the platforms mass to 0. When you enabled it it did not restore the original mass causing it to not move. The fix was to restore the original mass to the entity when enabled AND you have to give it a little push to get it moving again.

     

    Script.enabled = true --bool "Enabled"
    Script.speed  = 10 --float "Speed"
    Script.target = "" --entity "Target waypoint"
    Script.originPosition = nil
    Script.targetPosition = nil
    Script.currentPosition = nil
    Script.currentRotation = nil
    Script.moving = nil
    Script.oldMass = nil
    function Script:Start()
    self.originalrotation = self.entity:GetRotation()
    self.oldMass = self.entity:GetMass()
    if self.entity:GetShadowMode()>0 then
     self.entity:SetShadowMode(2)--Light.Dynamic
    end
    if self.enabled then
     if self.entity:GetMass()==0 then
      Debug:Error("Entity mass must be greater than zero.")
     end
    else
     self.entity:SetMass(0) -- !! BEWARE !! this will cause the platform to not work even if you set self.enabled back to true [FIXED later in code: Einlander]
    end
    self.entity:SetGravityMode(false) 
    self.entity:SetCollisionType(Collision.Scene)
    if self.target == nil then
     Debug:Error("No target assigned")
    end
    
    self:SetTarget(self.target)
    end
    function Script:SetTarget(newTarget)
    self.currentPosition = self.entity:GetPosition()
    self.originPosition = self.entity:GetPosition()
    self.targetPosition = newTarget:GetPosition()
    --self.distance = self.originPosition:DistanceToPoint(self.targetPosition)
    self.target = newTarget
    
    local pos = self.entity:GetPosition(true)
    local targetpos = self.target:GetPosition(true)
    local pin = pos - targetpos
    self.distance = pin:Length()
    pin = pin:Normalize()
    
    if self.joint then
     self.joint:DisableMotor()
     self.joint:Release()
    end
    self.joint=Joint:Slider(targetpos.x,targetpos.y,targetpos.z,pin.x,pin.y,pin.z,self.entity,nil)
    self.joint:EnableMotor()
    self.joint:SetMotorSpeed(self.speed)
    self.joint:SetAngle(-self.distance)
    end
    function Script:Enable()--in
    self.enabled = true
    self.entity:SetMass(self.oldMass) -- this line was missing [einlander]
    self.entity:AddForce(0,0.001,0) -- give it a tiny push to get it moving [einlander]
    end
    function Script:Disable()--in
    self.enabled = false
    self.entity:SetMass(0)
    end
    function Script:UpdatePhysics()
    if self.enabled then 
     --Calculate movement
     local currentpos = self.entity:GetPosition(true)
     local targetpos = self.target:GetPosition(true)
     local d = currentpos:DistanceToPoint(targetpos)
     if d<0.1 then
      --When the target has been reached
      --self.entity:PhysicsSetPosition(self.targetPosition.x, self.targetPosition.y, self.targetPosition.z)
      --self.enabled = false
      self.component:CallOutputs("WaypointReached")
      --Check if the target that we have reached also has a target, which is then our new target/waypoint
      if self.target.script.target ~= nil then
       self:SetTarget(self.target.script.target)
      end
     end
    else
     --self.entity:PhysicsSetPosition(self.currentPosition.x, self.currentPosition.y, self.currentPosition.z)
     --self.entity:PhysicsSetRotation(self.currentRotation.x, self.currentRotation.y, self.currentRotation.z)
    end
    end
    

    • Upvote 1
  3. I would like to use the game launcher to help coordinate my game project. I have a private project that I would like to let people on my friends list download and test. I can subscribe to a private project in the steam client, the client will download it, but the game launcher has no way of letting me know whats subscribed to and downloaded.

  4. That's pretty much the window init code, nothing cut out. I do have the self.title="Pump-Action Captain" right above it.

     

    I commented out:

    self.window = 0

    if System:GetProperty("fullscreen")=="1" then windowstyle=windowstyle+window.FullScreen end

     

    Will see if this helps, but it's almost like the person's pc doesn't support 1600x900 resolution?

     

    Thanks.

     

    1600x900 isn't a common resolution.

     

    Take a look at http://www.leadwerks.com/werkspace/page/api-reference/_/system/systemcountgraphicsmodes-r857

    That will count the resolutions that the computer has.

    And this will use one of those numbers to give you the actual resolution: http://www.leadwerks.com/werkspace/page/api-reference/_/system/systemcountgraphicsmodes-r857

  5. Haha, well said MS is indeed evolving much like LE is. We also have things come and go, actually the days of having a solid release are gone. Just look at games, how many patches/DLC's later they're playable? Back in the days it's either hit or miss, now with Steam and internet there is no point in making a well polished product. Shame though.

    True Olby. A day doesn't go by that I don't have a game automatically updated on steam. Now that updates are automatic and done behind the scenes and are generally unobtrusive to the gamer devs can get away with this kind of thing.

     

    I consider games and development tools 2 different things. Games need to be updated with new things and fixed as needed, it's expected. But that has risen to sloppy behavior on the part of game devs. Ship it broken and fix it in production seems to be the mantra now. And DLC for things that should have been in the game, or are already on the disc.

     

    Development tools to me are an entirely different class from games. People expect the tools to work reliably, predictably, and to be patched when needed. New features are a bonus. Leadwerks on the other hand Is always being updated, but you would be hard pressed to tell me what has changed, been fixed or optimized. I actually had to go make a list of notable changes. Changes to a developers tools have a greater affect than "fixing" a game. Every change affects how a developer approaches how they make a game. If a new change is to cumbersome, they may have to reinvent the wheel or abandon an approach. This last change with the drag and drop targets has caused me to create self registering pivots that report to a parent entity and a platform that navigates them. I should not have needed to do that.

     

    Beware of changing things for change or sake or because it's "easier", because sometimes it's not worth it.

  6. Not mad here either, just frustrated. For me it's the little bugs here and there that accumulate that you cant actually fix easily. I've basically stopped submitting bug reports because the some bugs just don't seem to be fixed (search for all my bug reports). Then to top it off, you start doing one thing today, and tomorrow its no longer a valid workflow.

     

    All I hope is Leadwerks doesn't fall into the trap of the dev doesn't like it this way, so the users MUST not like it either. Or, I never used it so others MUST not be using it either. A dev knows how they want their software to be used and how things are supposed to be done. A user isn't the dev, they need to learn to think like a dev. Opinionated software is what leads people to curse at thier computers when they see a clear connection but the software stops them from doing it.

    • Upvote 1
  7. I'm trying to recreate portals Areial Faith Plate. The faith plate has a constant velocity even with gravity in effect. In Leadwerks on the character controller there is allways drag unless you counteract it. So here is my question, How would I go about creating a launcher that would throw the player in a set arc at a constant velocity?

×
×
  • Create New...