Jump to content

Guppy

Members
  • Posts

    775
  • Joined

  • Last visited

Posts posted by Guppy

  1. bascially if you try to run a c++ project binary currently it will fail with

     

    "mygame: error while loading shared libraries: libsteam_api.so: cannot open shared object file: No such file or directory"

     

    now you can get around that by specifying LD_PATH=. mygame, but that is quite frankly ugly and inconvenient

     

    So please in Project -> Build options -> Linker settings -> Other linker options put

     

    -Wl,-rpath=\\$$$ORIGIN

     

     

    ( personally I use "-Wl,-rpath=\\$$$ORIGIN/sharedlibs/" to avoid causing clutter in the root dir but that's just me wink.png )

     

     

    edit: swapped "." for \\$$$ORIGIN because as codeape pointed out you don't have to stand in the same directory to execute the file.

  2. Anyone with linux can download the very exciting plugin here;

     

    https://drive.google.com/file/d/0B7B0hlkpWcYWVmhkOEtaTFJ5bzA/edit?usp=sharing

     

    I put it in a subfolder named "plugin" but you can stick it anywhere - just adjust the path acordingly

     

    require("plugin/libLua-test")

     

    it exposes the functions "sayHi" and addTwo(....);

     

    System:Print(test.sayHi())

    System:Print(test.addTwo(1,2,3,4))

     

    _

     

    This

    http://lua-users.org/lists/lua-l/2014-05/msg00267.html

     

    Seems to suggest that there is a missing define in the linux build

    • Upvote 1
  3. I get "Lua Error: error loading module 'plugin/libLua-test' from file './plugin/libLua-test.so':|dynamic libraries not enabled; check your Lua installation" When I try to load my own library.

     

    This thread http://www.leadwerks.com/werkspace/topic/10566-require/page__hl__require suggests that turning off sandbox will do the trick - I've tried it both in the LE editor and in c++ neither makes any difference.

     

    Since he made it work I'm thinking this could be the linux version having different lua permissions?

     

    Or is removing the sandbox check mark and doing

    Interpreter::sandboxmode=false;

    in App::Start() before loading the map not enough to turn off sandbox?

  4. Steps to reproduce ;

     

    Tools > Options

     

    Under editor Font will say <None>

     

    click and select "DejaVu Sans Mono" 12pt

     

    Click ok

     

    Now re open the Menu

     

    Tools > Options and the entire editor crashes

     

     

     

    Other fonts gives different results - "Tlwg Typist" font instance sometimes causes an instant crash and some times you can repeat the above steps 10 times before it crashes.

     

    At first I suspected font with spaces in the names but even one word ones sometimes crashes.

  5. but in a brand new project it doesn't happen ... :| time to delete code untill it stops happening I guess

     

    Well this was embarasing - somehow ( and I swear I've not changed it ) the debug build target lost the ".debug" extension so the LE editor was using an old version every time I hit debug.

     

    The crash you ask? well that is aparently how LE handles unkown functions - would have been really nice to get an error tbh.

  6. The capital b seems to be a paste error, I added the reset line just before loading the the start map and much as I suspected it made no difference ( being called from a script being run by the Interpreter the Interpreter should be initialized ).

     

    The most annoying bit is there is no indication of why it stops it just exits with "Error: Unkown client disconnected"

  7. Disclaimer: It's getting a bit late so maybe I'm missing something obvious

     

    I've been trying to figure out the Interpreter class and how to create custom lua functions, and it's going well quite apart from not being able to identify a register function on the interpreter class - so I cheated a bit there.

     

    static int addTwo(lua_State *L){
       int argc=Interpreter::GetStackSize(); // equiv to lua_gettop(Interpreter::L) ?
       int i,t;
       for (i = 1; i <= argc; i++){
           t=Interpreter::ToNumber(i);
           std::cout << "[C++]addTwo(" << t << ")=" << (t+2) << std::endl;
           Interpreter::PushFloat(t+2);
       }
    
       return i-1;
    }
    

     

    and in App::Start()

    lua_register(Interpreter::L,"addTwo",addTwo);
    

     

    In the fps player controller i added this

    a,b,c=addTwo(1,2,3)
    System:Print(a)
    System:Print(B)
    System:Print(c)
    

    to the pickup code rigth after "mass = pickInfo.entity:GetMass()" to make sure I can trigger it when ever I want.

     

    Now the strange bit is this works perfectly in Code::blocks - but by when I run it in the LE editor it instantly crashed when I try to pick something up.

     

     

    I've tried toggling sandbox to no avail

  8. Ran head long into much the same problem - I wanted to check if a specific key had NOT been set. In this case you would expect GetKeyValue to return nil - however it always returns a string and in the case of unset values it returns an empty string

    So

    if entity:GetKeyValue("unsetkey") ~= nil then
    System:Print('this will be printed');
    end

     

    Where as

    if entity:GetKeyValue("unsetkey") ~= "" then
    System:Print('this wont be printed');
    end
    
    

     

     

    Embarrassingly enough this is actually mentioned in the docs;

    http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitygetkeyvalue-r773

×
×
  • Create New...