Weapon or Ground Vehicle ?

Ask questions, discuss ideas, get answers
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: Weapon or Ground Vehicle ?

Post by Senshi »

Just take a look at a LOD selector...

Example: Bf109\Objects.con
ObjectTemplate.create LodObject lodBF109
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
rem -------------------------------------
ObjectTemplate.addTemplate BF109Complex
ObjectTemplate.addTemplate BF109Simple
ObjectTemplate.addTemplate BF109Wreck
rem -------------------------------------
ObjectTemplate.lodSelector BF109LodSelector

[...]

LodSelectorTemplate.create DistCompareSelector2 BF109LodSelector
LodSelectorTemplate.hasDestroyedLod 1
LodSelectorTemplate.addLodDistance 200
These are two Parts. The first being the LodObject itself called lodbf109. Here you see the three parts of the lod, complex, simple and wreck. After that, there is a line adding the lodselector so the game knows how to handle the three lods.

The second part shows the LodSelector. Rather easy to understand. It has two lines defining what should happen. Usually, the "Complex" is shown. Now, condition 1: If the vehicle is destroyed, a destroyed mesh will be shown (object with "Wreck" in the end). Condition two is a simple Distanceswitcher, which in this case is set to 200. This means that as soon as the object is 200 BF meters away, the LoD will switch from Complex to Simple. Pretty obvious, right? :)

If you take a close look at the objects.con, you'll notice Lodselectors are commonly used for various purposes where it's necessary to have "changing" meshes depending on certain variables. E.g. there is always one for the cockpit (which is usually set so if you are 10 BF centimeters away the cockpit frame will be removed as otherwise it would be visible from the outside too which would be pretty stupid, considering the vehicles camera positions are usually a bit in front of the vehicle and not actually "in" them. Selectors also are used to make sure the propellers switch to a "blurred" mesh/texture as soon as engine RPM reaches a certain level.
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: Weapon or Ground Vehicle ?

Post by Poow »

Okay thanks :)
So mostly not all lods from the complex are used. Before the games uses lod6 from the complex it goes to lod1 "simple" ?


----------------------------------
OK I tried to get it ingame:
But I get a ctd.
Debugg Log:
Engine\WorldObjTemplLod\LodObject.cpp(45): Warning: WorldObjTemplLod: Couldn't create lod selector "SoapboxSteeringSelector" when creating object of template "lodSoapboxSteering"
steering lines from Objects.con:

Code: Select all

rem *** SoapboxSteeringDummy ***
ObjectTemplate.create AnimatedBundle SoapboxSteeringDummy
rem -------------------------------------
ObjectTemplate.addTemplate SoapboxSteering
rem -------------------------------------
ObjectTemplate.addSkeletonIK Bip01_R_Hand 0.24/-0.1/-0.82 -80/60/50
ObjectTemplate.addSkeletonIK Bip01_L_Hand -0.26/-0.1/-0.82 -80/-60/50


rem *** SoapboxSteering ***
ObjectTemplate.create RotationalBundle SoapboxSteering
ObjectTemplate.setNetworkableInfo SoapboxSteeringInfo
rem -------------------------------------
ObjectTemplate.addTemplate lodSoapboxSteering
rem -------------------------------------
ObjectTemplate.setMinRotation 0/0/-60
ObjectTemplate.setMaxRotation 0/0/60
ObjectTemplate.setMaxSpeed 0/0/180
ObjectTemplate.setAcceleration 0/0/-180
ObjectTemplate.setInputToRoll c_PIYaw
ObjectTemplate.setAutomaticReset 1


rem *** lodSoapboxSteering ***
ObjectTemplate.create LodObject lodSoapboxSteering
rem -------------------------------------
ObjectTemplate.addTemplate SoapboxHighRSteering
ObjectTemplate.addTemplate SoapboxLowSteering
rem -------------------------------------
ObjectTemplate.lodSelector SoapboxSteeringSelector


rem *** SoapboxHighRSteering ***
ObjectTemplate.create SimpleObject SoapboxHighRSteering
ObjectTemplate.geometry 1P_Soapbox_Str_M1


rem *** SoapboxLowSteering ***
ObjectTemplate.create SimpleObject SoapboxLowSteering
ObjectTemplate.geometry Soapbox_Steering_M1


LodSelectorTemplate.create DistanceSelector SoapboxteeringSelector
LodSelectorTemplate.addLodDistance 10
Can you find a mistake?
(Based on the Willy code.)
You’re entering a world of pain!
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: Weapon or Ground Vehicle ?

Post by Senshi »

LodSelectorTemplate.create DistanceSelector SoapboxteeringSelector

Misses a "S" in "Steering" ;)

That's what the error message tells ya, translated to proper English: lodSoapboxSteering is unable to find SoapboxSteeringSelector.

