Jump to content

ZioRed

Members
  • Posts

    1,133
  • Joined

  • Last visited

Posts posted by ZioRed

  1. From the tutorial:

     

    // ..before main loop
    TEntity head=FindChild(mesh,"Bip01 Head");
    ...
    // inside game loop
    if (KeyDown(KEY_LEFT)) { TurnEntity(head,Vec3(0,0.5,0));}
    if (KeyDown(KEY_RIGHT)) { TurnEntity(head,Vec3(0,-0.5,0));}
    if (KeyDown(KEY_UP)) { TurnEntity(head,Vec3(0.5,0,0));}
    if (KeyDown(KEY_DOWN)) { TurnEntity(head,Vec3(-0.5,0,0));}
    

     

    Try to call TurnEntity before or after the Animate call.

  2. There is the Power Tutorial to begin.

     

    4) Adding the player

    After loading the map write this line:

     

    game.scene.SetCurrentPlayer("whateveryouwanttoname");

     

    Then you can call the following in the game loop after the Update call:

     

    game.MouseLook(game.scene.cam);
    game.KeyboardMove();
    game.PositionPlayerModel();
    game.PositionCamera();
    

  3. I'm planning a kind of scene builder which parses a SBX file and loads it "manually" in multi-threading mode so that it let me to define a callback (for each entity load) which I can use to show a more or less accurate progress bar.

     

    For the atmoshpere example: why you need to set it manually from the scene? Initializing the framework with lua enabled did not work?

     

    Graphics.Initialize(800, 600);
    Framework.Initialize(true);
    Scene.Load("abstract::terrain_artic.sbx");
    

  4. I'm using .Net, so I have access to API that does a little more than the Leadwerks Networking calls. Plenty can still be done with the given network functions.

    For .NET solutions I'm using Lidgren for UDP messaging (even if building a TCP/UDP server class is a relative simple task in .NET with Socket and I used it on an open source project of a game server emulation for DAoC), it's almost complete and very easy to use.

  5. For loading screen I was working on doing it in a C# lib I was planning to code, the plan is to manually parse a SBX file and call a callback (defined by the user) after loading each entity passing it the entity loaded and the count of all entities in the scene (to let drawing progress bar).

  6. With the following changes you will have a camera that stands behind the controller and rotate accordingly.

     

    1. Create a Pivot for the cam and parent the cam to it:

    TPivot campiv = CreatePivot();
    TCamera cam=GetLayerCamera(layer);
    EntityParent(cam, campiv);
    PositionEntity(cam,Vec3(0,0,0));
    

     

    2. Replace the code for positioning the cam with:

    //Position the camera
    TVec3 playerpos=EntityPosition(player);
    PositionEntity(campiv, playerpos);
    RotateEntity(campiv, EntityRotation(player));
    MoveEntity(campiv, Vec3(0, 1.75, -5));
    

     

    Don't know if that is what you needed.

  7. mmh.. sounds strange, however if it fixes... Now I must going to almost re-write many part of both client and server because after the third wine glass I carelessly copy&pasted in my working source folder an old version of the solution.... leave me now to put aside that damned wine, before I think to retake the old C++ work! Q_Q

  8. I doubt, it should be some problem with the Core.AbstractPath, because loading it with Mesh.Load("abstract::crawler.gmf") works fine.

     

    What is strange is that when I suggested to you the code in the other thread it worked, now the same command did not.

     

    From that moment I downloaded several SDK update, may be something changed in the last engine updates (I'm using 2.31). Now I'm going to try that function in a C++ test client to see if it works there.

     

    EDIT:

    Tried the AbstractPath command on a C++ project and it works fine, so it's really strange. The declaration in the wrapper seems to be correct:

     

    [DllImport(EngineDll, EntryPoint = "AbstractPath", CallingConvention = CallingConvention.StdCall)]
    public static extern string AbstractPath(string _path);

     

    Have someone any idea what may be the problem? The same command worked some weeks ago (before some updates of the 2.31 SDK), as I told, so I thought that it may be something in the last engine changes.

  9. When I call something like the following:

    string filepath = Leadwerks.FileSystem.GetAbsolutePath("abstract::crawler.gmf");

     

    The Core.AbstractPath() call returns me an error (Attempted to read or write protected memory)... but when I tried it some weeks ago it worked. Everyone else may try this?

  10. It would be useful to have the chance to view a list of all objects added in the current scene and not only all the available objects and the added ones as nodes of the tree. I think that the current "all entities" list could be more useful in a "add entity to the scene" command.

  11. In version 3.0, the graphics driver will be abstracted so that you can define a renderer for the different platforms. A "do-nothing" renderer will be included for writing a dedicated server. It might also be useful for other programs where you don't want to create a graphics window, like a file conversion utility.

    THIS will be really a nice feature! :)

  12. I definitely chose Leadwerks for a MMORPG project (fantasy environment) that I'm following currently. Yet I'm atm the only programmer, so the development will be quite slow for the beginning (however we have already wrote papers about mechanics, races/classes, storyboard and a draft of the map). After this project (if it will not end in a soap bubble, else ASAP) I'd like to start writing another project which is in my mind from a while.

     

    I may be available for any other project (better if on C#).

  13. I tried your 1st code and putting the SetRotation call after fw:Update the camera seems to work correctly:

     

    ..
    ballPivot = CreatePivot(ballBody)
    camera:SetParent(ballPivot)
    camrotation=Vec3(0,0,0)
    ..
    while KeyDown(KEY_ESCAPE)==0 do
    
           fw:Update()
    
           mx=Curve(MouseX()-GraphicsWidth()/2,mx,6)
           my=Curve(MouseY()-GraphicsHeight()/2,my,6)
           MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2)
           camrotation.y = camrotation.y-mx/10.0
           camrotation.x = camrotation.x+my/10.0
           ballPivot:SetRotation(camrotation, 1)
    
           fw:Render()
    
           Flip(0)
    end
    

  14. As I remember the forces don't work on Controller, I think this is a feature request too (may be by Rick?). Currently I'm just using your technique: a controller with a mesh which I move/rotate together with the controller (not parenting, just move and rotate the mesh when the controller moves/rotates, because I had unattended behaviour parenting the mesh to the controller).

  15. ah I just realise that the CreatePivot sets the body as parent, instead of placing it at the body.

    It is that... as told you, CreatePivot(parent) create a pivot with "parent" as its parent entity (at least that is on wiki). Probably I misunderstood what you needed. Unfortunately I am not at home now and cannot try your code, I will try it in the next 4 hours.

    • Upvote 1
  16. Why do you parent the pivot to the body and then rotate the pivot? I think you should parent the body to the pivot and then the SetRotation of ballPivot makes sense... Or else, if you still parent pivot to body, try to rotate the body and not the pivot.

  17. I think it is impossible at this moment.

     

    I was looking for something like that too for the server component of my MMORPG. The reason I would like to use the engine in the server component is principally for the AI of the NPCs, to avoid passing through walls when following a player or just walking around randomly, and to calculate LOS (line of sight). If someone have some suggestion to solve these problem I would appreciate very much. Else I have to go forward using a player for LOS and path calculation (but it means more network traffic and hacking chance).

  18. Well I noticed that ScaleEntity in the engine DLL is declared:

    ScaleEntity(TEntity entity, const Vec3 &scale)

     

    Then the problem seems again the wrapping: Entity.cs should be updated changing:

    Core.ScaleEntity(this.Pointer, value.ToFloatArray(), 0);

    to:

    Core.ScaleEntity(this.Pointer, value.ToFloatArray());

  19. I think it is the network event occurred, however I haven't tried the LE network functions but I tried Raknet and it is really easy to handle network with it so I suggest you that, expecially if you have to create a MMO with permanent world.

×
×
  • Create New...