Jump to content

AggrorJorn

Members
  • Posts

    4,816
  • Joined

  • Last visited

Everything posted by AggrorJorn

  1. 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)
  2. 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.
  3. 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.
  4. 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)
  5. The Z index from MousePosition stores the mouse wheel. https://www.leadwerks.com/learn?page=API-Reference_Object_Window_GetMousePosition
  6. 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()
  7. 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.
  8. 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
  9. 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.
  10. 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
  11. 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
  12. 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.
  13. 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.
  14. Can you record a video maybe? Fyi, you can also change the grid size of the active viewport with [ and ].
  15. 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.
  16. Sorry I don't understand what you mean by that.
  17. Your item script is fine, although I would set the enabled/pickedup boolean to false. Because now, everytime you spawn the entity, it is emmidiatly 'picked up'. I would also rename this boolean to 'pickedUp' or something similar. Calling it 'enabled' could mean anything. I might have forgot the starting possibility. You want to spawn an item when: A: there is no entity spawned yet. B: an entity is spawned but not yet picked up. Try this line instead of the previous one: if self.spawn == nil or self.spawn.script.pickedUp then
  18. It looks somewhat similar to SVN so you are good to go. Just remember that map files can't be merged, but code files are no problem. Other version systems that works well are SVN, git and mercurial.
  19. The weapon shooting feels really nice. 1 tiny feedback point: the options menu shows the 'on' color as red and the 'off' color as green. Personally I would swap the colors.
  20. Sounds promising. Will try it out this weekend.
  21. Nice one Thirsty Panther. That is the one I meant.
  22. I remember a blog post when this option was introduced. I asked the question what would happen with entities loaded by code. The answer was something like "These are not included". But that blog was more than 1 or 2 years ago so things might have changed.
  23. I thank that is the way Leadwerks works. Or at least in the sense that Leadwerks doesn't scan your code to see what kind of files you load. For compiled C++ that would also be pretty difficult to do. It only exports files that are loaded/referenced in the editor
  24. Hi and welcome to the forum, To what files/ tutorials are you refering? For an introduction to lua and how to use it with the Leadwerks editor start here: https://www.leadwerks.com/learn?page=Tutorials_Lua-Scripting_Introduction-to-Lua Additionally you can watch videos :
  25. Do you have a script attached that manipulates rotation?
×
×
  • Create New...