This usually are spelling mistakes.
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: Weapon or Ground Vehicle ?

Post by Poow »

-.-

Thanks!

It's working fine. I Just have to fix the seat's wheels etc. :D

Image

Is there a trick to find the right coordinates?
Eg. bf coordinates for 3dsmax?
You’re entering a world of pain!
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: Weapon or Ground Vehicle ?

Post by Senshi »

Use the BMDT tools for 3dsmax, then use "Vehicle Import". Then you get all the meshes arranged properly and can move them exactly where you need them. You even can then save it again (though you only can import from .rfa and export to .rfa, no "single files").
Though remember, in vehicle editing mode changes to the meshes are NOT saved! Only the coordinates when you move the single parts around and in place :) .
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: Weapon or Ground Vehicle ?

Post by Poow »

Even easier than expected :)

Why does it look so different in 3ds max & the game? (wheels)
Image

€:because of the "buffer"
And why is the second soldier not on a seat?
Also the hands weren't attached to the steering...
Image

Code: Select all

rem *** SoapboxPassengerSeat ***
ObjectTemplate.create SeatObject SoapboxPassengerSeat
ObjectTemplate.seatFlags c_SeatShowFullBodySoldier
ObjectTemplate.seatFlags c_SeatIsOutside
ObjectTemplate.seatAnimationUpperBody Ub_PassengerInSoapbox
ObjectTemplate.seatAnimationLowerBody Lb_PassengerInSoapbox
You’re entering a world of pain!
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: Weapon or Ground Vehicle ?

Post by Poow »

Poow wrote: Why is the second soldier not on a seat?
Also the hands weren't attached to the steering...

Code: Select all

rem *** SoapboxPassengerSeat ***
ObjectTemplate.create SeatObject SoapboxPassengerSeat
ObjectTemplate.seatFlags c_SeatShowFullBodySoldier
ObjectTemplate.seatFlags c_SeatIsOutside
ObjectTemplate.seatAnimationUpperBody Ub_PassengerInSoapbox
ObjectTemplate.seatAnimationLowerBody Lb_PassengerInSoapbox
Whole Objects.con

Code: Select all

rem *** Soapbox ***
ObjectTemplate.create PlayerControlObject Soapbox
ObjectTemplate.NameTagOffset -0.3/-0.2/0
ObjectTemplate.setNetworkableInfo SoapboxBodyInfo
ObjectTemplate.saveInSeparateFile 1
objectTemplate.cullRadiusScale 5
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.explosionRadius 8
ObjectTemplate.explosionDamage 5
ObjectTemplate.damageFromWater 1
ObjectTemplate.drag 1.5
ObjectTemplate.mass 2500
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.hasArmor 1
ObjectTemplate.speedMod 1
ObjectTemplate.exitTimer 0.75
ObjectTemplate.hitpoints 50
ObjectTemplate.maxhitpoints 50
ObjectTemplate.material 45
ObjectTemplate.criticalDamage 6
ObjectTemplate.hpLostWhileCriticalDamage 2
ObjectTemplate.explosionForceMod 20
ObjectTemplate.hpLostWhileUpSideDown 5
ObjectTemplate.hpLostWhileDamageFromWater 5
ObjectTemplate.addArmorEffect 30 e_WillyDamage 0/1.7/0
ObjectTemplate.addArmorEffect 6 e_WillyFire 0/0.5/0.8
ObjectTemplate.addArmorEffect 0 e_scrapmetal_willy 0/0/0
ObjectTemplate.addArmorEffect 0 e_ExplGas 0/1.2/0
ObjectTemplate.addArmorEffect -1 WaterWaterExplosion  0/0/0
ObjectTemplate.aiTemplate Soapbox
rem -------------------------------------
ObjectTemplate.addTemplate lodSoapbox
rem -------------------------------------
ObjectTemplate.setSoldierExitLocation -1.5/0/-0.8 0/0/0
ObjectTemplate.GUIIndex 26
ObjectTemplate.setVehicleIcon "Vehicle/Icon_willy.tga"
ObjectTemplate.setVehicleIconPos 40/79
ObjectTemplate.setPrimaryAmmoBar ABNone
ObjectTemplate.setCrossHairType CHTNone
ObjectTemplate.setVehicleCategory VCLand
ObjectTemplate.setVehicleType  VTScoutCar
ObjectTemplate.setToolTipType  TTScoutCar
ObjectTemplate.setMinimapIcon "Minimap/minimap_icon_common_16x16.tga"
ObjectTemplate.hasRestrictedExit 1

rem *** lodSoapbox ***
ObjectTemplate.create LodObject lodSoapbox
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
rem -------------------------------------
ObjectTemplate.addTemplate SoapboxComplex
ObjectTemplate.addTemplate SoapboxSimple
ObjectTemplate.addTemplate SoapboxWreck
rem -------------------------------------
ObjectTemplate.lodSelector SoapboxLodSelector


