Jump to content

Gabriel

Members
  • Posts

    96
  • Joined

  • Last visited

Posts posted by Gabriel

  1. Hello,

     

    I have a question for the developer of Leadwerk, what version should I use lua to enjoy the functionality of leadwerks?

    in the structure lstate.h lua_State is not the same in Lua and LuaJit

     

    baseCcalls unsigned short / * nested C calls RESUMING When coroutine * /
    

     

    could you in your reponce add the link where you have to download Lua for "LE2.5" ;-)

     

    thank you

     

    Gabriel

  2. I use LuaJIT-1.1.6

     

    You can just include the source files into your C++ project.

     

     

    I do not understand, you have only included the *. c and h * in your project?

    you must generate Lu51.dll and Lu51.lib to include in the project, otherwise I do not see how linking'll be able to find references?

     

    I compiled LuaJit in a separate project. For those who would try without success. It is essential to add to the compilation directive the two following define: LUA_BUILD_AS_DLL and LUA_LIB in the definition of the preprocessor section.

     

    I have lua51.dll Lua51.lib and after compilation. I have include in my project.

     

    I tried the following code but it does not work?

    luaL_loadfile ((* lua_State) GetLuaState (), "toto.lua");
    lua_pcall ((* lua_State) GetLuaState (), 0, LUA_MULTRET, 0);
    

     

    And in my toto.lua

     

    Notify("Greate it work");
    

     

    If you have an idea I'm interested;-)

     

    Gabriel

    lua51.rar

  3. I have a question for the experts Lua;-)

    I try to convert the script Spline Lua in C + +, and I met before a problem of semantics of the language Lua, even more elsewhere.

     

    function CreateSpline(p0,n0,p1,n1,mag)
    local spline={} – spline is a table
    …
    – one elements of spline is a function named Interpolate
    function spline:Interpolate(t,v,n) 
    	-self is same as spline here ? or self is area of CreateSplin ?
    	v.x = ((self.A * (t ^ 3.0)) + (self.B * (t ^ 2.0)) + (self.C * t) + self.D)
    	…
    	local m=n:Length() – I don’t understand this semantics 
                         -- Length as define bellow, function of spline table
                         -- ‘n’ is a parameters of Interpolate function  ‘Vect3’ and not spline !!!!
    end
    
    – one elements of spline is a function named Lenght
    function spline:Length()
    …
    	spline:Interpolate(p,t)
    	why call spline:Interpolate and not self:Interpolate ?? 
    	..
    	return dist
    end
    
    
    

     

    maybe he has someone who has already converted this script in C or C + +? I like that to better understand this syntax

     

    Gabriel

  4. Hello Rick

     

    Oh ok, I thought that was very fast for a language interpreted, is is a JIT compiler, now I can die in peace lol;-)

     

    I was on their site and it offers several versions:

     

    LuaJIT beta-2

    LuaJIT-1.1.7

    LuaJIT-1.1.6

    LuaJIT-1.1.5

    LuaJIT-1.1.4

    LuaJIT-1.1.3

    LuaJIT-1.1.2

    LuaJIT-1.1.0

    LuaJIT-1.0.3

     

    what is the version with which LE was compiled?

     

    Tthank Great Rick ;-)

  5. Hello Rick

    I would use this principle followed by the camera, I know how to create a Link Dynamics bypassing the sandbox and LUA and how do the equivalent of SetGlobalString (), I'll assume it is with the function lua_setglobal, but I do not know how it works.

     

    Thank you for your help

     

    Gabriel

     

    PS: for the C + + code

  6. That's why I like Xcode.

     

     

    I can get involved if you want: D What do you think of Eclipse?

    otherwise it remains the VI editor and good old shell and for the twisteds guys, there's always the commande "ed" ^^

     

    josh tell me, thy name is Joshua?

    If you have a good memory is the password to enter the "WOPR" of the "NORAD SIOP" ;-)

     

    Gab.

  7. You're welcome. You might try running your release build using ctrl-F5 (start without debugging) and see if that gets round the issue. Even in release mode using F5 on its own enables some of the debugging overhead.

     

     

    héée, that's right CTRL + F5 hoo my gods I had to miss it:)))

    course CTRL + F5 in release I only use it;-)

     

    Well, For the little story, I started to prehistoric times of C compiler Lattice C, Microsoft C Workbench, Aztech C, Borland TC1 ......

     

    and I always have the same mental illness, I feel the need to watch the generated code in assembler. difficult to treat this mental illness;-)

     

    Gab

  8. I found ^ ^ I'm a big idiot or almost, when I run my programe compiled in release mode in VS2010 environment, loading the scene takes 30 sec.

    If I run the executable directly without IDE, 5 sec.

     

    I wonder what "micro $" can he do with my particular executable in release mode!

     

    Again thank you for your help Pixel Perfect,

     

    Gabriel

     

    PS: you should perhaps an idea to run a script lua in c + +;-)

  9. How to call a script "lua" in C language?

     

    i like to execute "start.lua" in my main() like this:

     

    main(..)
    {
    ....
    luahandle=loadscripte("main.lua");
    executescript( luahandle);
    ...
    }
    

     

    why LE removed in "engine.cpp" the function : ( leLoadScript, leRunScript, leFreeScript) ?

     

    thanks

     

    PS: i work with LE2.5.

  10. Hello Mr. Pixel Perfect ;-)

     

    I am in release mode and it is the Engine.dll that is used and not engine.debug.dll

     

    I could check that with the GetProcAddress API that is the right dll is loaded.

     

    I am very bothered by this problem :-(

     

    who gives a lot of thing in question on the use of 3D engine leadwerk.

     

    can be found LoadScene a source code, so I can understand where the problem?

     

    Gabriel

  11. log.rarI would have put my project but it was 300 mega bytes compressed with rar.

     

    so I just upload the log files, a log is generated via the application written in LUA and the other in CPP.

     

    my compiler is VC10 and the project, but I do not understand there is no diference in the two log files.

    if only one is loaded in 30 sec (CPP) and the other in 5 sec (LUA).

     

    I try to console app and WinApp, but not better.

  12. there is no access to this information faster than this method?

    Handling a string and a callback is a bit heavy as the process, right?

    TEntity what is it? other than a pointer, of course ^ ^

    it points to a structure? I think hard enough that this information is not available elsewhere as a callback, I know that the processor is more powerful, it's still not a reason build cycle that could be used elsewhere.

     

    Am I wrong?

     

    Gabriel

  13. Hi, yes I have an idea for the convenience and my laziness ^ ^.

     

    do not we say that the first quality of a informatician is laziness?

     

    well then I suggest one menu item "Pack resources", this menu pack only what is used in the scene (sandbox) or they zip the files or copy them to a directory.

     

    I think it would save hours of maintenance.

     

    Gabriel

  14. Hello

    I have a probleme with LoadScene API, if a double click on file sbx, the editor load "scene" and "resources" in only 5 seconds.

    With Lua LoadScene() same result +/- 5 sec.

     

    But with the API C++ LoadScene() take 29 seconds ? why ?

    The editor use another system to load scene?

    If so, I like to use this system because 29 seconds is verry to slow to use this in production game :-(

     

    Gabriel

  15. Hello,

     

    Is it possible to add in the Controller class the member function "IsCrouched ()" ?

     

    like this :

     

    //******************************************************************************
    //****					****
    //****	LEO - Leadwerks Engine Objects		****
    //****	(c) 1999-2011 Leadwerks Corporation		****
    //****	http://www.leadwerks.com			****
    //****					****
    //******************************************************************************
    
    #pragma once
    
    #include "leobase.h"
    #include "leoBody.h"
    
    namespace LEO
    {
    class Controller : public Body
    {
    public:
    	Controller( TEntity ent = NULL, flt height = 1.8f, flt radius = 0.4f, flt stepheight = 0.5f, flt maxslope = 45, flt crouchheight = 0 );
    	Controller( const CreateMode& rCreateMode, flt height = 1.8f, flt radius = 0.4f, flt stepheight = 0.5f, flt maxslope = 45, flt crouchheight = 0 );
    
    	virtual void Create( flt height = 1.8f, flt radius = 0.4f, flt stepheight = 0.5f, flt maxslope = 45, flt crouchheight = 0 );
    	virtual void Update( flt angle, flt move, flt strafe = 0, flt jump = 0, flt maxacceleration = 0.5f, int iterations = 1, int crouchmode = 0 );
    
    	bool IsAirborne( void ) const;
    	bool IsCrouched( void ) const; // GKV modification de la source ajout du menbre IsCrouched (16/11/2011)
    
    };
    
    //	=== inlines ===
    inline
    Controller::Controller( TEntity ent, flt height, flt radius, flt stepheight, flt maxslope, flt crouchheight )
    					:	Body( ent )
    {
    	if( !mIsReference )
    		Create( height, radius, stepheight, maxslope, crouchheight );
    }
    
    inline
    Controller::Controller( const CreateMode& rCreateMode, flt height, flt radius, flt stepheight, flt maxslope, flt crouchheight )
    {
    	if( CREATENOW == rCreateMode )
    	{
    		Create( height, radius, stepheight, maxslope, crouchheight );
    	}
    }
    
    inline
    void Controller::Create( flt height, flt radius, flt stepheight, flt maxslope, flt crouchheight )
    {
    	Assign( CreateController( height, radius, stepheight, maxslope, crouchheight ) );
    }
    
    inline
    void Controller::Update( flt angle, flt move, flt strafe, flt jump, flt maxacceleration, int iterations, int crouchmode )
    {
    	UpdateController( m_entity, angle, move, strafe, jump, maxacceleration, iterations, crouchmode );
    }
    
    inline
    bool Controller::IsAirborne( void ) const
    {
    	return 1 == ControllerAirborne( m_entity );
    }
    
    inline
    bool Controller::IsCrouched( void ) const // GKV modification de la source ajout du menbre IsCrouched (16/11/2011)
    {
    	return 1 == ControllerCrouched( m_entity );
    }
    }
    

     

    Thanks ;-)

     

    Gabriel

  16. Hello

     

    if KeyHit(KEY_E)==1 then
    	pick=CameraPick(camera,Vec3(GraphicsWidth()/2,GraphicsHeight()/2,2.0),0,0)
    	if pick~=nil then
    		repeat
    			if pick.entity:GetClass()==ENTITY_MODEL then
    				break
    			end
    			pick.entity=pick.entity.parent
    		until pick.entity==nil
    		if pick.entity~=nil then
    			pick.entity:SendMessage("use",controller,0)
    		end
    	end
    end
    

     

    make same of this code in C++, but i cannot find in documentation this function GetClass() in prototype.header

     

    Thank

×
×
  • Create New...