Jump to content

george68

Members
  • Posts

    50
  • Joined

  • Last visited

Posts posted by george68

  1. Hi,

    I noticed that the loading time for a map consisting of 4 models (one is animated) is too long.

    Leadwerks::Map::Load(getLevelName())
    

    The code above runs on a Microsoft Visual Studio Community 2013 project, in the Debug configuration and it needs approximately 11 secs

    In the Release configuration the loading time is considerably shorter.

  2. Oh I see..

    I hoped that I could use the editor as my level editor for a game I want to develop it with C++

    For example my game has many types of boxes with different properties. Placing these boxes in the editor is a piece of cake, but I'd like to have the ability to give different behaviors using custom properties for each one.

  3. which i suppose you are setting in the lua script.

    No I don't

     

    If you think just because you have the script property "ID" that it'll get translated to a key/value name ID then you'd be wrong

    Yes, that is what I was thinking.

    Here is the script:

    Script.ID = 1 --int "ID"
    Script.Owner = 1 --int "Owner ID"
    Script.Type = "BlockNM" --string "Type"
    Script.Dir = 1 --int "Direction"
    

     

     

    Ah, well you can retrieve the keyvalues in Lua as well, with the same command, but I think he wants to set script values in the editor and retrieve them in C++.

    Yap, exactly. How I can do it?

     

    [EDIT]

    Thank you all for your time

  4. I've placed a model into a map and attached to it a script with properties:

     

    LE1_zps3dji5qtu.png

     

    using the code below I cannot access any key value:

    if (Leadwerks::Map::Load(getLevelName(iLevelCur)))
    {
     for (std::list<Leadwerks::Entity *>::iterator it=world->entities.begin(); it!=world->entities.end(); it++)
     {
       Leadwerks::Entity *ent = *it;
    
      if (ent)
      {
        std::string s = ent->GetKeyValue("name");
    	  if (!ent->GetKeyValue("name").compare("block"))
    	  {
    	    ent->SetGravityMode(false);
    	    s = ent->GetKeyValue("ID");
    	    Leadwerks::System::Print(s);
    	  }
     }
    }
    }
    

  5. hmmm... strange

    I call the Clear() method:

    bool App::Loop()
    {
       if (window->Closed() || window->KeyDown(Leadwerks::Key::Escape))
           return false;
       if (camera)
       {
           if (window->KeyDown(Leadwerks::Key::Space))
           {
               camera->Release();
               camera = NULL;
               context->Clear();
           }
       }
       model->Turn(0, Leadwerks::Time::GetSpeed(), 0);
       Leadwerks::Time::Update();
       world->Update();
       world->Render();
       context->Sync();
       return true;
    }
    

    but the screen is flashing

  6. Please consider this piece of code:

    #include "App.h"
    
    App::App() : window(NULL), context(NULL), world(NULL), camera(NULL)
    {
    }
    
    App::~App()
    {
       delete world;
       delete window;
    }
    
    Leadwerks::Model *model = NULL;
    
    bool App::Start()
    {
       window = Leadwerks::Window::Create();
       context = Leadwerks::Context::Create(window);
       world = Leadwerks::World::Create();
       camera = Leadwerks::Camera::Create();
       camera->Move(0, 0, -3);
    
       Leadwerks::Light *light = Leadwerks::DirectionalLight::Create();
    
       light->SetRotation(35, 35, 0);
       model = Leadwerks::Model::Box();
       model->SetColor(0.0, 0.0, 1.0);
       return true;
    }
    
    bool App::Loop()
    {
       if (window->Closed() || window->KeyDown(Leadwerks::Key::Escape))
           return false;
       if (camera)
           if (window->KeyDown(Leadwerks::Key::Space))
           {
               camera->Release(); // or camera->Hide()
               camera = NULL;
           }
       model->Turn(0, Leadwerks::Time::GetSpeed(), 0);
       Leadwerks::Time::Update();
       world->Update();
       world->Render();
       context->Sync();
       return true;
    }
    
    

    After pressing the space key, only a blank black screen should be visible. But strangely the cube is still visible, without rotating.

    How I can have the 3D world invisible when the camera is deleted?

  7. Hi,

    Should I call the 'release' method for the world, context & window members which are members of the app object?

    What I should do specifically for the world pointer? Should I call the 'clear' method before the 'release' method?

     

    here is the d-ctor of the app object:

    CApp::~CApp()
    {
       world->Clear();
       world->Release();
       context->Release();
       window->Release();
    }
    

     

    Thanks in advance

  8. They are brushes. I don't know how to convert them to meshes using the editor.

    I am new to the editor and the leadwerks in general. I don't think they are one model.

    It is the map that comes with the default installation.

  9. Hi,

    I cannot access all the entities in the start.map file using the following code:

    .
    .
    .
    bool App::Start()
    {
       window = Window::Create("Hello World", 100, 100, 1024, 768, Window::Titlebar);
       context = Context::Create(window);
       world = World::Create();
    
       if (Map::Load("Maps/start.map"))
       {
           for (std::list<Entity *>::iterator it=world->entities.begin(); it != world->entities.end(); it++)
           {
               Entity *ent = *it;
    
               if (ent)
               {
                   int class_id=ent->GetClass();
                   std::string class_name=ent->GetClassName();
                   std::string keyval=ent->GetKeyValue("name");
               }
           }
       }
       return true;
    }
    .
    .
    .
    

    Although the class_name is "Model" the keyval is an empty string ""

    Also iterating the Map I found only one model instead of two, a directional light and a camera

    I don't know what I am doing wrong.

  10. It seems that the editor cannot start without the Steam application running. I tried running the application:

    Leadwerks.exe

    from within

    C:\Program Files (x86)\Steam\steamapps\common\Leadwerks

    folder.

    A modal dialog box appears, with the following:

    Can't initilize program. Please start Steam

     

    I cannot understand why Steam is the only option.

    Thank you very much for the answers and the .pdf documentation

  11. Hello from new kid in town,

    Consider a scenario where there is no Internet connection or a Steam account (or website) is down for any reason. In that case I cannot install the Leadwerks engine even if I've already paid for this.

    I also would like to know, if I can have the API Reference available offline.

     

    Thanks

×
×
  • Create New...