Jump to content

Brutile

Members
  • Posts

    314
  • Joined

  • Last visited

Posts posted by Brutile

  1. I tried everything to fix this, but nothing worked. I created a test player entity with the same properties as my player and it worked. I was so confused. I ended up re-saving my player prefab to tweak some settings. Still nothing, so I deleted it and put the prefab back exactly how it was. THEN IT WORKED! It turned out to be some bug with Leadwerks, but unfortunately I have no idea how to replicate the bug.

  2. This is the full script

     

    Script.player = nil --Entity "Player"
    Script.enemyPath = "" --path "Enemy Prefab" "Prefab (*.pfb):pfb|Prefabs"
    Script.spawnRate = 5 --float "Initial Spawn Rate"
    Script.spawnVariation = 0.25 --float "Spawn Variation"
    Script.spawnAmount = 5 --int "Initial Spawn Amount"
    Script.spawnTimer = 0
    function Script:Start()
    self.spawnTimer = self.spawnRate
    end
    function Script:UpdateWorld()
    local deltaTime = (1.0 / Time:UPS())
    if self.spawnTimer <= 0 and self.spawnAmount > 0 then
     self.spawnTimer = self.spawnRate
     self.spawnAmount = self.spawnAmount - 1
     if self.enemyPath ~= "" then
      local prefab = Prefab:Load(self.enemyPath)
    
      if prefab ~= nil then
       if prefab.script ~= nil then
     if self.player ~= nil and self.player.script ~= nil then
      prefab.script.target = self.player.script
     end
    
     prefab:SetPosition(self.entity:GetPosition(true), true)
     prefab:SetRotation(self.entity:GetRotation(true), true)
       else
     prefab:Release()
       end
      end
     end
    else
     self.spawnTimer = self.spawnTimer - deltaTime
    end
    end
    

     

    It is an enemy spawner that spawns enemies and sets their target as the player. It tries to spawn an enemy and set the script after 5 seconds, so the player script is definitely being loaded first. I'm really not sure why this would happen

  3. I have a script that grabs the player entity as a value:

    Script.player = nil --Entity "Player"

    The player gets assigned in the scene properties.

     

    This succeeds:

    if self.player ~= nil then
    
    end

    But this doesn't:

     

    if self.player.script ~= nil then
    
    end

    The player definitely has a script, and I've accessed the script the same way by passing it directly. But using the properties panel to set the player, it doesn't work.

  4. I've also noticed this, even with relatively simple scenes. The rendering performance does leave a lot to be desired, even though there are a number of optimizations in the engine. Something just doesn't seem right.

     

    You can paint outside walls with the Caulk material. That way they are not rendered or have collision, but keep in mind, doing so may let light into rooms that shouldn't have light going into them.

  5. Just tried to do this myself but I keep messing up somewhere, could you show us an example of something simple?

     

    I tried to code up an example, but in doing do, I decided to just write an entire RTS camera that should do what you want it to do.

    You can get it here http://steamcommunity.com/sharedfiles/filedetails/?id=617085158

    (It may not be available yet, as I only just submitted it)

     

    Have a look at the script and see how to do it, or you may find that it does what you want it to do.

    If it is missing something, just let me know (As long as it's not too complicated)

    • Upvote 1
  6. That may be something I could help out with. What would it involve on my part? Would you be specializing in a specific area?

     

    I do work full time though, so would only be able to work on it a few hours a day.

  7. thanks for your reply it is set to zero in default fps .lua am i looking at the right line ?

     

    Not quite. You are sending the input to the character controller, but the character controller is automatically applying gravity and handling the velocity, so if you send 0 for the movement, you will still get gravity being applied. Calling

    self.entity:SetVelocity(Vec3(0)) 

    should do the trick, but as macklebee said, some physics commands don't work as expected with character physics. If this doesn't work, then you could try applying a very small jump amount to the character controller input. This may work to reset the velocity.

  8. The first one is tricky, but the second can be done fairly easily. I don't have access to Leadwerks right now, so I can't code anything that works, but I can try to explain it.

    1. Get your local forward movement direction, including the y axis

    2. Set y to 0

    3. Normalize your movement vector

    4. Multiply the vector by your movement speed

    5. Apply the movement

     

    If you don't understand what I'm trying to explain, just let me know and I'll whip up the code in about 8 or so hours.

    • Upvote 1
  9. My question is that the ppl judging the competition will be using (I am assuming) better computers. So, I want to know 1) if I burn all of the files that are created when I "publish" my game as a stand alone game along with the oalinst.exe file, will the judges be able to open my game? and, 2) if not, what other files should i include on the disk?

     

    As far as I know, you just need the installer and the openAL. Just make sure that the judges know that they need to install openAL.

    • Upvote 1
×
×
  • Create New...