Jump to content

Canardia

Developers
  • Posts

    4,127
  • Joined

  • Last visited

Posts posted by Canardia

  1. Here's the LEO version to set the global fw variable in LUA (LuaTools is not part of LEO, but it inherits LEO's Lua class, so you have to copy this code to your program):

    class LuaTools : public Lua
    {
    public:
    
    int GetStackSize()
    {
    	return GetTop();
    }
    
    void SetStackSize( int size )
    {
    	int currentsize = GetStackSize();
    	if( size<currentsize )
    		Pop( currentsize-size );
    }
    
    void SetScriptObject( const std::string& name, BP o )
    {
    	int size = GetStackSize();
    	PushObject( o );
    	SetGlobal( name );
    	SetStackSize( size );
    }
    
    };

     

    Then you can load a whole scene without any need for processcene (water, skybox, lights, everything works):

    #include "leo.h"
    using namespace LEO;
    
    int main()
    {
    Engine engine;
    Framework fw;
    engine.Create("Integrated Framework Demo",640,480);
    fw.Create();
    
    LuaTools luat;
    luat.Create();
    luat.SetScriptObject("fw",fw);
    
    fw.SetStats(2);
    
    Scene scene;
    scene.Load("abstract::main.sbx");
    
    fw.main.GetCamera().Move(-10,140,30);
    fw.main.GetCamera().Turn(0,180,0);
    
    while( !Keyboard::I****() && !engine.IsTerminated() )
    {
    	fw.Update();
    	fw.Render();
    	engine.Flip(0);
    }
    
    fw.Free();
    return engine.Free();
    }

  2. Obviously there is a source license, as I am writing this. There is also a team/studio/school/etc... license, all is handled and judged on individual cases, just write to support at leadwerks dot com to get the best license you need for your business.

  3. Use Editor, it's like making 90% of the game.

    However, Editor is not fully equipped with all game related entity scripts yet (me and Rick are working on those).

     

    In Editor, you place all the models, lights, effects, etc... You can then press Ctrl-G to run the default game script (fpscontroller.lua), and that same script can be used also for the final game; although the game might need also a bit more kick (speak: SQLite database, PS3 6-axis controller, etc...) so it could be run from a C++ app. That however, doesn't change or replace anything what you do in Editor.

  4. Well, you can use C++ code in BlitzMax, but that's not the point here now.

    BlitzMax should have a similar method to construct a foreign type from pointers, like in the C++ example I showed.

    Indeed, Josh started to use those wierd [] operators for float arrays some time ago, so instead of saying Vec3(1,2,3) he says [1,2,3]. So I think the Byte Ptr problem could be easily solved using the fact that Vec3 is just an array of 3 subsequent float (4 byte) values.

  5. Basically not bad, but it can be improved with very little effort: place the swirl emitter at the beginning (like in Far Cry 2) to avoid those popping up of new sprites at the top, and make the falling emitters longer sprites, not so round (or maybe it can be done with the existing sprite, if you make the falling stream not so broad).

  6. Yeah, that's how Lua entities should work. I think at some point there needs to be some standardization how plug-in Lua scripts should work, and what global named objects or other entities they are looking for. One standardization there is already: fw=GetGlobalObject("framewerk"), although it might be renamed into framework soon (due to general definitions of the term "framework", and naming conventions in LE).

  7. Sounds similar like GameLib. I'm planning also to make certain functions work with Lua scripts, but leave the C++ version still there as an option. If you make your scripts public, I guess they can be copied to a community project like GameLib, which is also free for all LE users?

  8. An animated texture is just a file format how multiple textures are stored. They can be stored in a single file (animated gif), or in multiple files (like the multiple DDS files in LE). When the file is loaded, it's split into seperate images anyway, so it doesn't really matter at all how it was stored on disk (or in a SQLite database, or whatever media).

  9. I just finished Far Cry 2 today, and in the last mission I saw a waterfall. I analyzed it with the sniper scope of my Dragunov rifle, and it looked basically that it was made out of several emitters. There was one emitter at the start which rotated the sprites to make it look like a swirl. Then there was the actual waterfall emitter, which moved sprites downwards at a higher speed, and at the ending there was a elliptic emitter where the water bounced back from the river once. LE has only one-directional emitters, so you would need to code the elliptic emitter yourself.

     

    I haven't analyzed yet how the waterfalls in Crysis are done, but I think they use a much better approach, as everything in Far Cry 2 was like trying to copy features of Crysis, but failing in basically everything. I was wondering why Far Cry 2 looks so bad, although it had those Crysis style bright and dark areas, but then I noticed it's all fake. Far Cry 2 has no real lights at all, it's all somekind of hardcoded in-place effects. You could see some objects lighted nicely, but everything around them was dark, so there was no real directional light, but only some "light" which was applied on hardcoded objects. Heck, even a plain cube without texture in LE looks better than Far Cry 2 :)

  10. Probably something like this would work, but it seems like a good idea to add this to mathlib:

    void _stdcall EntityCollisionCallback( TEntity entity0, TEntity entity1, byte* position, byte* normal, byte* force, flt speed )
    {
    TVec3 hitforce;
    hitforce.X=force[0];
    hitforce.Y=force[4];
    hitforce.Z=force[8];
    }

  11. External libraries have nothing to do with LE, they work in any C++ program. The same way LE is just another external library for C++ as all the other thousands of libraries for C++.

     

    The most popular Joystick libraries for C++ are SDL and OIS:

    SDL: http://www.libsdl.org/download.php

    OIS: http://sourceforge.net/projects/wgois/files/

     

    I would probably use SDL, since it brings also MMO capable network functions.

     

    If I want only a input library for Joysticks and other controllers and don't need anything else from SDL, then I would use OIS, since it's much smaller and not so bloated as SDL.

  12. You need to declare the global variables before the functions which use them, and please use the code tag in the forum when you paste code:

    int TailGateAngle=0;
    int TailGateStatus=0;
    void UdateTailGate(void);

×
×
  • Create New...