Jump to content

Davaris

Members
  • Posts

    285
  • Joined

  • Last visited

Posts posted by Davaris

  1. I was going through the LUA Tute and saw it has a debugger, which tells you when you have an error which is great. The only problem is it doesn't tell you what line number the error is on.

     

    So my request is can we have line numbers included in the error report?

     

     

    Once a script starts to become large and complicated, no line numbers on the error messages, will make them very difficult to find.

     

     

     

     

    --Register abstract path 
    
    RegisterAbstractPath("") 
    
    --Set graphics mode 
    if Graphics(1024,768)==0 then 
    Notify("Failed to set graphics mode.",1) 
    return
    end 
    
    world=CreateWorld() 
    
    if world==nil then 
    Notify("Failed to initialize engine.",1) 
    return 
    end 
    
    mesh=CreateMesh() 
    
    mesh:Point(nil)

  2. I chose Leadwerks over Unity and Unreal, because I preferred the look of the Leadwerks renders. Also I didn't like the cost of Unreal (25% of all earnings over $5000?). With Free Unity, apart from what people have said about shadows, it has no C++ and no C++ was a deal breaker for me, because I have tons of old code I want to reuse. Also there are lots of great open source C++ libraries that I wouldn't be able to use with Free Unity.

  3. You need to do:

    SetVegetationShadowMode(1);

    in your code. Editor has by default the vegation shadow mode: "sometimes" enabled, so you need to enable vegetation shadows in your code. You could also change the vegetation shadow mode in Editor to: "always", but that's not a good idea I think, because then you can't turn the shadows on/off by code.

     

    Thanks!

     

    I also noticed the windmill fan, isn't turning in the editor or gamelib. Does that mean the script is broken? Or perhaps there is something I need to turn on, to get Lua to update? If that is the case, it would explain why the fire barrel doen't produce fire.

  4. I just checked the fire barrel again and it was working like I said above with the squares instead of smoke *in a map I made before yesterdays update*.

     

    However it isn't working in a test map I made today. The light is working, but there are no flames, heat haze or smoke. I wonder if it is just a problem with its script? Because the monster truck kicks up dust properly when it moves.

     

    EDIT:

    Oh wait a sec, it works in the editor just fine so there must be another reason.

  5. I just tried it again and found it crashes when the other zombie walks into my zombie.

     

    Also if I keep the zombie's head perfectly level, I can walk for a little while before it crashes, but if I start walking while pointing its head up or down, it crashes immediately.

  6. I got the demo working with my own map and 0.0.15, but something is different in 0.0.16. I'm wondering if it is the changes to the unnecessary physics objects you mentioned? The other issue I noticed was the fire is working now, but the smoke is appearing as squares.

     

    Anyway I'll do some more testing and see if I can figure out exactly what is causing it to crash. At the moment I think it does it when I attempt to move and change direction with the mouse, because it works for a few seconds walking and then boom.

  7. Thanks for posting this Lumooja.

     

    I just tried it out and ran into a show stopper. For some reason it crashes when I move my zombie or when the other zombie touches my character. But for some reason, the zombie I do not control, can follow a waypoint circuit with no problems.

     

    It crashes in here:

     

    inline void Framework::Update() const

    {

    ::leUpdateFramework();

    }

     

    Also I still get the null framewerk message and there are no shadows for objects, terrain or otherwise. However for some reason my zombies have shadows. :blink:

     

    Edit:

    I was wondering if you might be willing to replace those structs in Gamelib with classes? That way people can override some of the functions without disturbing your code.

  8. So any good sites to learn this stuff because looking at mesh_shadow.frag:

     

    uniform sampler2D texture0;
    varying vec2 texcoord0;
    
    void main(void) {
    if (texture2D(texture0,texcoord0).a<0.5) discard;
    }
    

     

    I'm pretty lost. I can assume texture0 is the texture0 that I assign in the .mat file, but after that I'm lost.

     

    I mean, I see the discard which is good since that's what I'd need, but no clue what texture2D(texture0, texcoord0).a is and why it's being checked if it's < 0.5. Some comments in these things would be handy.

     

     

    I recon you might be able to learn some of this stuff through guessing and trial and error. As for me I think that texcoord0 is the used section of that texture0 and .a is an alpha transparency value for each pixel. So any pixel in that section that is less than 0.5 transparent, discard it.

     

    Josh has some vids in the tute section where he messes around with shaders a little, so that might help as well.

  9. well you can't actually do that .. you'd have to use the Framework commands not the gamlib specific calls to functions that use the Framework commands.

     

    To set fog and DoF just change the settings in the sbx via the options and atmosphere properties dialogue in the editor. LoadScene() should just pick them up.

     

    At that point it was super late and I had to go to bed. 3 of those functions required two params instead of 1 param, so I wasn't sure if they worked the same way. Looking at it with fresh eyes I can see they are the same functions, except one group takes a vector for the two params.

     

    Different ways of doing things is confusing for tired newbies! :)

  10. #include "engine.h"
    
    int main(int argc, char** argv)
    {
           Initialize();
           RegisterAbstractPath("C:\Users\Davaris\Desktop\MyProject");
           Graphics(640,480);
    
           AFilter() ;
           TFilter() ;
    
           TWorld world = CreateWorld() ;
           if (!world) {
           MessageBoxA(0,"Error","Failed to create world.",0);
           return Terminate();
           }
    
           TFramework framework=CreateFramework();
           TLayer layer = GetFrameworkLayer(0);
           TCamera cam=GetLayerCamera(layer);
           PositionEntity(cam,Vec3(0,0,0));
    
           //Set Lua variable
           BP L=GetLuaState();
           lua_pushobject(L,framework);
           lua_setglobal(L,"fw");
           lua_pop(L,1);
    
           // Setup Initial Post Processing FX
    /*
    	SetGodRays(1);
           SetHDR(1);
           SetSSAO(1);
           SetBloom(1);
           SetAntialias(1);
    */
           SetStats(2);
    
    	game.scene.GetFramewerk().GetRenderer().SetReflectionRenderComponents(ENTITY_ALL);
    	game.scene.GetFramewerk().GetRenderer().SetDistanceFogColor(Vec4(0.9f,0.9f,1,0.96f));
    	game.scene.GetFramewerk().GetRenderer().SetDistanceFogAngle(Vec2(0,10));
    	game.scene.GetFramewerk().GetRenderer().SetDistanceFog(fog);
    	game.scene.GetFramewerk().GetRenderer().SetNearDOFRange(Vec2(0,5));
    	game.scene.GetFramewerk().GetRenderer().SetFarDOFRange(Vec2(50,1000));
    	game.scene.GetFramewerk().GetRenderer().SetAntialias(antialias);
    	game.scene.GetFramewerk().GetRenderer().SetSSAO(ssao);
    	game.scene.GetFramewerk().GetRenderer().SetNearDOF(dof);
    	game.scene.GetFramewerk().GetRenderer().SetFarDOF(dof);
    	game.scene.GetFramewerk().GetRenderer().SetGodRays(godrays);
    	game.scene.GetFramewerk().GetRenderer().SetBloom(bloom);		
    
    
           LoadScene("abstract::mytestmap.sbx");
    
           // Setup spectator
           TBody spectator=CreateBodySphere();
           SetBodyMass(spectator,1);
           SetBodyGravityMode(spectator,0);
           SetBodyDamping(spectator,1.0);
           EntityType(spectator,3);
           SetBodyBuoyancyMode(spectator,0);
           PositionEntity(spectator,Vec3(0,5,-10));
    
           TVec3 camrotation=Vec3(0);
           float mx=0;
           float my=0;
           float move=0;
           float strafe=0;
    
           HideMouse();
           MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
    
           // MAIN LOOP
           while (!KeyHit(KEY_ESCAPE))
           {
    
           mx=Curve(MouseX()-GraphicsWidth()/2,mx,6);
           my=Curve(MouseY()-GraphicsHeight()/2,my,6);
           MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
    
           camrotation.X=camrotation.X+my/10.0;
           camrotation.Y=camrotation.Y-mx/10.0;
           RotateEntity(cam,camrotation);
    
           move=KeyDown(KEY_W)-KeyDown(KEY_S);
           strafe=KeyDown(KEY_D)-KeyDown(KEY_A);
           TVec3 force = Vec3(strafe*10.0,0,move*10.0);
           force=TFormVector(force,cam,0);
           AddBodyForce(spectator,force);
    
           UpdateAppTime();
           UpdateWorld(AppSpeed()) ; 
    
           PositionEntity(cam,EntityPosition(spectator));
    
           // Update timing and world
           UpdateFramework();
    
           // Render
           RenderFramework();
    
           // Send to screen
           Flip(0) ;
           }
    
           return Terminate();
    }
    

     

    I pasted the effects from Gamelib in and removed

     

    game.scene.GetFramewerk().GetRenderer().

     

    And got the following errors:

     

    error C3861: 'SetReflectionRenderComponents': identifier not found

    error C2660: 'SetDistanceFogAngle' : function does not take 1 arguments

    error C2660: 'SetNearDOFRange' : function does not take 1 arguments

    error C2660: 'SetFarDOFRange' : function does not take 1 arguments

  11. is this a terrain texture or a vegetation layer

     

    This is terrain only. It is the jungle part of the free set Josh uploaded.

     

     

    have you got them turned on? what settings are you using for Gamelib?

     

     

    I just checked the effects on both and got this:

     

    Gamelib:

    ssao, bloom, antialias, dof, fog, god rays.

     

    framework

    ssao, hdr, bloom, antialias, god rays.

     

    I'm not sure if hdr works on my card though.

×
×
  • Create New...