rem *** SoapboxComplex ***
ObjectTemplate.create Bundle SoapboxComplex
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
rem -------------------------------------
ObjectTemplate.addTemplate lodSoapboxCockpit
rem ObjectTemplate.setPosition 0/0.6/-0.999
ObjectTemplate.addTemplate SoapboxCamera
ObjectTemplate.setPosition -0.38/0.95/-1.25
ObjectTemplate.addTemplate SoapboxSeat
ObjectTemplate.setPosition -0.399/0.6/-0.75
ObjectTemplate.addTemplate SoapboxEntry
ObjectTemplate.setPosition 0/0/1
ObjectTemplate.addTemplate SoapboxEntry
ObjectTemplate.setPosition 0/0/-1
ObjectTemplate.addTemplate SoapboxPassengerPCO
ObjectTemplate.setPosition 0/0.35/-0.25
ObjectTemplate.addTemplate SoapboxEngine
ObjectTemplate.setPosition 0/0.35/-0.25
ObjectTemplate.addTemplate SoapboxSteeringDummy
ObjectTemplate.setPosition -0.399/0.35/0.15
ObjectTemplate.setRotation 0/34/0
rem -------------------------------------


rem *** lodSoapboxCockpit ***
ObjectTemplate.create LodObject lodSoapboxCockpit
rem -------------------------------------
ObjectTemplate.addTemplate SoapboxCockpitExternal
rem ObjectTemplate.setPosition 0/-0.95/1.25
ObjectTemplate.addTemplate SoapboxCockpitInternal
ObjectTemplate.setPosition 0/0.35/-0.25
rem -------------------------------------
ObjectTemplate.lodSelector SoapboxCockpitSelector1


rem *** SoapboxCockpitExternal ***
ObjectTemplate.create SimpleObject SoapboxCockpitExternal
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.geometry Soapbox_Hull_M1


rem *** SoapboxCockpitInternal ***
ObjectTemplate.create Bundle SoapboxCockpitInternal
ObjectTemplate.geometry 1P_Soapbox_Hul_M1


rem *** SoapboxCockpitSelector ***
LodSelectorTemplate.create DistCompareSelector SoapboxCockpitSelector1
rem LodSelectorTemplate.create DistanceSelector SoapboxCockpitSelector
LodSelectorTemplate.addLodDistance 3.05
LodSelectorTemplate.addLodComparison 0.5


rem *** SoapboxCamera ***
ObjectTemplate.create Camera SoapboxCamera
ObjectTemplate.setMinRotation -110/-40/0
ObjectTemplate.setMaxRotation 110/10/0
ObjectTemplate.setPivotPosition 0/0.25/0.3
ObjectTemplate.setMaxSpeed 90/90/0
ObjectTemplate.setAcceleration 5000/5000/0
ObjectTemplate.setInputToYaw c_PIMouseLookX
ObjectTemplate.setInputToPitch c_PIMouseLookY


rem *** SoapboxSeat ***
ObjectTemplate.create SeatObject SoapboxSeat
ObjectTemplate.seatFlags c_SeatShowFullBodySoldier
ObjectTemplate.seatFlags c_SeatIsOutside


rem *** SoapboxEntry ***
ObjectTemplate.create EntryPoint SoapboxEntry
ObjectTemplate.setEntryRadius 2.3


rem *** SoapboxPassengerPCO ***
ObjectTemplate.create PlayerControlObject SoapboxPassengerPCO
ObjectTemplate.setNetworkableInfo SoapboxBodyInfo
ObjectTemplate.aiTemplate SoapboxPassenger
rem -------------------------------------

ObjectTemplate.addTemplate SoapboxEntry
ObjectTemplate.setPosition 0/-0.35/1.25
ObjectTemplate.addTemplate SoapboxEntry
ObjectTemplate.setPosition 0/-0.35/-0.75
ObjectTemplate.addTemplate SoapboxCamera
ObjectTemplate.setPosition 0.3/0.6/-0.999
ObjectTemplate.addTemplate SoapboxPassengerSeat
ObjectTemplate.setPosition 0.3/0.25/-0.499
rem -------------------------------------
ObjectTemplate.setSoldierExitLocation 1.5/0/-0.8 0/0/0
rem ObjectTemplate.hasRestrictedExit 1
rem ObjectTemplate.altSoldierExitPosition 5.5/0/0
ObjectTemplate.GUIIndex 53
ObjectTemplate.setVehicleIcon "Vehicle/Icon_willy.tga"
ObjectTemplate.setVehicleIconPos 21/84
ObjectTemplate.setPrimaryAmmoBar ABNone
ObjectTemplate.setCrossHairType CHTNone
ObjectTemplate.setVehicleCategory VCLand
ObjectTemplate.setVehicleType  VTScoutCar
ObjectTemplate.setToolTipType  TTScoutCar
ObjectTemplate.setMinimapIcon "Minimap/minimap_icon_common_16x16.tga"
ObjectTemplate.hasRestrictedExit 1


