Birdman Posted April 4, 2012 Share Posted April 4, 2012 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. Quote Link to comment Share on other sites More sharing options...
Daimour Posted April 4, 2012 Share Posted April 4, 2012 ...now CreateObject don't exist in the new vehicle lua, instead it was replaced with SPAWN. Why is that? Quote Link to comment Share on other sites More sharing options...
Birdman Posted April 11, 2012 Author Share Posted April 11, 2012 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. Quote Link to comment Share on other sites More sharing options...
macklebee Posted April 11, 2012 Share Posted April 11, 2012 what version are you using? the base.lua file has not been used in about 2 years since we switched from multi-state to single state lua, and even then it only existed for a couple of months. download a fresh install of the latest and greatest LE version and use the script that daimour shows as everyone is more familiar with that setup. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Birdman Posted April 12, 2012 Author Share Posted April 12, 2012 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. Quote Link to comment Share on other sites More sharing options...
Daimour Posted April 12, 2012 Share Posted April 12, 2012 Yes. This file is present in 2.5. But I think it's outdated and is not used now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.