Jump to content

mdgunn

Members
  • Posts

    626
  • Joined

  • Last visited

Everything posted by mdgunn

  1. Try the below. You need more commands to further reset physics otherwise the item will retain some physics behaviour, so if moving fast will go back to position you want but will bounce away with previous velocity. Check the fps player script and how it handles dead body physics and also moving and putting down items. I think that might get you where you want? NOTE: I'm purposefully dropping object from small height to rule out any weirdness with physics starting intersecting already at start time. You may not need this but felt best to try to avoid this in the test. Script.startPos = nil Script.atStart = true function Script:Start() self.startPos = self.entity:GetPosition(true) System:Print("pos x="..self.startPos.x.." y="..self.startPos.y.." z="..self.startPos.z) end function Script:UpdateWorld() local window = Window:GetCurrent() if window:KeyDown(Key.K) and self.atStart == true then self.atStart = false self.entity:SetCollisionType(Collision.Prop) System:Print("KEY K HIT - MOVE TO END") self.entity:SetPosition(self.startPos.x + 1, self.startPos.y, self.startPos.z, true) end if window:KeyDown(Key.L) and self.atStart == false then self.atStart = true self.entity:SetCollisionType(Collision.Prop) System:Print("KEY L HIT - MOVE BACK") self.entity:SetPosition(self.startPos.x, self.startPos.y, self.startPos.z, true) end end
  2. Right so also for non-prefabs. OK. Have you tried different ways of trying to reset physics at run-time. I am fairly sure I've seen a standard script (maybe related to FPS controller, or projectiles) which seemed to do something odd like set the physics mode to one setting, set it to another mode, then back to the other as if trying to force a reset or re-evaluation of physics. I think there are also some commands you can use to try to reset things but I forget which. One other thing SetDebugPhysicsMode(true) on camera might show something but you've probably already tried that.
  3. Example: https://www.leadwerks.com/learn?page=API-Reference_Object_Joint_SetTargetPosition I consider missing examples not suggestions for improvements but in severity more like a bug (hence bug report) when ease of use is a primary marketing feature.
  4. Camera:SetDebugPhysicsMode() not documented in online help. Going to probably post some further similar posts for undocumented functions and examples.
  5. EDIT: The behaviour below I think is just me being silly. Only 1 moving because it used up the key hit event. Need some sort of state involved instead and using KeyDown so multiple key events (or use other methods). I tried making my cube with script a prefab and placing 3 on screen. All 3 remain where I set them with a joint in operation(I can tell as I can rotate them around a bit but they are fixed at the spot). HOWEVER, only the last one placed - actually responds to key presses to move it. I don't fully understand why the rest don't - maybe bad logic in my script or maybe it relates to duplicated prefabs not being full instances. I realise this still isn't what you want but thought I'd point out the strange behaviour of the proposed Kinematic solution.
  6. Just wondering.... after loading your prefab in code have you tried instancing it rather than setting the prefab? May seem wrong to have 2 'large' objects in memory but if I think due to the way instancing works it's probably the same memory. You may need to turn of all the things you can so that the prefab version is essentially inert (hidden, not reacting to physics etc.). You may also be able to remove the original prefab and retain the instance. Not tested this but it may be when instanced things become clearer. May seem strange this but I think prefabs are not QUITE the same as an instance. For example, I'm fairly sure that the prefab has an empty name attribute even if it's editor prefab has one (the name field in editor), but an instance of the prefab with a name set will have this when tested in code. I think it was some time since I tested that but I think that a prefab and an instance may not be 100% as you might expect them to be.
  7. Yeah I did think that this was NOT what you ultimately wanted. I was actually not expecting the object to move 'slowly' like that either. Thought with that simple set-up it would actually just go there, more like you want. Still I can see where this nice simple movement might be a nice thing. I have had some funny behavior with prefabs in the past. I think these issues went away when I made them full instances (e.g. tweak the prefab in the editor to make it become instance). For you though this is not what you want due to dynamic nature of the dungeon building. A few suggestions of things you've PROBABLY ALREADY TRIED:- a) use System:Print out some position properties at key points b) use some debugging child objects to see if it helps understand things. c) Make sure you're clear on when setting getting values with global or local coordinates d) Always have the origin of your entity centered in the prefab (0,0,0 - or sitting on floor at 0,0,0) By b) I mean that recently while trying to understand some strangeness in editor vs running game I created some Model:Spheres as extra child objects in prefabs script at positions to help understand if something was off with where I thought the position of things were compared to where they actually appeared to be. I feel your pain. Sometimes it feels to me like prefabs are an area where things work out well in a demo/test scenario but when you try to use them in a non-demo project things sometimes feel like they are working against you. Workflow is not quite right it feels to me if you are developing original assets from 'white box' prefabs. If I get a chance I'll see if I can take a look at and make any sense of your actual problem which really seems to relate to PREFABS which I agree isn't the setup I was showing.
  8. To be clear I'm not saying there is any problem here I am just providing example with reason for the previous attempt not working - being that mass of 10 probably too great. Just saying that it can be a bit hard to know where issues are and I think there is no example in docs of Kinematic joint.
  9. See attached files. I prefer editor examples than pure code examples as I personally I like to be sure it works in editor. Very standard scene CSG cube in air. Attach the joint.lua to the CSG cube in the air in the start map. Need a scene with FPS controller so FPS template is required as starter before copying the files in to avoid issues. start.map Joint.lua
  10. Try.... -- entity is a 128x128x128 editor unit cube in air at 0,312.0,0 -- physics mode = 'rigid body', collision type = 'prop', mass = 1 -- with mass of 3 object will 'struggle' into position. With mass 4 object will move down to end position but not back up. Script.startPos = nil Script.joint = nil function Script:Start() self.startPos = self.entity:GetPosition(true) System:Print("pos x="..self.startPos.x.." y="..self.startPos.y.." z="..self.startPos.z) self.joint = Joint:Kinematic(self.startPos.x, self.startPos.y, self.startPos.z, self.entity) self.joint:SetFriction(1) end function Script:UpdateWorld() local window = Window:GetCurrent() if window:KeyHit(Key.K) then System:Print("KEY K HIT - MOVE TO END") self.joint:SetTargetPosition(self.startPos.x, 2, self.startPos.z, 1) end if window:KeyHit(Key.L) then System:Print("KEY L HIT - MOVE BACK") self.joint:SetTargetPosition(self.startPos.x, self.startPos.y, self.startPos.z, 1) end end Kinda frustratingly the end result is dependent on the mass so can appear not to work at all. Maybe this is dead obvious if you are familiar with physics engine problems (not me). Set the mass to 1 or anything up to about 3 and you'll probably find it moves. Above 5 and my test CSG cube would actually drop to ground from start position it it was in air and was too heavy to lift. Mass of 4 made it stay in position (in the air) but could not move it to second destination. This is probably one of these things where if you understand what the 'hidden parameters' of the system are then it makes some sense but for someone not in the know is rather frustrating to figure out I reckon.
  11. Maybe you need to publish it from being a draft or something.
  12. Tried download again. Still no go. Here is the message I get. Same error in Chrome and Firefox. Could just be me, but not sure why that would be. Sorry, there is a problem This attachment is not available. It may have been removed or the person who shared it may not have permission to share it to this location. Error code: 2C171/1
  13. This sounds super interesting. Getting an error trying to download the demo though.
  14. Can confirm working fine for me now (AMD R51600X CPU + RX480 GPU).
  15. mdgunn

    Luawerks Updated

    Nice to see you are still working on it. I hope to get back into it again soon. Thanks!
  16. I know this is just a test but I couldn't help imagining whoever maintains the pipes thinking 'why did they use twice as much pipe to get down a straight corridor?'
  17. Could be good for this situation yes. The flowgraph lack some simple features that would help you keep a good view of what is going on, lacking ability to add user notes or groups that you could collapse to hide complexity, but for small projects it could be a good way to hook things up in a UI and keep you out of the code for some of the time.
  18. It allows you to link together function calls into or out of entity scripts in one to many or many to one relationships most often between unrelated objects which have no knowledge of the other object. E.g. a generic switch and a door. You can also pass values though this is not well documented and technically unofficial (so subject to possible removal). If you change an script I think it can break the flowgraph link and you have to link them back up, so works best on stable objects that may have been authored to have these open interfaces e.g. workshop items. My feeling is that a good few users find them to eventually be limiting and find other ways of doing a similar things. E.g. objects gaining references to other objects (e.g. via collisions) and testing objects via existience of expected functions or properties in the scripts. In some respects (I think?) they are a bit like a super simple Unreal engine blueprint graph though I think they probably lack the depth and robustness. These are just my own vague opinions.
  19. mdgunn

    toLua++

    Trying to download generates an error. <Error> <Code>SignatureDoesNotMatch</Code> <Message> The request signature we calculated does not match the signature you provided. Check your key and signing method. </Message> <AWSAccessKeyId>AKIAIRI2QHILYHOWCIEA</AWSAccessKeyId> <StringToSign> AWS4-HMAC-SHA256 20180813T082032Z 20180813/us-east-2/s3/aws4_request f4c3e165ee25c27d798e03c7825e9b536aefcde05083600828a513175ed5170e </StringToSign> <SignatureProvided> c746ca6e3e49ec2fc0913d91e61fa4def374a59eab035594cd00c512cf58468e </SignatureProvided> <StringToSignBytes> 41 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 0a 32 30 31 38 30 38 31 33 54 30 38 32 30 33 32 5a 0a 32 30 31 38 30 38 31 33 2f 75 73 2d 65 61 73 74 2d 32 2f 73 33 2f 61 77 73 34 5f 72 65 71 75 65 73 74 0a 66 34 63 33 65 31 36 35 65 65 32 35 63 32 37 64 37 39 38 65 30 33 63 37 38 32 35 65 39 62 35 33 36 61 65 66 63 64 65 30 35 30 38 33 36 30 30 38 32 38 61 35 31 33 31 37 35 65 64 35 31 37 30 65 </StringToSignBytes> <CanonicalRequest> GET /leadwerksstorage/monthly_01_2017/tolua%20%20.zip.a4f89778b65aae2f8c8d170cca36d27c X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAIRI2QHILYHOWCIEA%2F20180813%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20180813T082032Z&X-Amz-Expires=1200&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%2A%3DUTF-8%27%27tolua%252B%252B.zip&response-content-type=application%2Fzip%3Bcharset%3DUTF-8 host:s3.us-east-2.amazonaws.com host UNSIGNED-PAYLOAD </CanonicalRequest> <CanonicalRequestBytes> 47 45 54 0a 2f 6c 65 61 64 77 65 72 6b 73 73 74 6f 72 61 67 65 2f 6d 6f 6e 74 68 6c 79 5f 30 31 5f 32 30 31 37 2f 74 6f 6c 75 61 25 32 30 25 32 30 2e 7a 69 70 2e 61 34 66 38 39 37 37 38 62 36 35 61 61 65 32 66 38 63 38 64 31 37 30 63 63 61 33 36 64 32 37 63 0a 58 2d 41 6d 7a 2d 41 6c 67 6f 72 69 74 68 6d 3d 41 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 26 58 2d 41 6d 7a 2d 43 6f 6e 74 65 6e 74 2d 53 68 61 32 35 36 3d 55 4e 53 49 47 4e 45 44 2d 50 41 59 4c 4f 41 44 26 58 2d 41 6d 7a 2d 43 72 65 64 65 6e 74 69 61 6c 3d 41 4b 49 41 49 52 49 32 51 48 49 4c 59 48 4f 57 43 49 45 41 25 32 46 32 30 31 38 30 38 31 33 25 32 46 75 73 2d 65 61 73 74 2d 32 25 32 46 73 33 25 32 46 61 77 73 34 5f 72 65 71 75 65 73 74 26 58 2d 41 6d 7a 2d 44 61 74 65 3d 32 30 31 38 30 38 31 33 54 30 38 32 30 33 32 5a 26 58 2d 41 6d 7a 2d 45 78 70 69 72 65 73 3d 31 32 30 30 26 58 2d 41 6d 7a 2d 53 69 67 6e 65 64 48 65 61 64 65 72 73 3d 68 6f 73 74 26 72 65 73 70 6f 6e 73 65 2d 63 6f 6e 74 65 6e 74 2d 64 69 73 70 6f 73 69 74 69 6f 6e 3d 61 74 74 61 63 68 6d 65 6e 74 25 33 42 25 32 30 66 69 6c 65 6e 61 6d 65 25 32 41 25 33 44 55 54 46 2d 38 25 32 37 25 32 37 74 6f 6c 75 61 25 32 35 32 42 25 32 35 32 42 2e 7a 69 70 26 72 65 73 70 6f 6e 73 65 2d 63 6f 6e 74 65 6e 74 2d 74 79 70 65 3d 61 70 70 6c 69 63 61 74 69 6f 6e 25 32 46 7a 69 70 25 33 42 63 68 61 72 73 65 74 25 33 44 55 54 46 2d 38 0a 68 6f 73 74 3a 73 33 2e 75 73 2d 65 61 73 74 2d 32 2e 61 6d 61 7a 6f 6e 61 77 73 2e 63 6f 6d 0a 0a 68 6f 73 74 0a 55 4e 53 49 47 4e 45 44 2d 50 41 59 4c 4f 41 44 </CanonicalRequestBytes> <RequestId>A7A96404F58D6C89</RequestId> <HostId> Hd0gr5WqoOV/bPOIBrzjsZYWUZhvqT7YDwsFk+auc6p5D7u2v1/oc6BSR8mfJxGjlLhniW2KQiU= </HostId> </Error>
  20. Posted my submission. As always with my stuff, there's a few bugs so will try to upload an update in the next day or 2.
  21. Needs 1 or more ways to find sale items. OK to have some in rotator but I think it only shows some. I can pretty much guarantee that if I ever go to the shop I will specifically look at sale items as a priority. If I can get 2 items for the same cost as 1 then this equates to double time saved (sort of)....it's not just because I'm a cheapskate!
  22. For what it's worth. I suggested slight improvements to model import some time ago. No official comments against it. https://www.leadwerks.com/community/topic/16622-make-model-importre-import-more-efficientless-painful/
  23. I think Nightmare Prism has some volumetric lighting turned on in parts. This can really tank FPS due to the way it works so should usually be reserved for very limited use. In a release game you'd maybe come up with a much lower cost alternative and have different graphics levels but in game jam games there's a temptation to turn it on, knowing that in a simple looking game the majority of people probably have the graphics horsepower left to take the hit. Leadwerks can be pretty effective for developing on a lower spec machine as long as you work on isolated game chunks and avoid trying to run final unoptimsed levels when really you're just testing a game mechanic (create super simple test levels). Some things can be hard to run effectively on low end graphics (e.g. terrain sculpting and building up natural outdoor environments) I've had a couple of things not work on low end graphics, e.g. real time texture from camera (for a portal) but in general things work pretty well. A more powerful graphics card will make development quicker and smoother in general but it's not a necessity if you keep your ambitions reasonably small to start with and build from there.
  24. Curious what the jarring stems from? Is it the game page 'title screen' looks like it's going to be grim horror but in the end it's just balloons? In a number of respects the final result is in line with the major game mechanics I'd planned (an on rails roller-coaster shooter) but theme and environment wise it's a long way short. My point of reference was Rush of Blood on PS VR. I wanted something that could potentially be turned into VR later, without me having to have this as a potential extra set of issues now. I think I only started putting the actual final game level together the day before submission at which point I decided to ditch or disable almost everything I'd done so far to get a playable level for now. Rather than not submit, which was a real possibility thought I'd submit anyway. I always seem to leave it too late to put together a satisfying complete final level reflecting what I had hoped for, which unfortunately DOES negatively impact the final game. Thanks for checking it out guys.
  25. My submission: The usual last minute scramble for time left me with not what I was aiming for and much to improve. Still, had fun trying.
×
×
  • Create New...