Jump to content

Help me, test vehicle on Leadwerks.


Yue
 Share

Recommended Posts

function Script:Start()
	
	
-- Creando Vehiculo.
 vehiculo = Vehicle:Create(self.entity )

 
if vehiculo:Build()==false then Debug:Error("Failed to build vehicle.") end






end




I'm trying to create a vehicle system, but I haven't been successful. Any suggestions? A simple example? What am I doing wrong.

Greetings.


 

MC.png

 

 

Link to comment
Share on other sites

Just in case you do not realize, but there is a search function built into the forum. I think you will find it helps answer a lot of questions. The following are from just typing 'vehicle' into the search... note that vehicles have been in the process of being reworked for quite awhile now and may not be stable.

 

  • Thanks 1

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

Yes, I solved the problem, turn the model from blender and I already have it.

However, I have another inconvenience, and that is that the suspension is very high, when the vehicle does not touch the ground, the tires go down a lot from the chassis.

Something tells me that I have to make the model of the vehicle bigger, but I don't rule out the possibility that there is a parameter so that the suspension is not so long. Any suggestions?

 

function Script:Start()
	

	
 --Create the vehicle chassis
        chassis = self.entity
    

	
       

    
        chassis:SetPosition(0,5,0)


--Create the vehicle
        vehicle = Vehicle:Create(chassis)
        
        --Add tires
        local tireradius=0.35
        local tiremass=100
        local tirewidth=0.5
        local tireheight=-0.35
        local tirespacing=0.5
		
		local damper =2.0
		local damper2 = 500
	    local damper3 = 500


        tiremodel={}
        
        tiremodel[0]=self.llanta1
	
       
        tiremodel[0]:SetPosition(tirespacing,tireheight,0.9)
        vehicle:AddTire(tirespacing,tireheight,0.9,tiremass,tireradius,tirewidth,true)
        
        tiremodel[1]=self.llanta2
        tiremodel[1]:SetScale(tireradius*2,tirewidth,tireradius*2)
        
        tiremodel[1]:SetPosition(-tirespacing,tireheight,0.9)
        vehicle:AddTire(-tirespacing,tireheight,0.9,tiremass,tireradius,tirewidth,true)
        
        tiremodel[2]=self.llanta3
        tiremodel[2]:SetScale(tireradius*2,tirewidth,tireradius*2)
      
        tiremodel[2]:SetPosition(tirespacing,tireheight,-0.7)
        vehicle:AddTire(tirespacing,tireheight,-0.7,tiremass,tireradius,tirewidth,false)
        
        tiremodel[3]=self.llanta4
        tiremodel[3]:SetScale(tireradius*2,tirewidth,tireradius*2)
      
        tiremodel[3]:SetPosition(-0.5,tireheight,-0.7)
        vehicle:AddTire(-tirespacing,tireheight,-0.7,tiremass,tireradius,tirewidth,false)       
        
        --Add axles
        vehicle:AddAxle(0,1)
        vehicle:AddAxle(2,3)
        
        --Finalize the vehicle
        if vehicle:Build()==false then Debug:Error("Failed to build vehicle.") end


  --Start the engine
        vehicle:SetEngineRunning(true)
        
        --Release the emergency brake
        vehicle:SetHandBrakes(0)

end

MC.png

  • Confused 1

 

 

Link to comment
Share on other sites

16 hours ago, Josh said:

Suspensionlength...all the little problems you are running into are actually kind of funny when you read the whole thread.  :D

Hello, now what happens is that I have the vehicle that rebounds a lot, any suggestions?

 

local damper = 10
    local spring = 100
	local dist   = 0.001

	

	montaCarga:AddTire( -ejePos, -ejeAlt, posZ, 10, radio, ancho, false, damper, spring, dist)
	montaCarga:AddTire(  ejePos,  -ejeAlt, posZ, 10, radio, ancho, false, damper, spring, dist)
	montaCarga:AddTire( -ejePos, -ejeAlt, -posZ+0.3, 10, radio, ancho,false, damper, spring, dist)
	montaCarga:AddTire( ejePos, -ejeAlt, -posZ+0.3, 10, radio, ancho,false, damper, spring, dist)



 

 

 

Link to comment
Share on other sites

  • 2 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...