Jump to content

Wchris

Members
  • Posts

    281
  • Joined

  • Last visited

Posts posted by Wchris

  1. Yes, LEO is using Framework, not Framewerk.

    And ArBuZ is using LEO Framework also:

    Framework *fw1=new Framework();

    However, he seems to be passing **fw to Lua, and not *fw, that might be the problem.

    Happy you found out Arbuz problem. If it's just a C++ coding issue than you're far better than me ;) for sure.

     

    What will happen with the old C++ framewerk. Totally deprecated or a come back is possible ?

  2. It should work, since it works in gamelib too (and gamelib is using LEO Framework):

     

    very interresting :D ... i'll have a closer look at LEO. Thanks

     

    EDIT : Hmmm ... when i see this in LEO framework :blink:

     

       inline void Framework::Update() const
       {
    	::leUpdateFramework();
       }
    
       inline void Framework::Render() const
       {
    	::leRenderFramework();
       }
    

     

    this makes me think LEO is calling the engine.dll framework methods ... and not the C++ framewerk renderer methods

     

    not sure ;) but probable

     

    in that case it will work, but the C++ framewerk is not used

  3. If I use LEO Framework, how can I pass framework to LUA?

    This doesnt work:

    Framework *fw1=new Framework();
    fw1->Create();
    
    BP L=GetLuaState();
    lua_pushobject(L,(BP)fw1);
    lua_setglobal(L,"fw");
    lua_pop(L,1);
    
    LoadScene("C:/test/deserthighway.sbx");
    

     

    It gives me error "Access violation reading location 0x2f005800" on LoadScene function. Im doing something wrong?

    you cannot do this. you must choose between full C++ framewerk or engine.dll included framework.

    Lua expects a handle to the engine.dll framework, the C++ framewerk is not compatible.

     

    i know this because i also hit this problem, one solution would be to extract framework from engine.dll and create a framework.dll with defined header ... this way we could create a compatible framework.dll in C++ and lua could call exported methods without knowing it's bmx or C++ compiled code. But i don't think Josh is headed this way now that framework is included in engine.dll.

     

    Anyway, if you don't want to modifiy the framework code, solution 2 with the engine.dll integrated framewrok is the easyest solution.

  4. as far as the null... not sure... i took this code and and placed it into the root of my game directory and changed the abstractpath to "". Changed the name of the scene to my scene and then dragged and dropped the lua script onto the Engine.EXE and it worked just fine after I positioned the camera...

    You're right it works now with "if scene=nil then", no more message in the log window :( maybe vista was locking the sbx file :)

     

    I feel more at home with pascal than lua yet, so when something goes wrong i panic ;)

     

    Thank you

  5. I'm testing lua and i have the same kind of problem (a black screen) with this code

     

    --Register abstract path
    RegisterAbstractPath("D:\Leadwerks\LPisland")
    
    --Set graphics mode
    if Graphics(1024,768)==0 then
    Notify("Failed to set graphics mode.",1)
    return
    end
    
    --Create framewerk object and set it to a global object so other scripts can access it
    framework=CreateFramework()
    if framework==nil then
    Notify("Failed to initialize engine.",1)
    return
    end
    SetGlobalObject("framewerk",framework)
    
    camera=framework.main.camera
    
    scene=LoadScene("abstract::islands3.sbx")
    if scene==nil then
    AppLog('***************** NULL')
    return
    end
    
    light=CreateDirectionalLight()
    light:SetRotationf(45,45,0)
    
    while AppTerminate()==0 do
      framework:Update()
      framework:Render()
    
      Flip(0)
    end
    

    the console says ***************** NULL and the script ends.

     

    - if i use "abstract::tunnels.sbx" like gordon it works.

    - my RegisterAbstractPath is correct and points to my islands3.sbx directory

    - islands3.sbx spelling is correct, and the path "D:\Leadwerks\LPisland" also.

    - the same kind of code in pascal works fine, only my full lua experiment fails

    - if i specify the full path like scene=LoadScene("D:\Leadwerks\LPisland\islands3.sbx") i still get the ********* NULL console message

     

    Can someone try to do a LoadScene from a custom sbx file located elsewhere than in LE maps folder ?

     

    if you have ideas how to solve this, you're welcome ;)

     

    i also wonder how actionsnake is loading it's sbx files ? i did not find any loadscene in actionsnake lua files ? :(

     

    Thank you

     

    EDIT : okey it's m fault :), it works, the camera is just misplaced and i should not have tested "if scene==nil then", but rather "if scene==0 then" or maybe "if scene==nul then" because CreateFramework returns a pointer ... and loadscene a handle.

  6. The problem with the SBX properties not loading is fixed in the DLL which has been uploaded.

     

    Thanks Josh ! Very fast like always :blink:

     

    i synced 2.3 and it works much better now. Except for Macklebee's problem, the firepit's fire particle is still not showing.

     

    can you do something about this also ? Many Thanks

  7. I think this is something for Josh to put right. He is often telling potential customers to go the Lua way, so if they do then there needs to be 'seamless compatibility' between the Editor and the Lua Engine. Workarounds can only achieve so much and they often lead to complications. It's great that we have got this far but I don't think it's time to get too confident yet. :lol:

    +1

     

    i agree, a wisywyg editor is what i was expecting

     

    And yes, this has been an issue since singlestate was introduced. Its been brought up before now that some of the standard entity scripts do not work now outside of the editor. For example the emitter lua scripted entity will not show up at all outside of the editor.

    also discovered this last week, but did not understand exactly why it was not working.

     

    I think this is something for Josh to put right. He is often telling potential customers to go the Lua way, so if they do then there needs to be 'seamless compatibility' between the Editor and the Lua Engine. Workarounds can only achieve so much and they often lead to complications. It's great that we have got this far but I don't think it's time to get too confident yet.

    i also agree, workarounds will lead to complications because we will have to remove them once it works like expected, and this can be a difficult task when the code grows. Not to mention it'll be frustrating ... because things that worked one way will no more and request redesign.

  8. Are Pascal and Delphi the same thing?

     

    No Delphi is based on Pascal, but delphi is much more than just a pascal compiler.

     

    It's a complete class library encapsulating the whole windows API. A complete library of professional components with properties an event driven architecture. A RAD (Rapid Application Developement) environnement (like visual basic) for high productivity. It's also an utra-fast compiler (The chief architect behind Delphi compiler was Anders Hejlsberg) and a fantastic debugger.

     

    The name Delphi was chosen in reference to oracle datadase who was the leading professionnal database in 1995. The goal was to promote the "professionnal" aspect of the product. Delphi is based on Pascal, and Pascal was used as an educational language because of his strict syntax and high readability of source code, they tryed to break the educational image of Pascal by renaming it Delphi instead of "Visual pascal".

     

    There are many little pascal compilers out there, some of them are "object pascal" compilers and follow Delphi. The most famous one is freepascal (http://www.freepascal.org/) because "Project Lazarus" (http://www.lazarus.freepascal.org/) started rewritting the whole class library and components to match Delphi capabilities, and is based on Freepascal. Compared with Delphi, Lazarus is less stable (and personnaly i find Lazarus debugger totally unusable) and less well-documented. However, Lazarus has multi-platform capability and can run from a USB flash drive.

     

    To use the Leadwerks header "object pascal" is not required, any simple pascal compiler is enought.

    to use the Leadwerks Framewerk an "object pascal" capable compiler with full component class hierarchy is need. Only Delphi and the Team Lazarus+FPK (freepascal is also known as FPK) can do the job.

     

    According to wikipedia the original Pascal language was born at Apple Computers, Apple dropped support for Object Pascal when they moved from Motorola 68K chips to IBM's PowerPC architecture in 1994. Today Delphi is leading, and alone, therefore defining the new standards for the "object pascal" with each release of Delphi.

  9. Hi, all.

     

    The header generator and 1.03 framewerk were posted in the old forum

    here are three threads of interest :

     

    - the latest header generator. I have checked the header generator with 2.3, it's OK.

    http://forum.leadwerks.com/viewtopic.php?f=2&t=5621&p=47578&hilit=purebasic#p47578

     

    - my opensource 1.03 pascal Framewerk

    Never tryed it with delphi you'll have to tell me the issues you encounter.

    very simple implementation, everything is public. http://forum.leadwerks.com/viewtopic.php?f=2&t=5622&p=48584&hilit=framewerk#p48584

    I have plans to create a framewerk component and encapsulate private methods and publish properties but it's not done yet, anyway it's less comfortable but still very usable.

     

    - Some screenshots using the Framewerk with Freepascal/Lazarus

    http://forum.leadwerks.com/viewtopic.php?f=1&t=5820&p=49143&hilit=own+map#p49143

    Notice the nice render of the godrays ... water, bloom, HDR, fog ... i think framewerk is a MUST HAVE, that's why i did the job. But you can go on without it.

     

    You'r all welcome to contribute :)

    I'll repost the header generator here if i find the time, meantime get them there

×
×
  • Create New...