Jump to content

Questions before buying Leadwerks


Guest jeffmorris
 Share

Recommended Posts

Guest jeffmorris

Is it possible for me to create a driving game? How do I use game controllers such as gamepads and racing wheels? Can I use Visual C++ Express to write code? Is 3D World Studio is included with Leadwerks?

Link to comment
Share on other sites

Is it possible for me to create a driving game?

 

Yes

 

 

How do I use game controllers such as gamepads and racing wheels?

 

There was a thread about using a 360 controller in the old forum. Joystick support isn't provided natively. You need 3rd party libraries for that.

(http://www.leadwerks.com/forum/viewtopic.php?f=32&t=2771)

using other input devices would probably follow a similar idea...

 

 

Can I use Visual C++ Express to write code?

 

Absolutely

 

 

Is 3D World Studio is included with Leadwerks?

 

I can't see a download link for it. But Cartography shop is a similar package, and that's totally free...

  • Upvote 1

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

Guest jeffmorris

I tried the driving script. Is it possible to have a driver's view? I tried to run flythrough script but I got a message saying that I need two cameras. I tried out other engines such as Dark BASIC 3D, 3D RAD, and 3D Game Studio.

Link to comment
Share on other sites

Guest jeffmorris

I edited the camera position like this:

 

fw.main.camera:Move(Vec3(0,0.75,0))

 

How do I have the camera turn with the vehicle's body when I steer the vehicle?

 

If I stop the script and run it again, the vehicle falls through the ground. How do I fix the problem?

Link to comment
Share on other sites

I tried out other engines such as Dark BASIC 3D, 3D RAD, and 3D Game Studio.

 

Not sure if you already purchased DBPro, but I will be happy to give my input on that... I got DBPro and worked with it for about 2 months, it is a great idea and I got it becuase I thought that the language would be faster than using C++. The other entisement is all the addons so after 2 months and probably $100+ of purchases for addons I had about 10,000 lines of a game developed, after struggling through several frustrating bugs or inconsistencies in the IDE. Only to then spend days and weeks working around these and bugs within the addons like Dark Physics Ray cast, spent a week on that one... I understand that there are bugs in everything... the frustration was that apart from a couple of users in the forums, TGC would not respond to any of my bug fix requests, even to the point of refusing to acknowledge or deny the specifc bug..

 

I then get leadwerks, and to be honest I am extremely happy with the product, it's extremely flexible and the forums are full of people willing to help, even to the point were the creators of the various solutions are active participants in the forums... The big difference is that leadwerks does take a little more effort and thought to get a finished product but the journey as I am finding is fun, interesting and in many cases challengining but unlike DBPro I never feel like my challenges are beyond my reach... So for what it is worth, if you like to code and do not mind working at your project (if you do then give up now) but Leadwerks engine is a great product and the community is extremely willing to help with everything you need..

 

Just my impressions after looking for an engine, and using DBPro under fire as it were...

If it's not Tactical realism then you are just playing..

Link to comment
Share on other sites

How do I have the camera turn with the vehicle's body when I steer the vehicle?

 

Off the top of my head it would be something like this:

p=TFormPoint(Vec3(0,10,-10),car,nil)
camera:SetPosition( Vec3( Curve(p.x,camera.position.x,10), Curve(p.y,camera.position.y,10), Curve(p.z,camera.position.z,10) ) )
camera:Point(car,3,1,0)

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Guest jeffmorris

Josh, I think that your code isn't working properly. I'm looking at the floor of the vehicle and the camera doesn't turn with the vehicle's body. Maybe I put your code in wrong place in my code. Where should your code be in the driver.lua code? How do I reset the vehicle in the scene before running the code?

Link to comment
Share on other sites

Here's a version of driver.lua that makes the camera stay behind the vehicle and follow its rotation:

require("Scripts/constants/keycodes")
require("Scripts/linkedlist")
require("Scripts/filesystem")
require("scripts/math/math")
require("scripts/constants/engine_const")

FlushKeys()
HideMouse()

local camera = fw.main.camera

chassis=LoadModel("abstract::vehicle_viperscout.gmf")
carobject=objecttable[chassis]
car=carobject.vehicle

if car==nil then
Notify("Vehicle object not found.",1)
chassis:Free()
return
end

chassis:SetPosition(TFormPoint(Vec3(0,-1,10),fw.main.camera,nil))
chassis:SetRotationf(0,camera.rotation.y+180.0,0)

--Variables
local dx=0.0
local dy=0.0
local camerapitch=camera.rotation.x
local camerayaw=camera.rotation.y
local move=0.0
local strafe=0.0
local steering = 0.0
local torque = 0.0
local steerlimit = 30.0
local steerrate = 2.0
local steerangle=0.0

MoveMouse(Round(GraphicsWidth()/2),Round(GraphicsHeight()/2))

while KeyHit(KEY_ESCAPE)==0 do	

--Camera look
--[[
gx=Round(GraphicsWidth()/2)
gy=Round(GraphicsHeight()/2)
dx=Curve((MouseX()-gx)/4.0,dx,3.0/AppSpeed())
dy=Curve((MouseY()-gy)/4.0,dy,3.0/AppSpeed())
MoveMouse(gx,gy)
camerapitch=camerapitch+dy
camerayaw=camerayaw-dx
camerapitch=math.min(camerapitch,90)
camerapitch=math.max(camerapitch,-90)
fw.main.camera:SetRotationf(camerapitch,camerayaw,0,1)
]]--

local tirespeed=-(KeyDown(KEY_UP)-KeyDown(KEY_DOWN))*2.0
car:AddTireTorque(tirespeed,0)
car:AddTireTorque(tirespeed,1)
car:AddTireTorque(tirespeed,2)
car:AddTireTorque(tirespeed,3)

steermode=0
if KeyDown(KEY_RIGHT)==1 then steermode=steermode-1 end
if KeyDown(KEY_LEFT)==1 then steermode=steermode+1 end

if steermode==1 then
	steerangle=steerangle+4.0*AppSpeed()
elseif steermode==-1 then
	steerangle=steerangle-4.0*AppSpeed()
else
	if steerangle>0 then
		steerangle=steerangle-4.0*AppSpeed()
		if steerangle<0.0 then steerangle=0.0 end
	else
		steerangle=steerangle+4.0*AppSpeed()
		if steerangle>0.0 then steerangle=0.0 end
	end
end
steerangle=Clamp(steerangle,-25,25)

car:SetSteerAngle(steerangle,0)
car:SetSteerAngle(steerangle,1)

fw:Update()

local campos=TFormPoint(Vec3(0,1,0),chassis,nil)

fw.main.camera:SetPosition(campos)
fw.main.camera:Move(Vec3(0,0,-10))

local t=TFormVector(Vec3(0,0,1),camera,chassis)
a=-math.deg(math.atan2(t.x,t.z))+180.0

fw.main.camera:SetRotation(Vec3(15,CurveAngle(180+chassis.rotation.y,fw.main.camera.rotation.y,10),0))

carobject.turret:SetRotationf(0,CurveAngle(a,carobject.turret.rotation.y,10.0/AppSpeed()),0)

chassis:Hide()
local pick = LinePick(campos,camera.position,0.5,COLLISION_PROP)
chassis:Show()
if pick~=nil then
	camera:SetPosition(pick.position)
end

fw:Render()
Flip(0)
end

chassis:Free()
chassis=nil
camera=nil

ShowMouse()

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Guest jeffmorris

Josh, Thanks for new driver.lua code. Is it possible for a player to get into and out of a vehicle much like Grand Thief Auto and Crysis?

Link to comment
Share on other sites

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...