Jump to content

thehankinator

Members
  • Posts

    436
  • Joined

  • Last visited

Everything posted by thehankinator

  1. Build and run it from Visual Studio in debug mode. The debugger should halt execution at or near where the problem is.
  2. I am not using probes so this should work great, thanks guys!
  3. I wrote a small helper for scheduling a callback after x milliseconds. It's been really useful for my AI scripts. It's not locked onto a specific time function so that you can create a timer that will not tick while the game is paused. If you are interested I'll post it but from the user end it looks something like this: function Script:UpdateWorld() if self.some_condition_met then TimeKeeper:Add(250, self.Dosomething, self, arg_val) end end function Script:Dosomething(arg) --do some work or whatever! end I've used it for periodic stuff also like this: function Script:Start() TimeKeeper:Add(250, self.Dosomething, self, arg_val) end function Script:Dosomething(arg) --do some work or whatever! TimeKeeper:Add(250, self.Dosomething, self, arg) end
  4. How can I make a material that is visible in the editor but not when the game is running? For use specifically for invisible triggers. I could change the material via a script but it would be nice if I could create a special material that did all that for me. I'm thinking of something similar to how it looks in Source engine
  5. As long as Leadwerks doesn't provide a mechanism to specify the order which entity scripts are loaded, that problem will exist. By adding a script.PostStart function to the life cycle of a script, when execution reaches that point in a script the programmer can assume that any entity script it depends on has at least been allocated and has had a chance to initialize variables to a usable state. Which is more than the programmer can assume now, every script.Start has to assume that nothing exists but itself and has to initialize anything else it depends on manually.
  6. That would work but I don't like the idea of the engine effectively deleting functions from my table at runtime for which I have no control over. Also you would have to set it to nil before calling script.Start otherwise circular dependencies could cause problems. Not saying circular dependencies are a good idea but they happen. Also its a manual step for the scripter to call script.Start on any and all entities that it depends on being initialized. Imo it's clearer when execution occurred if there is a separate entry point in the script that occurs after every object in the world has already had script.Start called on it.
  7. I don't see why Reep's workaround wouldn't also work in lua. After map is loaded, iterate over all entities in the world and call PostStart if there is a script and the function exists. EDIT: Talk is cheap, here is the code. Call this after the map is loaded function CallPostStart() local w = World:GetCurrent() local e for i=0,w:CountEntities()-1 do e = w:GetEntity(i) if e.script ~= nil and type(e.script.PostStart) == "function" then e.script:PostStart() end end end
  8. Well it looks correctly in the game. In the Model Editor if I scale the model at all, it turns white or teal (just in the Model Editor). In either case, it's always white when I place it in the level with the map editor.
  9. Hey guys I have a friend that was nice enough to make me a proper model for my game. He's exported it as FBX and it looks right in UU3D but when I import it to Leadwerks it looks wrong. I tried exporting from UU3D directly to Leadwerks MDL but it has the same problem. In Leadwerks I've assigned all materials that have a texture. Any ideas? Looking correctly in UU3D: Looking wrong in Leadwerks: extension_coord.fbx
  10. Ranged based for loops clean up that iterator business even more! Also lambdas clean up the algorithms in STL(stuff like std::sort). My favorite is probably std::bind, been using it for years from Boost but it's nice to see it in the standard.
  11. I've had inconsistent results with prefabs containing CSG. Also as described here, putting a script on CSG means putting a blank script on all it's children if it's suppose to move. It's become clear that I am trying to use CSG in unintended ways. What is the intended use for CSG?
  12. Equals sign is what ya want. from: https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html
  13. I've had problems with phantom breakpoints also. Another funny thing was I had breakpoints in a file that no longer existed so I kept getting errors until I recreated that file to remove the breakpoints. That was a while ago though. I think the biggest issue with the debugger imo is that it doesn't always correctly display numbers(and other things?), Rick made a post about it a month or two ago. This issue has sent me down a rabbit hole more than once. Because of these issues and how slow it is to start the debug build, I rarely use the debugger and use prints to debug issues.
  14. I'm glad you had time to work on the Launcher, I think it's one of my favorite parts of Leadwerks. Looking forward to more updates.
  15. thehankinator

    Slogging On

    Sounds cool, is there a specific school looking at using Leadwerks in the classroom?
  16. Glad to help! Imo this is bug report worthy. The debugger should never manipulate the data before presenting it to the user, could send the user on a wild goose chase.
  17. I know the debugger says c=5 and r=12 but have you tried adding a print before the loop for r and c? The reason I ask is because I ran equivalent code and the results look fine. It would be good to know exactly what lua sees, not the degger. Ran on a standard lua interpreter but that shouldn't matter. c = 5 r = 12 map = {} for row=1, r do map[row] = {} for col=1, c do map[row][col] = "r"..row.."c"..col end end for row=1, r do str = "" for col=1, c do str = str..map[row][col].." " end print(str) end Results: C:\Users\Blah\Desktop>lua.exe test.lua r1c1 r1c2 r1c3 r1c4 r1c5 r2c1 r2c2 r2c3 r2c4 r2c5 r3c1 r3c2 r3c3 r3c4 r3c5 r4c1 r4c2 r4c3 r4c4 r4c5 r5c1 r5c2 r5c3 r5c4 r5c5 r6c1 r6c2 r6c3 r6c4 r6c5 r7c1 r7c2 r7c3 r7c4 r7c5 r8c1 r8c2 r8c3 r8c4 r8c5 r9c1 r9c2 r9c3 r9c4 r9c5 r10c1 r10c2 r10c3 r10c4 r10c5 r11c1 r11c2 r11c3 r11c4 r11c5 r12c1 r12c2 r12c3 r12c4 r12c5 Another thing I thought of, I'm not sure what happens if you have a global variable c in addition to the function argument c. All the more reason to print it out and see what it grabs for a value for c.
  18. Have you looked at this? https://social.msdn.microsoft.com/Forums/vstudio/en-US/dee0ac69-4236-49aa-a2a2-0ac672147769/win32-c-how-do-i-change-the-window-icon-during-runtime?forum=vcgeneral
  19. That's for Object:Release(), the documentation I am looking for defines the the behavior of Script:Release() if it exists in a script that is attached to an entity. Similar to Script:Start(), Script:UpdateWorld(), etc. The links in OP have Script:Detach() or Script:Delete() but nothing about Script:Release() which Reep says superseded Script:Detach() and/or Script:Delete() but the tutorial and reference do not match (one has Script:Detach() the other Script:Delete()) and neither have Script:Release() defined.
  20. So neither the tutorial or the reference pages are correct? Do you know where Script:Release() is documented? I don't see it on either page.
  21. Is this a typo? If not, Delete() appears not to be called when the script is removed from the object, under what conditions does an object have a script removed but not deleted? http://www.leadwerks.com/werkspace/page/api-reference/_/script-reference/ Script:Delete() This function is called when the entity it is attached to is deleted from memory. Use this to release any resources you allocated in the Script:Start() function. http://www.leadwerks.com/werkspace/page/tutorials/_/lua-scripting-r12 Script:Detach() This function will be called when the script is removed from the object, or if the object is deleted.
  22. I've added models for keycards, clues, extension cord, medkits and ammo(no more solid colored boxes!). I think I want to focus on the story next(which will likely require additional levels) but I may also rework the clues before hand. Yeah, I am the best modeler ever I know you wish I made models for your game
  23. No reason why you would need Josh to create the project file. You could start from the Linux codeblocks project file and add an additional build target. Don't forget to configure the compiler settings for MSVC first.
  24. A lot of entries this time! Is it a record?
×
×
  • Create New...