-
Posts
775 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Guppy
-
And I'm saying having a seperate context ontop of the current is a bad idea - instead draw a quad with the RTT texture
-
There is a render to texture tutorial for a security cam that may be of use to you.
-
Somewhat related, I'm currently working on porting myGUI to Leadwerks - It has a whole host of editors; http://mygui.info See downloads tab for pre compiled binaries, windows but works with wine if you can't be bothered to recompile
-
You perfer it explode without being thrown? Outch
-
Oh I honestly didnt even look for that do not make much sende for the c++ code to be there, but very handy that it is
-
In an effort to keep thing simple I decided to try and move my entire game loop to lua rather than c++. Unfortunately it seems that this file isn't called from the c++ version - I get why as it would duplicate functionality. But even so I wanted to do it, the plan was; Enity* app; bool App::Start() { /* set up anything that lua migth need */ app = Pivot:Create(); app->CallFunction('Start'); //Attach 'scripts/App.lua' to app here /*extra c++ stuff that lua dont care about here*/ } bool App::Loop() { if ( !app->CallFunction('Loop') ) { return false; } } But as far as I can see there is no possible way of attaching that script? I may be braving uncharted waters here, but I think it should be possible to use the C++ version as "lua version with c++ stuff added in"
-
I dont have it the editor here, but I seem to recall you could flip the direction of the axis with checkboxes
-
Maybe it's time to close this poll, gets anoying having it pop on top with every vote
-
who are you and what have you done to yougrove? ;^)
-
My code boils down to this; in C++ Leadwerks::World* world = Leadwerks::World::GetCurrent(); Leadwerks::Entity* e=world->FindEntity(EntityName); if ( output ) { e->CallOutputs(EntityFunction); }else{ e->CallFunction(EntityFunction); } in the first lua script function Script:TestOutput(event)--out print("[Lua] TestOutput"); if ( type(event)=="table" ) then print ( "TestOutput has event data") end self.component:CallOutputs("TestOutputxx") end in the 2nd lua script function Script:TestInput(event) --in print("[Lua] TestInput"); if ( type(event)=="table" ) then print ( "TestInput has event data") end end Calling the function TestOutput works - it ends up calling TestInput, but when I try to skip the middle man and call "TestOutputxx" notting happens. Is that a bug or am I missing something? ps. code tags are murdering my indentation - sorry about that
-
where did you put your files? ... and really posting 500 lines of code that's commented out :|
-
have you dragged the material onto the model? and what does the shaders of the material say?
-
That depends entirely on what is supposed to be shown on the gui and what the source is
-
Leadwerks doesn't support true alpha transparency on models - only what is essentially 1 bit transparency ( think GIF vs PNG ). This means that a pixel is either fully there or fully not there. What the shader does is take a cut off value like say 50% transparent and discards all pixels that are below this value and draws the ones above - so you cannot have semi transparent objects like you wanted above. As I understand this is a technical limitation of the engine. Because your UI is essentially an overlay you can still do it with a bit of trickery tho, every frame; first render you UI to texture keeping the alpha values. Wait for the engine to be done drawing ( context.sync() iirc ) Draw a quad ( tristrip/vert buf/etc ) on top of everything ( in orthomode) with the correct blending mode using the texture you created in step 1 set blend & perspektive mode back to defaults
-
Not sure what it is you want support for output? they posted glsl shader to distort your image to fit, like so ; http://glslsandbox.com/e#20035.0 ( gonna need to render the scene twice, but even so ) tracking? as I understand it will present it self as a HID device, so that shouldn't be a problem either
-
http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitysetanimationframe-r141 you just have to decide the blend factor your self ( usually 1/number of animations playing simultaniously )
-
Just hoping it will NOT be via steam for these reasons; You'd exclude standalone users You will be unable to sell libraries ( think gui, network, ai tailored for leadworks ) You would have pay tithe to Josh and steam both ( the steam cut is under NDA but assume it's 30-40% ) Any thing you buy you would be unable to modify even if the license allows you to. ( adding animations to model, etc ) So for those reasons I'd much perfer to see a store.leadwerks.com - if not we will properly end up each setting up our own shops and such a fragmented system would do more harm that good
-
Agree 100% - especially as I can see no way to iterate over leadwerks virtual file system.
- 1 reply
-
- 1
-
-
While having a small set of fairly simple tables you could properly get away with using Leadwerks::Interpreter::NewTable(); size_t top=Leadwerks::Interpreter::GetStackSize(); Leadwerks::Interpreter::PushString("Key1"); Leadwerks::Interpreter::PushString("Value1"); Leadwerks::Interpreter::SetTable(top); Leadwerks::Interpreter::PushString("Key2"); Leadwerks::Interpreter::PushInt(5); Leadwerks::Interpreter::SetTable(top); (ect) But it's really rather bothersome and hard to read and maintain. And it doesn't get easier when you have somewhat complex like the event table for the gui I'm working on; { event = "onChanged", value = 25.7, caption = "label", widget = { numChildren = 0, parent = "parentWidget", properties = { enabled = true, captoion = "label", visible = "true", class = "ScrollBar", }. id = "testScrollBar", children { }, doStuff: [function] } } Just imagine having to push that to lua using the above technique! Weather or not you think what I've come up with is easier to use/read/maintain is a matter of taste so I'll give you a preview; using namespace luaHelper; typeMap widgetBaseinfo={ {"id", new luaString(widget->getName()) }, {"parent", new luaString(widget->getParent() == nullptr? "": widget->getParent()->getName()) }, {"numChildren", new luaInt(widget->getChildCount()) }, {"UserStrings", new stringTable(widget->getUserStrings()) } }; typeMap properties={ {"visible", new luaBool(widget->getVisible()) }, {"class", new luaString(widget->getTypeName()) }, {"enabled", new luaBool(widget->getEnabled()) } }; widgetBaseinfo["properties"]=new luaTable(properties); typeMap event={ {"event", new luaString(eventType) }, {"widget" ,new luaTable(widgetBaseinfo) }, {"value", value }, } luaTable *table=new luaTable(event); table->push(); delete table; The above is more or less the code I use now ( except I generate widgetBaseinfo, properties and event in different member functions ) if you like this way of working you can download the helper file here, and (ab)use it anyway you like http://decoder.dk/LE/lua_tablehelper.h ( aparently you cannot attach files in blog posts? ) Let me know what you think. I've been considering letting table::push automatically delete it self since I always seem to do that anyway - and it would save me some worries about memory leaks from forgetting to delete.
-
It should be return (((T*)lua_touserdata( L, lua_upvalueindex(1) ))->*memberFunction)(L); I'd like to thank the forum for playing the part of rubber duck
-
template <typename T,int (T::*memberFunction) (lua_State *L)> class luaMemberFunction: public luaType{ public: luaMemberFunction(T* _objectPtr):objectPtr(_objectPtr){} virtual void push() { lua_pushlightuserdata( Leadwerks::Interpreter::L, objectPtr ); lua_pushcclosure(Leadwerks::Interpreter::L,forwarder,1); } T* objectPtr; static int forwarder(lua_State *L){ //return ((T*)lua_touserdata( L, lua_upvalueindex(1) ))->*memberFunction(L); return ((T*)lua_touserdata( L, lua_upvalueindex(1) )).*memberFunction(L); } }; called else where as luaType temp= new luaMemberFunction<eventForwarder,&eventForwarder::testMemberFunction>(this); produces this error As you can properly tell from the comment above I've tried both - I feel like I'm missing something obvious but after two hours of starting at the code I'm still at a loss.
-
Use the prefab barrel it's already set up for physics
-
Resources for Learning Lua ( and programming in general )
Guppy posted a topic in General Discussion
A brief overview of programming So what is programming anyway? It's a way for you to impose your will on the computer. See computers are very, very stupid and completely docile so they will follow any instruction from anyone - this is also why your computer can get viruses/hacked/etc, it cannot tell the intent of the code or who instructed it to do something. ( You would do well to remember this once you start getting bugs in your code ). Lets take an example - on your shampoo bottle it most likely says "Lather, rinse, repeat" given those instructions a computer never finish washing it's hair. But enough dry theory stuff; Lua & programming in general http://luatut.com/ This is a great site because there is a functional lua environment built right into the page so you don't even have to worry about setting that up or having to alt-tab back and forth - just hit ESC and you can follow along the examples. This is the most efficient way of learning - basically "monkey see, monkey do", by actually typing out the examples you will get more involved and thus remember it more easily. Unfortunately while great it's also rather brief - so where do you go from here? Well fire up the Leadwerks editor and start looking at the scripts there - try to figure out what each does, and then change them to do something different. Maybe try to change that that 1 to a 2 and see if you can figure out what you change means before hitting run. I've already said it but let me re-iterate; getting into the code and just fooling about is the best way to learn, years of formal education sitting listening to a professor drone about the principles of programming only really succeeding in one aspect - giving me a common vocabulary to talk about programming with other programmers, the actual learning I did on my own ( and many years before going to university at that, so don't let your age stop you either ). One typical concern is "what if I mess up and it wont run?" - well Leadwerks got you covered there, simply create a "mucking about" project and once you messed it up completely delete it and create a new. Lua as it specificly relates to Leadwerks; http://www.leadwerks.com/werkspace/page/tutorials/_/script/ http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/ Leadwerks user Aggro has a series of short videos titled "Project saturn" in which he goes through the steps of making a game: I'm not really a fan of learning programing from watching videos because it's so inactive, but these are usually short enough that if you watch it and immediately start to try it out it should be fresh in memory. Even more resources Have you come across an online resource that you found helpful in learning? feel free to leave a comment with the information below. -
1) The blender exporter is written for 2.70 - it may work for 2.69 but it also migth not I suggest using the blender ppa 2) you cant (on linux anyway) 3) see above 4) change the model of the fpsplayer and then dont hide it runtime Beware that running LM will preclude you from reporting bugs
-
Best method for smooth rotation over time to a specific angle
Guppy replied to CrazyM's topic in Programming
Isn't that what curve / curveangle is for? http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/math/mathcurveangle-r603