-
Posts
775 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Guppy
-
-
As for the require keyword, this is no longer used in LE3.
That's not entirely accurate as I wrote above it's still used to load binary lua plugins ( when not in sandbox mode )
-
While not I'm 100% certain I believe that require is used for including binary plugins and include is used to include scripts.
Also require is turned off in sandbox mode, not sure about include
-
Did you actually rebuild?
what does
readelf -d yourgameexe | grep -i rpath
write?
-
-
(this is a bit long winded - you can just skip to the Question bit if you like)
I'm currently writing an even system to wrap around ( among other things ) the Leadwerks input, this dispatches events that follows this design
Now the event manger dispatches them as Event* but some listeners may want to make use of the more specialized version so it needs to know if it is capable of that before attempting a downcast as the true type is not known at compile time.
There are several approaches to solve this;
1) give event a "virtual std::string getEventClass()=0;" and compare to that
The drawback here are string comparison ( which you could solve with hashing ) and inheritance ( a mouseEvent is still UI event but will fail the check )
2) A variation of the above where each class must push a hash of their class name onto a stack, and the stack is then checked.
This works but is somewhat cumbersome as anyone creating a new event class must remember to push the class name onto the stack or risk breaking the chain.
3) use dynamic_cast
this was my first idea, using the code below;
template <class cmpType> bool isType(const cmpType* src){ return dynamic_cast<const cmpType*>(this) != 0; }
It works but leaves a lot to be desired for readability and anoyingly you need to pass an instance of what your trying to compare to rather than just a class. So I took to the web trying to see if anyone had solved the contract ( / acyclic visitor / reflective visitor ) pattern in C++. What I found was a lot of people saying the sky would fall if one were to use dynamic_cast - but nobody offered an opinion as to why.
Question:
Why is dynamic_cast evil?
- 1
-
This is where I'm tempted to simply post a snarky "could you possibly be a bit more vague?"
But really you have very little information in your post for anyone trying to help you, perhaps include;
- What version of leadwerks your using
- How you attempted to integrate it
- what you have already tried in order to fix it
Also this is a very handy document that far to few people have read;
- What version of leadwerks your using
-
FYI, we have a system for distributing content built into Steam called the Workshop:
Yes but we cannot monetise it can we?
- 1
-
Set freelook to false - not at the Comp atm. So there be further chances needed
-
Remove the camera form the c++ code - ør the lua FPS vontroler wont work
-
Have you compiled the c++ project?
- 1
-
Is there a way to get raw key presses in Leadwerks?
I mean getting an the actuall letter "A" rather than a Leadwerks::Key::A
My first naive approach after noticing that window->keyhitstate was 256 long was to simply convert it to ascii;
std::string inputbuffer=""; for( int i=0; i < 256; i++ ){ if (window->keyhitstate[i]){ [size=3]inputbuffer[/size]+=static_cast<char>(i); } } window->FlushKeys();
However that gets me all keys as uppercase and f1-12 as lower case letters - and even if it worked there is a very high risk of getting inputs out of order
I worry that reading the keys manually will either prevent leadwerks input from working or yield no results as leadwerks already emptied the keyboard buffer.
-
Get the C++ version and code as much of the logic as you can in LUA then use C++ for the bits that you cannot solve in LUA. ( if you just compile a new C++ project with no changes you bascially create the LUA client )
-
Spent all morning figuring this one out and distilling it to it's very essence;
if you do
Leadwerks::Window::GetCurrent()->GetMousePosition();
inside app::start
the world will fall though you - or more specific; CSG boxes wont get drawn and barrels, etc will start falling while the FPS controller just hangs there.
Reason I'm trying to do the above is to have my gui class as encapsulated and easy to use as possible - so rather than requiring the user to pass a valid window instance it just grabs the current if none are specified.
I've several workaround ( like initializing on first draw call, etc ) but I don't understand why it's happing this way, I mean there should be no difference between calling through one pointer or another.
-
I was indeed attempting humor ( trying to indicate that through the use of smilies ) since the OP asked for "boolean" rather than "boolean operations"
-
Is there a reason you actually need the luminance channel? I just use alpha textures for font rendering.
I'm thinking it was to save memory - works just fine now I've told it that format isn't supported
-
Bool a = true;
Your welcome
-
Just a quick note here - the only supported linux flavor is Ubuntu and only the latest LTS. So unless you can replicate your bug there josh is going to close this as a non bug.
-
It's downloading the DLC for you - there is unfortunately not much indication of this, if you just wait a little while it should finish downloading and resume working normally
-
I don't think loading libs for a sandboxed game is possible and I think that's what the leadwerks game player can only use and that's the easiest way to get people to check the game out. That rules out custom C++ build too as the game player seems to run it's own exe. It would be nice to have this built into the editor like DerRidda says. Even if it's not the most secure it'll be something.
That same would be true of gui's - unless you fancy writing a complete gui manager in lua you will be using an external lib.
But it may be a moot point as I just noticed that there was no .so emitted from my build, instead I got;
/usr/bin/ld: /home/morten/.local/share/Steam/SteamApps/common/Leadwerks/Library/Linux/Debug/Leadwerks.a(Package.o): relocation R_X86_64_32S against `_ZTVN9Leadwerks7PackageE' can not be used when making a shared object; recompile with -fPIC /home/morten/.local/share/Steam/SteamApps/common/Leadwerks/Library/Linux/Debug/Leadwerks.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status
had hoped that I could depend on getting the symbols from the executable running the lua instance, seems not
-
facepalm moment - turns out I had stubbed the "isFormatSupported" function in the rendermanager with return true;
so err yeah just ignore this tread, I'll chalk it up to sleep deprivation
-
MyGUI uses it for colored text - suppose I'll have to find a way around that.
-
It should be possible to create a lua lib that that can do the above for you
[/size] require("libLua-cryptloader") cryptloader:LoadDir("Data/","password");
ofcourse you'd need to obfuscate the password a bit
Managed to write and build a shared lib to do just this before I remebered that the linux version cannot load it yet and I've no way of compiling it on windows... oh well later ^^
-
It should be possible to create a lua lib that that can do the above for you
[/size] require("libLua-cryptloader") cryptloader:LoadDir("Data/","password");
ofcourse you'd need to obfuscate the password a bit
- 2
-
I've been usingLeadwerks::Texture::RGB and Leadwerks::Texture::RGBATo pass to
Leadwerks::Texture::Create(_width,_height,LEformat)
But I also need to create textures with one color channel and one Llumiance channel + alpha (GL_LUMINANCE8_ALPHA8) - I've been using Leadwerks::Texture::Intensity16 for this which gets me the correct buffer size but when I bind the texture it just shows as black. So what should I use instead?
Textinput
in Programming
Posted
As I continue on this today something has changed - keyhitstate and keydownstate will both only ever hold 1 character, holding down for instance shift and a will result in only the last key pressed being set to true.
The same is true for holding down multiple characters.
I figured this was due to the beta code, but even after uninstalling leadwerks and re-installing and rebuilding my project the problem persists.
So something else is afoot here, but what?