Jump to content

thehankinator

Members
  • Posts

    436
  • Joined

  • Last visited

Posts posted by thehankinator

  1. What if someone expects the Init function of another object to be called already when the Init function of one object is called? Then we will just be back at square one and need another function.

    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.

    • Upvote 1
  2. One possibility might be to make the engine set script.Start to nil after the function is called the first time. Then you could check if it exists, call it if it does, and know it has been called or doesn't exist if it isn't there.

    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.

    • Upvote 1
  3. 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
    

    • Upvote 2
  4. If you are referring to vertex colors then the auto conversion doesn't seem to allow for it. But if opened in UU3D and perform 3D Tools>Vertex Colors>Convert..., Select All Materials, and then convert, it will transfer your textureless materials to vertex coloring. Save to MDL with vertex color option checked.

    post-14-0-02637100-1479942642_thumb.jpg

    Edit - Since LE doesn't really have "phong" materials, you wont get that backlit/rim lighting on the model. You could attempt the "PBR" like shaders/materials in the workshop or try to use the probes to get similar results on a static object. Also, if you want more control over specular, then I would suggest using textures/materials in LE.

     

    That worked! Thanks mac

  5. 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:

     

    tWwThfU.png

     

    Looking wrong in Leadwerks:

    GEqCLTD.png

    extension_coord.fbx

  6. Open your CBP file in a text editor and add this line:

    <Add option="-D_GLIBCXX_USE_CXX11_ABI=0" />
    

     

    I'm not sure if that should be an equals sign or a space. Can anyone confirm?

    Equals sign is what ya want.

     

    from: https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html

    -D name=definition

    The contents of definition are tokenized and processed as if they appeared during translation phase three in a ‘#define’ directive. In particular, the definition will be truncated by embedded newline characters.

  7. 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.

    • Upvote 1
  8. Ah, c is equal to 4.999999! I'll round up. Damn debugger rounding! Thank you sir for the eyes and ideas. I should have printed that before. That's what I get for trusting the debugger.

    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.

  9. 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.

    • Upvote 1
  10. 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.

  11. Script::Delete() is from the LE3.0 days and has been 'replaced' with Script::Release(). Everything in LE should be released and the engine will take care of the rest.

     

    I never used Detach personally so I can't tell you what it'd be good for.

    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.

  12. 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.

  13. 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

    Hhd92cE.png

     

    I know you wish I made models for your game

    zIN5CzI.png

    • Upvote 3
  14. 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.

  15. Great game. Nice atmosphere.

    Puzzles were challenging but not too hard.

    Like that if you died you weren't taken back to the very start.

    As Josh said a little more polish and some more levels you could release it.

    Some models for the cards, notes and cords would be good.

    I got caught out a couple of times with the reload. I assumed that it would fully reload my gun but it only loads one bullet biggrin.png

     

    All in all one of the best games I've played from the Summer Games.

    I'm glad you enjoyed it! Thank you for the feedback, I was worried the puzzles would be too difficult!

    • Upvote 1
  16. xAZsNaP.jpg

     

    This is very much a work in progress, lots of undecorated rooms and story to be added but the basics of the game are there.

     

    You are locked in a mysterious underground bunker where something has gone terribly wrong. The only way out is through the horrors lurking in the dark corridors of South Central Biotechnics' forgotten facility.

     

    Left click - Move/Shoot

    R - Reload (can be held down)

    Shift - Run

    F - Flashlight

     

    http://steamcommunity.com/sharedfiles/filedetails/?id=749141006

    • Upvote 9
  17. They should work (although I understand there might be a bug) but why on earth would you make a prefab of a single box?

    For the same reason you make a prefab of a single model! I want to place that prefab in multiple places that is precisely the same size with the exact same texturing and the same script and script properties. Also if I ever change something about the prefab, I won't have to do it in a million places, just in the prefab.

    • Upvote 2
×
×
  • Create New...