Jump to content

AggrorJorn

Members
  • Posts

    4,816
  • Joined

  • Last visited

Everything posted by AggrorJorn

  1. This information used to be in the documentation btw. I would expect a find the variable 'entities' here somewhere: https://www.leadwerks.com/learn?page=API-Reference_Object_World
  2. This is something I have always found kinda odd when working with C++. I would have this massive switch/case list to get certain entities from my scene. Somehow that feels clunky. But even if there were an official function for this, it would probably do something similar in the background.
  3. I haven't tried it myself but it might be in a different template. What template did you select when creating your project? If you have chosen blank project, then it is not included. Look for a template that contains the VR/player model. Create a new project and just copy the models from there to your existing project.
  4. Can you confirm that the teleport.pfb exists in the required location of your project? So yourproject\models\vr\
  5. That actually makes sense. Never realized this. A small preview window of what that camera is looking at would be nice too. Lets hope Le5 will have this.
  6. If your coins don't need to interact with physics once they are moving towards you and you don't want them to rotate towards the player you can move them like this: --UpdateWorld local velocity = (playerPos - coinPos):Normalize() * self.coinMoveSpeed * Time:GetSpeed() local newCoinPos = coinPos + velocity; coin:SetPosition(newCoinPos)
  7. I have been working on some new features for the SplineTools package for Leadwerks. In the video below I demonstrate 2 new features Reverse spline followers: Reverse any spline follower at any given time on the spline. Just call the Reverse() function on a spline follower and enjoy the ride. Closest point on the spline: helper functions that can check what the closest point on a spline is based on given position.
  8. I have a similar situation with camera min/max angles where this works fine. For camera rotation the max angle is actually negative (although the name would suggest otherwise). Based on your if statements and the inversed use of max/min zoom, I figured that for the zooming something similar would be happening.
  9. Nice script GorzenDev. That would be a nice addition to the documentation samples. Little side note: if self.curZoom < self.maxZoom then self.curZoom = self.maxZoom elseif self.curZoom > self.minZoom then self.curZoom = self.minZoom end could be shortened to self.curZoom = Math:Clamp(self.curZoom, self.maxZoom, self.minZoom)
  10. The Z index from MousePosition stores the mouse wheel. https://www.leadwerks.com/learn?page=API-Reference_Object_Window_GetMousePosition
  11. You would have to write your settings/save data to a file. This could be any kind of file. For instance like savegame.json or .xml. --Load the save game file local path = "mysavegame.data" local stream = FileSystem:WriteFile(path) if (stream==nil) then Debug:Error("Failed to write save game.") end --Write save game data stream:WriteLine("LevelFinished:1") stream:Release() --Load the save game stream = FileSystem:ReadFile(path) if (stream==nil)then Debug:Error("Failed to read file.") end --Loop over save game lines while (not stream:EOF()) do System:Print(stream:ReadLine()) end stream:Release()
  12. On page: https://www.leadwerks.com/learn?page=API-Reference_Object_Math_Vec3 The Length function has a lower case 'l' instead of capital 'L'. This causes the link to go to the wrong url. Change https://www.leadwerks.com/learn?page=API-Reference_Object_Math_Vec3_length to https://www.leadwerks.com/learn?page=API-Reference_Object_Math_Vec3_Length
  13. Yeah', I can;t wait for the Leadwerks 5 plugins, were I could just have a wire edit mode, click in your scene and instantly see your wire or road created. For now we will have to make do with what we got. You could try set the amount of sides to 2, and for the material you could use tileable chains with transparency. I am not sure whether this would all perfectly align. Multiple splines won't entirely connect yet. Let me know how that goes, maybe it is something that can be added to the todo list.
  14. Now that the steam updating works again, the Spline Tools 1.04 package has been uploaded on Steam. Update 1.04 This version contains some updated maps for Leadwerks 4.5. The moving platforms map unfortunately is not working properly and will have to be sorted out. Wire splines added. Wire splines can be used for creating wires, cables or rope. By default, wires have no physics. Physics can be added as static shapes by selecting the wire type. There is also an experimental dynamic wire type which creates joint for all rope segments. Doesn't work properly yet but is fun to play around with. Wires require some more work, like attach multiple splines geometry but I didn't want to wait any longer. Map added: "Wire - Electric poles.map". Demonstrates wire splines with no physics and static physics. Map added: "Wire - Tireswing.map". Demonstrates the experimental dynamic splines that uses joints for movable wires. Todo list Reversed spline travel for spline followers Ease in and out for spline followers Rivers Improving the ropes
  15. The Steam update problem seems to have been resolved. Topic can be closed.
  16. There is a default menu in pretty much every project. Press escape when you run your game and you should see it appear. have a look at the main.lua.
  17. Maybe the mass is too low? For the ropes I use a mass of 10.
  18. It is really great to see that people are still making use of these tutorials, even though they are a bit outdated. The problem lies in the Collision function. Th 4th parameter is speed. When you print out the value to the screen you will see that it is 0 and therefor not afflicting damage to the player. function Script:Collision(entity,position,normal,speed) System:Print("speed:" ..speed) if speed>20 and entity:GetKeyValue("name") ~= "DeathTrigger" then self:Hurt(100) end end Obiously the speed value should not be 0. This does seem like a bug imo. Maybe something that slipped in with 4.5. I tried the same map with the beta version and the problem persists. This can be a good bug report.
  19. You could make an EnterExit trigger. Not sure if you are using Lua, but you could be doing something similar in C++. Script.enabled = true Script.entered = false Script.exited = false Script.collided = false function Script:UpdatePhysics() if self.enabled then if self.entered then if self.collided == false then System:Print("Exiting the trigger") self.exited = true self.entered = false end end self.collided = false end end function Script:Collision(entity, position, normal, speed) if self.enabled then self.collided = true if self.entered == false then System:Print("Entered the trigger") self.entered = true self.exited = false end end end
  20. Flush the keys to get the desired effect: https://www.leadwerks.com/learn?page=API-Reference_Object_Window_FlushKeys. Also be aware of Keyhit for the same key being stored in a single frame. That means of 2 frames us KeyHit for the Spacebar, only one script will have the spacebar set to true(pressed). *edit: just read the topic you were refering to. So this solution might not work for you. https://www.leadwerks.com/community/topic/15185-windowkeyhit-strange-problem/?tab=comments#comment-102329
  21. I really doubt that, but feel free to shoot in a suggestion. I know Josh uses subversion himself. Would be even better to have map support that you can merge.
  22. To be honest I have had this problem too, but that was years ago when I did a lot of CSG brush creation. These days I just create a brush without looking to the actual measurements. Still, if you are able to record it (OBS) we can see if there is something wrong.
  23. Can you record a video maybe? Fyi, you can also change the grid size of the active viewport with [ and ].
  24. Ah I see what you mean. The option to check out files works regardless of software you are using btw. Subversion and TeamFoundationService do the same thing. Leadwerks .map files are binary files which makes them impossible files to merge with text editors/mergers. If you use Git you can not exclusively checkout files, but work with local copies and having to to merge with an existing branch.
  25. Sorry I don't understand what you mean by that.
×
×
  • Create New...