Jump to content

Birdman

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by Birdman

  1. Is the TVehicle class implemented in Leadwerks 3? If the answer is yes, Are there any samples for scripting or C++ version out there? Thanks!
  2. Hope LE 3 development is going good, if i can help somewhow let me know.
  3. 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.
  4. Great, thanks for the info guys, 1 unit 1 meter sounds fine. What about mass? @Josh = I just checked the speed i got while driving varies from 0 to 9 or so, that is M per tick? In that case what would be the best way to turn this m/tick to m/h?
  5. 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.
  6. Loading a map take time, i was working this week in designing a splash screen, idk if somobody did this already, gotta check.
  7. 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.
  8. 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.
  9. You can always Envelope a file to work only with your EXE, adding more protection. Still is better than having the files left on the open. So Josh, how do you make the lua work inside a zip? i wasn't able to do that.
  10. Is there a way to protect LUA files? I tried to place em in a zip protected file, but they won't run from there.
  11. Any news on when this is going to be here?
  12. 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.
  13. 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.
  14. 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.
  15. 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.
  16. 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.
  17. Anybody knows how to call the Spawn function? or anybody have a c++ vehicle working propertly? I used this c++ and lua hybrid couse it was the solution that worked best for me.
  18. 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.
  19. 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.
  20. Thanks guys. I will check it now.
  21. Great this worked, thanks. Another question, how can i set HDR or another video settings? is there a documentation on this?
  22. 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?
  23. I can compile em, but if another scripts need one, it wont find it, because name changed. How will a normal scripts scripts/start etc be compiled to works in leadwerks? Or how do i run this compiled scripts?
  24. thanks macklebee, this worked!
×
×
  • Create New...