Jump to content

Birdman

Members
  • Posts

    45
  • Joined

  • Last visited

Posts posted by Birdman

  1. velocity = GetBodyVelocity(object,0);
    speed = Length(velocity)*60*60/1000; // KM/h
    

     

    What do you suggest to take as base for mass? 1 mass 1kg will result in very heavy stuff (say a car will be 900 mass or so isn't that a lot) i'm currently using 1.3 for a car.

  2. I was wondering if somebody did already worked with this?

     

    What i need to define a way to measure, size of objects, speed, weight and other stuff.

     

    How can i turn object sizes to meters or feet?

     

    Same with speed, i can get the velocity vector, how could i define a real speed for objects in KM/h or M/h.

     

    velocity = GetBodyVelocity(object,0);
    speed = Length(velocity);
    

     

    What about weight from mass?

     

    Thanks a lot in advance.

  3. I launch LUA from c++ code using

     

     BP L=GetLuaState();
     lua_pushobject(L,fw);
     lua_setglobal(L,"fw");
     lua_pop(L,1);
    

     

    Problem is, i have no clue on how to protect the scripts folder and make it work.

     

    I can protect the data folder and it works ok with something like this:

     

    SetZipStreamPassword("data.pak","pass");
    RegisterAbstractPath("/data");
    

     

    I been trying to do the same with scripts folder in the same data.pak, or in scripts.pak with RegisterAbstractPath("/scripts"), but it simply won't work.

     

    Error i get is "can't open script/class". So far i wasn't unable to solve this.

  4. I updated to the last version, maybe that file wasn't downloaded, i might delete all and redo my installation then.

     

    But before this last version i never saw a version of viperscout with spawn, in fact in LE 1 i didnt have a version with spawn :). Then i updated to version 2 and got this file somehow.

  5. I use LUA to code some parts of stuff i would like to let Map makers or artists modify.

     

    Atm most of my LUA code is for objects like Cars, or static objects that have some behaviour (like lights etc).

     

    A thing that would be good to code in LUA would be also Interface, i'm trying to work on that, also to let non programmers be able to modify part of the stuff i code.

     

    With things like SetGlobalObject or SetKey you can set global objects or object variables from LUA that you can use in code.

    I use this to send settings of object files to my C++ code.

  6. I was experimenting a lot of different setups to make the Raycast default Leadwerks car physics works more real.

     

    So far i didn't got the results i expected.

     

    Will implementing Real Wheel car physics from Newton make this works better?

     

    Or are there some kind of tricks i can make to improve the raycast car?

     

    I need to make a demo with Transmission (Manual or Automatic), and improve the physics a bit.

     

    Right now this setup is what i'm using mostly:

     

     

    suspensionlength=0.1

    springconstant=66.0

    springdamper=020.0

    mass=1.3

     

    This makes it a decent driving experience, still when car turns i feel like it rises to the wrong side (as contrary to real physics). Maybe somebody have a better setup to try, or some ideas to point me out.

     

    Anybody was able to add a transmission or a more realistic engine like physics to the LECAR?

     

    Thanks a lot in advance.

  7. The vehicle_viperscout.lua in Scripts folder starts like this:

     

    dofile("scripts/base.lua")
    dofile("scripts/math.lua")
    steerrate=2.0
    steerlimit=30
    function Spawn(model)
    local entity=base_Spawn(model)
    local pivot
    suspensionlength=0.2
    local springconstant=20.0
    local springdamper=150.0
    
    entity.vehicle=CreateVehicle(model)
    

     

    Maybe i got confused, all i wanted is to update an old project to the last version and i found this script.

    So what is this script used for? The code in Scripts folder looks more advanced than the one in the private folder.

  8. I used this code in a vehicle Lua:

     

    function class:CreateObject(model)
    ..
    SetGlobalObject("vhcobj",entity.vehicle);
    

     

    The problem is that now CreateObject don't exist in the new vehicle lua, instead it was replaced with SPAWN.

     

    I have no idea how to call SPAWN from c++ (My project runs a vehicle from C++, so what i do is, make a global object so i can control the car from Code).

     

    When i used LoadModel() in c++ CreateObject() was called from the LUA, so idk what to do now.

     

    Thanks a lot in advance.

  9. My problem is, i want to implement the last version of vehicle script, but i need to add a few stuff, and spawn is not being called with my c++ project.

     

    A fully scripted vehicle wasn't controllable by c++ so i made an hybrid project in which i use a 5 global objects, 1 for the vehicle, and 4 for the wheels. Then i control em.

     

    I have no idea what's the best practice to handle vehicles, maybe there is a better way to do this.

  10. Yes, indeed i had to create a new Project from the Template to make this work.

     

    Still im having some problem.

     

    I used this code in a vehicle Lua:

     

    function class:CreateObject(model)
    ..
    SetGlobalObject("vhcobj",entity.vehicle);
    

     

    The problem is that now CreateObject don't exist in the new vehicle lua, instead it was replaced with SPAWN.

     

    I have no idea how to call SPAWN from c++ (My project runs a vehicle from C++, so what i do is, make a global object so i can control the car from Code).

     

    When i used LoadModel() in c++ CreateObject() was called from the LUA, so idk what to do now.

     

    Thanks a lot in advance.

  11. I have and old project i made a few months ago in LE1, when i compile with LE 2 it compiles, but running the project will crash.

     

    Any basic function like AppLog, or SetZipStreamPassword will crash my project.

     

    Did this changed that much? do i have to make a new VS Project and put my source files in there?

     

    Thanks a lot in advance.

  12. How do i set the flags for graphics function or what command i have to use to go FULLSCREEN?

     

    Im using this, but i get it windowed.

     

    Initialize();
    int screenwidth = GetSystemMetrics(0);
    int screenheight = GetSystemMetrics(1);
    Graphics( screenwidth, screenheight ) ;
    
    ..CODE..
    
    TFramework fw=CreateFramework();
    while( !KeyHit() && !AppTerminate() )
    {
    			UpdateFramework();
                                   ...CODE..
    			// Render
    			RenderFramework();
    		Flip();
          }
    

     

    Also im having some strange lags when some objects load, maybe map is a bit populated, any idea on what else i would need here to get better graphical performance?

  13. Im using DrawImage to draw a Texture into the screen, in which surface format i have to make the DDS so it shows with transparency?

     

    This is the code:

     

    TTexture img= LoadTexture("abstract::image.dds");
    DrawImage(img,40,50,-1,-1);
    

     

     

    The result is a white box of the image size (without transparency) and with a circle i drawed inside.

     

    Is there a command i'm missing to load the texture with transparent background?

     

    Thanks a lot in advance.

×
×
  • Create New...