rem *** SoapboxPassengerSeat ***
ObjectTemplate.create SeatObject SoapboxPassengerSeat
ObjectTemplate.seatFlags c_SeatShowFullBodySoldier
ObjectTemplate.seatFlags c_SeatIsOutside
ObjectTemplate.seatAnimationUpperBody Ub_PassengerInSoapbox
ObjectTemplate.seatAnimationLowerBody Lb_PassengerInSoapbox


rem *** SoapboxFrontWheelR ***
ObjectTemplate.create RotationalBundle SoapboxFrontWheelR
ObjectTemplate.setNetworkableInfo SoapboxSteeringInfo
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
rem -------------------------------------
ObjectTemplate.addTemplate SoapboxFrontSpringR
ObjectTemplate.setPosition 0/-0.599/0
rem -------------------------------------
ObjectTemplate.setMinRotation -30/0/0
ObjectTemplate.setMaxRotation 30/0/0
ObjectTemplate.setMaxSpeed 200/0/0
ObjectTemplate.setAcceleration 200/0/0
ObjectTemplate.setInputToYaw c_PIYaw
ObjectTemplate.setAutomaticReset 1


rem *** SoapboxFrontWheelL ***
ObjectTemplate.create RotationalBundle SoapboxFrontWheelL
ObjectTemplate.setNetworkableInfo SoapboxSteeringInfo
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
rem -------------------------------------
ObjectTemplate.addTemplate SoapboxFrontSpringL
ObjectTemplate.setPosition 0/-0.599/0
rem -------------------------------------
ObjectTemplate.setMinRotation -30/0/0
ObjectTemplate.setMaxRotation 30/0/0
ObjectTemplate.setMaxSpeed 200/0/0
ObjectTemplate.setAcceleration 200/0/0
ObjectTemplate.setInputToYaw c_PIYaw
ObjectTemplate.setAutomaticReset 1


rem *** SoapboxSteeringDummy ***
ObjectTemplate.create AnimatedBundle SoapboxSteeringDummy
rem -------------------------------------
ObjectTemplate.addTemplate SoapboxSteering
rem -------------------------------------
ObjectTemplate.addSkeletonIK Bip01_R_Hand 0.24/-0.1/-0.82 -80/60/50
ObjectTemplate.addSkeletonIK Bip01_L_Hand -0.26/-0.1/-0.82 -80/-60/50


rem *** SoapboxSteering ***
ObjectTemplate.create RotationalBundle SoapboxSteering
ObjectTemplate.setNetworkableInfo SoapboxSteeringInfo
rem -------------------------------------
ObjectTemplate.addTemplate lodSoapboxSteering
rem -------------------------------------
ObjectTemplate.setMinRotation 0/0/-60
ObjectTemplate.setMaxRotation 0/0/60
ObjectTemplate.setMaxSpeed 0/0/180
ObjectTemplate.setAcceleration 0/0/-180
ObjectTemplate.setInputToRoll c_PIYaw
ObjectTemplate.setAutomaticReset 1


rem *** lodSoapboxSteering ***
ObjectTemplate.create LodObject lodSoapboxSteering
rem -------------------------------------
ObjectTemplate.addTemplate SoapboxHighRSteering
ObjectTemplate.addTemplate SoapboxLowSteering
rem -------------------------------------
ObjectTemplate.lodSelector SoapboxSteeringSelector


rem *** SoapboxHighRSteering ***
ObjectTemplate.create SimpleObject SoapboxHighRSteering
ObjectTemplate.geometry 1P_Soapbox_Str_M1


rem *** SoapboxLowSteering ***
ObjectTemplate.create SimpleObject SoapboxLowSteering
ObjectTemplate.geometry Soapbox_Steering_M1


LodSelectorTemplate.create DistanceSelector SoapboxsteeringSelector
LodSelectorTemplate.addLodDistance 10


rem *** SoapboxSimple ***
ObjectTemplate.create SimpleObject SoapboxSimple
ObjectTemplate.geometry Soapbox_Hull_L1


rem *** SoapboxWreck ***
ObjectTemplate.create SimpleObject SoapboxWreck
ObjectTemplate.geometry Wreck_Soapbox_m1


rem *** SoapboxLodSelector ***
LodSelectorTemplate.create DistCompareSelector2 SoapboxLodSelector
LodSelectorTemplate.hasDestroyedLod 1
LodSelectorTemplate.addLodDistance 135
I have not ideas what's wrong :(
You’re entering a world of pain!
Post Reply