PDA

View Full Version : Tutorial Simple Vehicle



Pages : 1 [2]

geodav
08-15-2010, 02:54 PM
ok a little vehicle education here, the faster you go the harder it is to steer, if you drive slow steering will be easy, Epic has done a lot of tweaking over the year to get things to feel right which is why when you boost the scorpian it goes straight on (well the way i drive).
doubling the figues on some values might work the wrong way look at the UDKVehicleSimCar & SVehicleSimCar &SVehicleSimBase as these explain a little what the values are.
sorry but there are no plain english terms that i know of that explain these, i understand what they are due to my old trade

TorQueMoD
08-15-2010, 03:11 PM
Ok, thanks for pointing out those files I'll be sure to take a look.

There has to be someone who can give an easier to understand description of the functions though. Just a basic description and maybe some suggested values so its not so Greek to everyone who doesn't have a degree in programming or vehicle physics...

*Disclaimer - I'm pulling these descriptions out of my arse so don't take them seriously*

//A Higher Stiffness value will cause the vehicle to lean more through turns, a lower value will make steering faster. Race Car = 30, Sedan = 65, Dump Truck = 100
WheelSuspensionStiffness=100.0
//Adjusting the Damping will cause your vehicle to be more or less bouncy. Race Car = 0.6, Sedan = 1.2, Dump Truck = 3
WheelSuspensionDamping=3.0
//Adjusting the bias will make your car fly around the world 300 times at the speed of light, reversing time and saving Louis Lane from certain death. Superman = 0.9 Flash = 0.7 Aquaman = 0.1
WheelSuspensionBias=0.1

I mean if we knew what each bit did, we'd be able to make smarter decisions about what adjustments to make.

Tsepeche
08-15-2010, 08:27 PM
Oh dude, how did you do that? Being able to visualise the wheel would be so helpful. I found the command to toggle the debug camera, but it doesn't seem to generate the wheels.

The wheels are apart of the model, and that's just a sample texture for the wheels so they're easy to spot just incase theirs a mess up such as now, which is fixed

TorQueMoD
08-15-2010, 10:47 PM
@Tsepeche How did you go about fixing the problem? Cause I'm having sort of the opposite thing happen... the back body of my vehicle is falling slightly into the top of the rear wheels and I don't know why.

Tsepeche
08-16-2010, 12:34 AM
@TorqueMod My car was fine, the model sat where it was supposed to in the world, it was just the wheels that had the problem of floating off the ground. It's not solved just yet per se, I'm waiting on my brother to remodel the car so I can reimport it. That car was just a test to use in game. I don't know how to fix your problem, sorry

TorQueMoD
08-16-2010, 12:39 AM
Ok no worries. If the wheel is floating off the ground, shouldn't lowering the Wheel Radius in the VehiclenameWheel.uc file fix that? I measured mine pretty accurately with the measuring tape in the editor... just drop the grid size down to 1 ( [ and ] to change) then zoom in on the tire, hold down middle mouse button and drag the tape from the bottom of the wheel to the center.

Tsepeche
08-16-2010, 01:59 AM
ah, I spawn automatically in the car, plus when I place the actor in the game it's fine. It's just when it's being used for some reason, I've messed with the code and everything, nothings fixed it plus my brother said he just re scaled the car real quickly and some other stuff just to see if we could get the car working in game, it's on his end. No biggy

TorQueMoD
08-16-2010, 02:25 AM
Oh Sweet, how do you spawn directly into the car? Is that custom code?

geodav
08-16-2010, 01:35 PM
@TorQueMoD try changing the COMOffset= , this is the CenterOfMass, basically if you base/root bone isn't in the middle or you have more bones/polys at one end you can chage the COM to make things go better

TorQueMoD
08-16-2010, 02:59 PM
Thanks Geo!

Tsepeche
08-17-2010, 01:53 PM
Oh Sweet, how do you spawn directly into the car? Is that custom code?

Yea it's custom code, search back a few pages on here you'll find a link onto how to get that to work

TorQueMoD
08-19-2010, 01:15 AM
Oh yeah, another weird phenomenon that I've been experiencing is when I use the Boost, the rear wheels of my vehicle actually get pushed up into the middle of its body. Anyone know why that might be happening? Oh and is there a way to update scripts without restarting the editor?

Thanks!

TorQueMoD
08-19-2010, 04:21 AM
@GeoDav - The COMOffset is NOT for adjusting the body to wheel height as I just found out through experimentation. Its actually for adjusting the Center of Mass for the vehicle as it pertains to handling. I set the COMOffset to 0 across the board and this didn't change my wheel placement at all, it just made my vehicle do flying barrel rolls when I tried to turn left or right. No joke, the thing was actually leaping through the air, doing a complete 360 spin and then landing on its wheels again (most of the time) or sometimes continuing the spin, landing on the roof and then proceeding to roll across the map as if it weighed half a pound when I was ejected from the driver's seat.

I did however find where to fix the problem of wheels not being aligned properly... if you scroll down below the lateral tire model settings, you'll find the entry "Begin Object Class=UTVehicleRedEagleWheel Name=RRWheel" and then a BoneOffset X Y Z setting. Adjusting the Z position to a negative value causes the body to lift up slightly off the wheels and a positive value causes the wheels to lift higher into the body.

TorQueMoD
08-19-2010, 04:46 AM
Sorry for the triple post here, but I finally got my vehicle behaving more like a race car so I thought I'd post my adjustments to the code so others who want a similar styled vehicle can do so more easily. I'm not sure how this code will differ with other models, but I think it will work out ok. Feel free to e-mail me ( info [at] torquemod [dot] com ) if you need any help.

These settings will make your vehicle about twice as fast as the Scorpion and still handle fine for corners. The only slight issue is that you need to let off the gas for a bit to make sharp turns, but that's actually quite realistic as you wouldn't be able to take a hairpin corner at 100MPH.


defaultproperties
{
Health=600
StolenAnnouncementIndex=5

COMOffset=(x=0.0,y=0.0,z=-42.0)
UprightLiftStrength=280.0
UprightTime=1.25
UprightTorqueStrength=500.0
bCanFlip=true
bSeparateTurretFocus=true
bHasHandbrake=true
bStickDeflectionThrottle=true
GroundSpeed=2400
AirSpeed=2400
RocketSpeed=8000
ObjectiveGetOutDist=2500.0
MaxDesireability=0.4
HeavySuspensionShiftPercent=0.75f;
bLookSteerOnNormalControls=true
bLookSteerOnSimpleControls=true
LookSteerSensitivity=2.2
LookSteerDamping=0.07
ConsoleSteerScale=1.1
DeflectionReverseThresh=-0.3

Begin Object Class=UDKVehicleSimCar Name=SimObject
WheelSuspensionStiffness=100.0
WheelSuspensionDamping=3.0
WheelSuspensionBias=0.1
ChassisTorqueScale=0.0
MaxBrakeTorque=5.0
StopThreshold=100

MaxSteerAngleCurve=(Points=((InVal=0,OutVal=65),(I nVal=800.0,OutVal=18.0),(InVal=1300.0,OutVal=13.0) ,(InVal=1600.0,OutVal=9.0),(InVal=1900.0,OutVal=1. 0)))
SteerSpeed=210

LSDFactor=0.0
TorqueVSpeedCurve=(Points=((InVal=-1200.0,OutVal=0.0),(InVal=-600.0,OutVal=160.0),(InVal=0.0,OutVal=260.0),(InVa l=1900.0,OutVal=520.0),(InVal=2100.0,OutVal=20.0), (InVal=2300.0,OutVal=0.0)))
EngineRPMCurve=(Points=((InVal=-1000.0,OutVal=5000.0),(InVal=0.0,OutVal=1000.0),(I nVal=1098.0,OutVal=7000.0),(InVal=1100.0,OutVal=20 00.0),(InVal=1698.0,OutVal=9000.0),(InVal=1700.0,O utVal=3000.0),(InVal=2200.0,OutVal=10000.0)))
EngineBrakeFactor=0.025
ThrottleSpeed=0.9
WheelInertia=0.1
NumWheelsForFullSteering=2
SteeringReductionFactor=0.0
SteeringReductionMinSpeed=1100.0
SteeringReductionSpeed=1400.0
bAutoHandbrake=true
bClampedFrictionModel=true
FrontalCollisionGripFactor=0.18
ConsoleHardTurnGripFactor=1.0
HardTurnMotorTorque=0.5

SpeedBasedTurnDamping=5.0
AirControlTurnTorque=40.0
InAirUprightMaxTorque=15.0
InAirUprightTorqueFactor=-30.0

// Longitudinal tire model based on 10% slip ratio peak
WheelLongExtremumSlip=0.1
WheelLongExtremumValue=0.3
WheelLongAsymptoteSlip=0.8
WheelLongAsymptoteValue=0.4

// Lateral tire model based on slip angle (radians)
WheelLatExtremumSlip=0.2 // 20 degrees
WheelLatExtremumValue=0.6
WheelLatAsymptoteSlip=0.4 // 80 degrees
WheelLatAsymptoteValue=0.5

bAutoDrive=false
AutoDriveSteer=0.3
End Object

geodav
08-19-2010, 02:26 PM
thank you so much for posting your changes/fixes as i'm sure others will be most greatful

btw ;)

@TorQueMoD try changing the COMOffset= , this is the CenterOfMass, basically if you base/root bone isn't in the middle or you have more bones/polys at one end you can chage the COM to make things go better


thanks again

TorQueMoD
08-19-2010, 03:39 PM
No problem, I'm glad to help out the community in any way possible. My programmer friend is going to be helping me out with getting things better sorted for our project over the next few months, so if we come up with anything that is useful for the rest of the community I'll be sure to post it up here.

Oh ok Geo, I misunderstood what you were saying with the COM... Can't show you the video results of what happened just yet, but when I can I'm sure you'll get a good laugh out of it... I was definitely surprised!

Sir. Polaris
08-20-2010, 08:35 AM
You could take that passion and exuberance to UDKC.info (http://udkc.info/index.php?title=Tutorials:Building_a_vehicle) and provide a flushed out and detailed tutorial for the community. I know many people that will benefit from a comprehensive understanding of GeoDav's early work and the development and refinement to the point of now.

MotorCity3D
08-20-2010, 09:19 AM
Hey guys,

I'm trying to develope a game, which uses vehicles (Tanks) as players. I just want to know if it is possible and maybe the direction I should start researching it to implement it.

I have the first tank imported into UDK as a Skelmesh and it is good to go afaik.

Also I was reading the Documentation about vehicles, and it stated that I have to create a animtree, but with no animations, so do I still have to import animations to the animset?

I have some of them in progress, but I'm not quite sure what kind to make as this is going to be a modern Tank game and not a UT style or futuristic type. So would I just do basic movements or is there a set set of them I need?

TorQueMoD
08-20-2010, 12:27 PM
@ Sir. Polaris - I'm planning to put together a new video tutorial on creating custom vehicles for UDK to compliment GeoDav's work as soon as I get some spare time, but it might be a while before I do this. If you'd like to copy my Vehicle settings to your wiki, feel free.

@MotorCity3D - You don't actually need an animset for your vehicle to work, you just need the AnimTree which simply sets up the connections between your skeletal mesh and your wheel connections, morph animations etc. Just look through GeoDav's tutorials on http://sites.google.com/site/ut40kmod/ and you should be able to figure things out.

Good luck!

MotorCity3D
08-20-2010, 01:56 PM
Gotcha, but I am doing a Tank, theres wheels but also the track. So Do I need the animation for the track, or is the cehicle physics going to take care of that for me?

I'm also trying to figure out the skel control deal?

TorQueMoD
08-20-2010, 02:17 PM
GeoDav is going to have to answer this one... I haven't attempted a Tank yet, but if I'm not mistaken he's in the middle of making a new video for them.

Here's a link to his written Tank tutorial http://sites.google.com/site/ut40kmod/UT40k_mod/udk-written-tutorials/udk_tank

geodav
08-20-2010, 02:36 PM
nope you do the tracks as a texture/material and then pan it via code, i've been meaning to finish this tutorial for ages

this will get you set-up, till i finish the code side of the project

thanks for reminding me that i've been Lasy :)

MotorCity3D
08-20-2010, 02:37 PM
I already have a physics asset set up for it. I just don't know what to do next. I can't figure out what .uc files I need to go forward, theres so many different examples of how people are doing it, its getting pretty confusing.

I guess I just need to know what files to ccreate for the vehicle/player to be used as a player, and how to make it happen.

Seems like every tutorial there is about anything in these forums- the person giving the tutorial is leaving out key points that some people- including myself don't know about. Not sure if this is on purpose or just to keep people in the dark.

I have looked into Geodavs stuff, very good tuts, but I am going for a commercial game, so Do I follow his way which he said not to if it is commercial.

I think this forum is totally disorganized as far as the tutorials go. One person says this another says that. Who knows which is right.

There has to be official documentation on exactly the steps to take to make a custom character playable in this engine. A step by step on how the code goes, what program files need to be created. Like blank.uc for this and blankfile.uc for that and why and how- and where it goes.

Does a vehicle player need animations, does a vehicle/player need a different set of physic assets??

Who knows?? where is a straight forward anwser??

UDK docs are down for me.

MotorCity3D
08-20-2010, 02:40 PM
nope you do the tracks as a texture/material and then pan it via code, i've been meaning to finish this tutorial for ages

this will get you set-up, till i finish the code side of the project

thanks for reminding me that i've been Lasy :)

What about when the tank drives over a pile of rocks- or a small berm- no animation for that or is the vehicle physics engine take care of that.

TorQueMoD
08-21-2010, 03:15 AM
@MotorCity3D

I'm not quite sure what you're asking here... are you meaning that you want the tracks to flex and bend when going over rough terrain? As GeoDav pointed out the tracks themselves are simply an animated texture scrolling along the track mesh. If you want an actual tank track, I think it would involve a lot of custom code and even then I doubt you'd get realistic deformation to the track when you go over different terrain.

MotorCity3D
08-21-2010, 01:00 PM
Yes thats exactly what I'm talking about. I imagine it would invole some programming, but I also think the vehicle physics engine in UDK might take up some of that- no?

Almost like blendshaping- I am going to experiment alittle with it. Wouldn't a animation of the track flexing like that need to go into the animset and animtree so when it needs that animation its there.

The thing I can't wrap my head around is the .uc file I would need and where they go and how to set them up. We need a straight forward tutorial on that like wryaiths* VT on animtrees. I am very confused about the UTfamilyinfor(mymesh).uc the UT or mypawn.uc- there seems to be a few different ways to do it and not a offical way to do it.

geodav
08-21-2010, 01:46 PM
ok you want your tracks to follow the road wheels when they go over a bump then the animtree is your friend, quick tip here go out and buy UT3 (€10) and look at the goliath tank as it does it, check out the lookat controls

as for the vehicle as player no idea,
mentioned before about looking a gift horse in the mouth, if you want the full docs+support then pay up front for the full licence

btw i've just added some more to the tank tutorial i hope to add the code part next week

MotorCity3D
08-21-2010, 02:20 PM
Sweet- I'll check it out.

TorQueMoD
08-21-2010, 02:38 PM
You know, this is just a theory, but if a wheeled vehicle has shocks for every wheel, then you should be able to simply make your tank's wheels (the ones that move the track) into wheels the same way you would for a regular vehicle with look ats and everything, then weight the track mesh to those wheels' bones so when they move, the track moves. Then you'd just set it up as a regular wheeled vehicle with the animated texture for the tracks and a slightly larger wheel radius in the UC file and it should give you the result you're looking for.

MotorCity3D
08-21-2010, 03:09 PM
You have a good theroy, I just wish I knew more about what your talking about. I seen in the ofical docs about a tank node for track veh's, but I have don't know where to begin, I will have to look into it further, I know its in the animtree thou. I am going to do the look ats with the susp thou like you said.

I know alot of people say that you have to buy a lic to get all the info- I don't understand that, If anyone does profit from the knowledge we get with the free udk they will get a piece of it..........

geodav
08-21-2010, 03:30 PM
give you another tip, watch my UT3 tank tutorials for rigging but use the UDK tank tutorial

then in the animtree you use a UTSkelControl_LookAt to make your track bones to follow the road wheel z-axis. this makes the track follow the wheel up when it goes over a bump

MotorCity3D
08-21-2010, 03:47 PM
That sounds promising.

I will diffently research this stuff.

I am going to try a few different ways to animate the tracks in maya- with bones.

I read that the udk vehicle physics engine does help with alot of things, as far as what I have no clue.

geodav
08-22-2010, 01:54 PM
watch my UT3 tank video and then follow the text tutorial, i should have the code part up next week

geodav
08-23-2010, 02:08 PM
ok instead of trying to write about the code i've uploaded the whole content for the tank so you can see how its set up, you'll find the link at the bottom of the tutorial page

JohNLA
08-23-2010, 06:17 PM
Wow! what an impressive super simple to follow tutorial.
This community owes you so much:)

geodav
08-24-2010, 01:47 PM
no we owe JetFire from the AFF:Planetstorm (http://affuniverse.com/home/) team as he gave my the code and requested that i do a tutorial for it in return, all the power to him and the team :)

tegleg
08-28-2010, 07:31 PM
thanks geodav ill check that tank out

does anyone know where i can find the player input for the throttle?
i want to change it from forward to the trigger/fire button
iv searched all the vehicle and pawn and input files i can find and throttle just seems to appear from nowhere in utvehicle
am i looking for the wrong thing?
any ideas how to do this please?

TorQueMoD
08-29-2010, 02:17 AM
Problem is that the Throttle for your vehicle is mapped to the same key as walking when you're not in a vehicle so that would be the W key. Its listed in UDK/Engine/Config/BaseInput.ini under the line


Bindings=(Name="W",Command="MoveForward")


You need to swap "W" with whatever command you want to replace it with.... not sure how you'd describe game pad controls here though.

tegleg
08-29-2010, 08:25 AM
no that doesnt work at all bah...

Edit:
ahh it works if i change udkgame/config/defaultinput.ini

thanks torquemod

i changed the xbox gamepad like this

.Bindings=(Name="XboxTypeS_RightTrigger",Command="GBA_MoveForward_Gamepad")

tegleg
09-04-2010, 09:09 PM
what numbers do you need to change where for the vehicle leaning?
say for a bike or a top heavy truck

geodav
09-05-2010, 01:53 PM
maybe use the COMoffset (CenterOfMass) incress the Z a little

tegleg
09-11-2010, 05:11 AM
hello
iv managed to figure out a simple but effective hack for a fixed vehicle camera.
its the normal utcamera so it keeps all the fancy animations and everything.

in UTVehicle look for this bit..

simulated function VehicleCalcCamera(float DeltaTime, int SeatIndex, out vector out_CamLoc, out rotator out_CamRot, out vector CamStart, optional bool bPivotOnly)
{
blah blah...
...
// Get the rotation
if ( (Seats[SeatIndex].SeatPawn.Controller != None) && !bSpectatedView )
{
out_CamRot = Seats[SeatIndex].SeatPawn.GetViewRotation();
}

change this bit


out_CamRot = Rotation;

im starting to get into uscript now ;)

KongWeezY
10-10-2010, 09:12 AM
tegleg, damn you are good...:D

out_CamRot = Rotation; = turn left and right
http://lh3.ggpht.com/_DQKWCAdfEGk/S9QGTtEIS4I/AAAAAAAAAYc/QKQI-RaiKPo/fly2VogH.png

can you tell me how to turn up and down
http://lh4.ggpht.com/_DQKWCAdfEGk/S9QGT73cBCI/AAAAAAAAAYg/N_mi4KUkkGc/flyNedogOp.png

TorQueMoD
10-10-2010, 05:36 PM
I love you TegLeg! Any idea how to get rid of the screen Tilt though when it rotates? The camera leans left and right when you turn like you're riding a motorbike.

Also, I tried getting my gamepad to work as the primary controller without any luck... I changed everything under "; Primary default bindings" to "XboxTypeS" controlls but it didn't work with my gamepad which is a Saitek Cyborg rumble. Does this only work with an Xbox controller (the Cyborg is an exact replica) or am I just changing the wrong bindings?

My bindings look like this:


; Primaray default bindings
.Bindings=(Name="XboxTypeS_Start",Command="GBA_ShowMenu")
.Bindings=(Name="XboxTypeS_LeftX",Command="GBA_StrafeLeft_Gamepad")
.Bindings=(Name="XboxTypeS_LeftY",Command="")
.Bindings=(Name="XboxTypeS_RightX",Command="GBA_TurnLeft_Gamepad")
.Bindings=(Name="XboxTypeS_RightY",Command="GBA_Look_Gamepad")
.Bindings=(Name="XboxTypeS_RightShoulder",Command="GBA_NextWeapon")
.Bindings=(Name="XboxTypeS_RightTrigger",Command="GBA_MoveForward_Gamepad")
.Bindings=(Name="XboxTypeS_LeftShoulder",Command="GBA_WeaponPicker")
.Bindings=(Name="XboxTypeS_LeftTrigger",Command="GBA_MoveBackward_Gamepad")
.Bindings=(Name="XboxTypeS_RightThumbstick",Command="GBA_SwitchToBestWeapon_Gamepad")
.Bindings=(Name="XboxTypeS_A",Command="GBA_Fire")
.Bindings=(Name="XboxTypeS_B",Command="GBA_AltFire")
.Bindings=(Name="XboxTypeS_Y",Command="GBA_ShowMap")
.Bindings=(Name="XboxTypeS_X",Command="GBA_Use")
.Bindings=(Name="XboxTypeS_Back",Command="GBA_ShowScores")
+Bindings=(Name="XboxTypeS_DPad_Up",Command="GBA_ToggleMinimap")
+Bindings=(Name="XboxTypeS_DPad_Down",Command="GBA_FeignDeath")
+Bindings=(Name="XboxTypeS_DPad_Left",Command="GBA_ShowCommandMenu")
+Bindings=(Name="XboxTypeS_DPad_Right",Command="GBA_ToggleSpeaking")
.Bindings=(Name="SIXAXIS_AccelX",Command="GBA_TurnLeft_Gamepad")
.Bindings=(Name="SIXAXIS_AccelZ",Command="GBA_Look_Gamepad")


Do you need to enable gamepad support somewhere?

@KongWeezy - I think the Up and Down is based on Jump and Duck... Not sure if you can get a horizontal pitch on the camera (for leaning forward and backward ala a helicopter).

tegleg
10-10-2010, 06:27 PM
'Rotation' refers to the vehicle rotation and it can be split into Pitch Yaw Roll.
so something like


var rotator Rot;

// get the rotation of the vehicle
Rot = Rotation;

//overwrite roll and pitch
Rot.Roll = 0; //stop the roll
Rot.Pitch = Controller.Pitch; //Pitch is player pitch - up down

//tell the camera where to point
out_CamRot = Rot;


TorQueMoD i didnt have to set up the xbox pad to get it working, just pluged it in and it worked. i only changed what the triggers did by changing the function it calls.

TorQueMoD
10-10-2010, 06:33 PM
Thanks for the fast reply. I'll have to borrow my buddy's xbox controller and see if that works... maybe the only gamepad supported is a 360 controller? Funny that the binding says Xbox Type controller.... makes me think any gamepad with a similar setup would work.

Either way, having the camera follow the vehicle makes controller 100 times easier so thank you!

shellc0de
10-13-2010, 10:41 AM
Do you think it would be possible to code a realistic drag car that will spin tires when the front brake is on but have enough traction to do a wheel-stand when the front brake is not on? I don't want a realistic physics coding like the temperature of the tires, just an on off for spin/not spin

TorQueMoD
10-13-2010, 12:35 PM
Anything is possible if you have a good programmer.

tegleg
10-13-2010, 12:56 PM
yes definately possible
have seperate classes for your front and rear wheels
on the front have bpoweredwheel=false so no power goes to it

have your own brake exec function that just stops the front wheels
follow the wheel classes back until you find the brake code to see how to do it
or
have no brakes on the rear wheels

edit:
probably put this in the rear wheels
BrakeTorque=0

linkobinko
10-20-2010, 06:10 PM
before i describe the issue im having with my vehicle, i want to thank the members of this thread that have been so very helpful with suggestions/code etc. wouldnt have gotten far without any of you guys. now my problem..

heres a picture:
http://i3.photobucket.com/albums/y83/Dante211/floatingcar.jpg

my car seems to float above ground (and its not a hovering vehicle like the mantra, its based of the scorpion code). ive played with nearly every setting i can think of in the physicalasset, animset, mesh etc, and outside the editor with every class. ive also tried a few different sets of code but it always appear off the ground the same amount

geodav's humvee code originally didnt work for me and i was getting cpptext errors like JohNLA. so i used the sophia code that Th3ProphetMan posted and it worked great. except the shortened vehicle factory code makes my vehicle fall through the ground, so i had to keep the line:


Begin Object Name=CollisionCylinder
CollisionHeight=+80.0
CollisionRadius=+120.0
Translation=(X=-45.0,Y=0.0,Z=-10.0)
End Object


i was looking at crapageddon's posts because from what i can see in the pictures one of his cars was originally hovering above ground for some reason, but i wasnt sure how he fixed it.

ive gone back and repositioned my car in 3ds max a few times, bones etc but no luck. the only thing i havnt tried yet is playing with suspensiontravel a whole lot..the wheels are slightly below the car too..

any help or suggestions would be greatly appreciated

p.s. the car drives great, it just floats

UnWheelModeller
10-20-2010, 08:57 PM
The size of the wheels determines how high the vehicle sits above the surface. Your vehicles wheels must be a smaller diameter than the Scorpions. That has to be changed by the code for UTVehicleScorpionWheel:
class UTVehicleScorpionWheel extends UDKVehicleWheel;

defaultproperties
{
WheelRadius=27
SuspensionTravel=40
bPoweredWheel=true
SteerFactor=0.0
LongSlipFactor=2.0
LatSlipFactor=2.75
HandbrakeLongSlipFactor=0.7
HandbrakeLatSlipFactor=0.3
ParkedSlipFactor=10.0
bUseMaterialSpecificEffects=true
}

Steven

TorQueMoD
10-20-2010, 11:52 PM
Actually you need to change the code for UTVehicleYOURVEHICLENAMEWheel.uc which is located in the development/source/UTGame/Classes/ folder of your UDK directory

If you change the Scorpion's Wheel.uc file it won't fix your problem it will change the scorpion's size. Love the Flintstones mobile btw.

linkobinko
10-21-2010, 07:26 AM
hey guys thanks for the info, that fixed my problem. drives great now.

thanks torque im hoping once i go back and unwrap it and throw a texture on it wont look too bad. its for a racing level with a flintstones theme with dinosaurs and stuff :)

p40
10-21-2010, 02:46 PM
Hey people, i finish my UDK script helper and like to share now,
its simple, a lot of people have problems whit the script so my program,
make all easy you just set the name, life, mesh and etc, and the program create
all the files for the vehicle and automatic put on the udk folder so check out
http://www.4shared.com/file/22rO0YdN/instalar.html
(sorry for the bad english i'm brazilian):D

p40
10-24-2010, 07:32 AM
Anyone have any thoughts on why my vehicle crashes when I try to exit it? I worked off the Humvee files. Everything else seems fine.

@SpoonDog
Were "Engine RPMCurve" and "Torque VSpeed Curve" the settings you found in the UTVehicle Class?
Maybe the exit radius in "UtVehicle_yourvehicle.uc" default = 160.0, but bigger vehicle bigger radius

linkobinko
11-05-2010, 01:05 PM
Hey guys I was wondering if any of you might have some advice on how to get a custom animation working with the vehicle.

specifically, i have a character in the vehicle. however, the character and the vehicle are part of the same mesh and the same skin. I have an animation for when the vehicle turns right or left, the character leans one way or another.

I thought it would be simple enough to set up an animtree with a few nodes saying that when the vehicle went left or right, the specific animation would play. ive looked at the scorpion animtree for the blades and set mine up accordingly just to test whether it works or not when i press down the fire keys. Nothing works yet.

I have experimented with various nodes like directional ones but nothing yet. works in the animtree, but not in the game. would appreciate any advice :) i will keep testing and post any news

geodav
11-05-2010, 02:58 PM
have a look at the Cidida vehicle+code

linkobinko
11-06-2010, 12:39 AM
thanks for the reply geodav,

the only code i can see to copy is:


VehicleAnims(0)=(AnimTag=Created,AnimSeqs=(InActiv eStill),AnimRate=1.0,bAnimLoopLastSeq=false,AnimPl ayerName=CicadaPlayer)
VehicleAnims(1)=(AnimTag=EngineStart,AnimSeqs=(Get In),AnimRate=1.0,bAnimLoopLastSeq=false,AnimPlayer Name=CicadaPlayer)
VehicleAnims(2)=(AnimTag=Idle,AnimSeqs=(Idle),Anim Rate=1.0,bAnimLoopLastSeq=true,AnimPlayerName=Cica daPlayer)
VehicleAnims(3)=(AnimTag=EngineStop,AnimSeqs=(GetO ut),AnimRate=1.0,bAnimLoopLastSeq=false,AnimPlayer Name=CicadaPlayer)

and i gather i could just copy the cidida animtree and suit it for my vehicle, rename accordingly etc.

im not sure how to adapt this for a left/right animation though. for example, where is "EngineStart" and "Idle" defined in the engine? can I define a "TurnLeft" state? am I even on the right track? lol

I thought this would be as simple as using a directionalnode (or something similar), and although all work in the animtree, none of the nodes work for me in game

geodav
11-06-2010, 02:49 PM
ok i haven't done a lot with this but basically you add an AnimPlayer to the anim tree and name it as you wish, put your anims into an animset then call them like in the code.
the main problem is finding a way to call them, things like Created/EngineStart/Idle ..... are called it UTVehicle.uc or in the vehicle code it's self so you'll have to search/dig to find something suitable for your use.

linkobinko
11-09-2010, 08:08 PM
thanks, will experiment and see what happens.

alternatively, i was thinking of replacing the scorpion code for the blades with my own animation and then change the input controls to left and right. its an extreme work around but i think it could work. the only problem is i cant seem to find the code for altfire = firemodenum (0 or 1).

firemode is defined but i couldnt find altfire next to it in some of the files.

edit: just wanted to say thanks Tegleg for posted that info on the fixed camera for the vehicles. tested and it works like a charm. very clever what you did :)

nish
11-11-2010, 06:22 PM
hi i was following x dances x build a humvee <using september build>
and i moved all the files to the relevent place then it said srcipts are outdated
and i get this error

pic of error

http://i778.photobucket.com/albums/yy62/blapenberg/errorclass.jpg

i tryed putting that symbiol at the end and begging of all the times classes were mentioned but no luck :(

please help

*********spent to much time wasting tring to get it work ************
am going back to january build

TorQueMoD
11-15-2010, 06:47 PM
You'd have to show us your UTVehicleHumvee.uc file so we can see where the problem is in the code. I'd suggest starting over by making a duplicate copy of the UTVehicle_Scorpion.uc file and simply doing a Find & Replace for _Scorpion and change it to _Humvee

Whitenorthstar
11-16-2010, 07:29 AM
hi all, I know this seems basic, but I've been struggling to get GeoDav's LandBuggy working. I'm using the latest October UDK (2010-10)

Everything seems ready to go (incl Animtree and Animset) and the vehicle factory appears perfectly in-game. However, when I start it up, the LandBuggy doesn't appear.

It seems to be a class problem, I'm getting the following script warnings in the log:


[0032.64] ScriptWarning: Accessed null class context 'VehicleClass'
UTVehicleFactory_LandBuggy UEDPIETestLevel.TheWorld:PersistentLevel.UTVehicle Factory_LandBuggy_0
Function UTGame.UTVehicleFactory:Active.SpawnVehicle:007D


[0032.70] ScriptWarning: Accessed None 'MapInfo'
GFxMinimap Transient.GFxMinimapHud_0:GFxMinimap_0
Function UTGame.GFxMinimap:Init:00F2


[0032.70] ScriptWarning: Accessed None 'OnlineSub'
UTPlayerController UEDPIETestLevel.TheWorld:PersistentLevel.UTPlayerC ontroller_0
Function UTGame.UTPlayerController:ClientSetOnlineStatus:00 33

I've tried modifying following code in the vehicle class path in UTVehicleFactory_LandBuggy.uc

VehicleClassPath="DavCorp.UTVehicle_LandBuggy.uc"
DrawScale=1.2

with a couple of options, like replacing DavCorp in 1. UTGameContent (like the Scorpion) and, 2. nothing
but still get the same result.

It is probably something simple, like I've put the files in the wrong places, but I have been at it for about 30 hours with no result.

Can anyone please help out?

josh_caratelli
11-16-2010, 07:52 AM
Have you recompiled? To recompile got to Unreal Frontend and click make-- full recompile.
Hope this Helps
Team13

Whitenorthstar
11-16-2010, 08:47 AM
yes, thanks for the tip, but I've done the front-end recompiling :D

geodav
11-16-2010, 01:54 PM
ok with my content you really should be posting in my support thread (hint) ;)
any sorry i haven't tried the DavCorp code/content in the October build but lets see how i can help
1. do you get any warnings or erros when you compile, if yes then they need to be fixed before you can play.
2. the code is set to be in the DavCorp/classes folder, if it's not then you'll have to look through the code files and change what ever is nessesary, namely the factory class
3. exit the editor, re-compile your code, try in-game, sometimes you get a better error log that way

the second 2 "errors" are not to do with your vehicle but common problems with the current UDK build

Whitenorthstar
11-16-2010, 02:54 PM
hi Geodav, thank U for Ur tutorials and help! Sorry, I should have posted to Ur support thread.

To get back about Ur comments:

1. this is ok, compiling well, one unrelated* error and no warnings
2. mmm, this might be the problem, I'll have another look
3. this is ok, done this and got a full log

Also, just to confirm, here are the three folders where I put the scripts and the .upk

A.
Development\Src\UTGame\Classes\UTVehicle_LandBuggy
Development\Src\UTGame\Classes\UTVehicleLandBuggyW heel

B.
Development\Src\UTGameContent\Classes\UTVehicle_La ndBuggy_Content
Development\Src\UTGameContent\Classes\UTVehicleFac tory_LandBuggy
Development\Src\UTVWeapon_LandBuggyTurret

C.
UDKGame\Content\Vehicles\VH_LandBuggy.upk

*By the way, just in case, the error is :\UDK\UDK-2010-10\Development\Src\UTGame\Classes\UTVehicle_LandBu ggy.uc(585) : Warning, Unknown property in defaults: bLightArmor=true (looked in UTVehicle_LandBuggy)


Anyway, moving this discussion to Geodav's support thread.

Whitenorthstar
11-18-2010, 12:07 AM
:D it works!

I reinstalled UDK, and went through GeoDav's steps below from the beginning again.

Thank U for Ur help mate, nice one.


GeoDav says:

ok the code goes into the

UDK\UDK-2010-10\Development\Src\DavCorp\Classes folder

the content into

UDK\UDK-2010-10\UDKGame\Content\DavCorp\Content\Vehicles folder

don't forget to add +EditPackages=DavCorp to your DefaultEngine.ini file
for example

+EditPackages=UTGame
+EditPackages=UTGameContent
+EditPackages=DavCorp

when you do this re-compile your scripts

caladbolg07
12-05-2010, 08:40 PM
Hi,

I was going through this topic on the forum and saw that many people had some experience putting vehicles into the unreal engine.

I seem to be running into some issues while putting in my vehicle. I wanted to import a bike into the udk and I have written the script based on the scorpion class. Here are the pics of the issue:

http://img227.imageshack.us/img227/2042/bikerf.jpg

In this pic you can see the issue clearly. The bike has fallen over and any attempts i have made to make it upright from code doesnt work.


http://img843.imageshack.us/img843/6766/bike2p.jpg

The second image is when i get onto the bike.

So, does anyone have any suggestions about how I can fix this?

geodav
12-06-2010, 01:54 PM
redo you bike/vespa don't forget bones/pivots must align along the X-axis with the Z-axis is up

Sir. Polaris
12-06-2010, 02:34 PM
See: http://udkc.info/index.php?title=Tutorials:Building_a_vehicle/2#Rotation

caladbolg07
12-06-2010, 11:06 PM
Hi,

I checked the bike mesh in maya and found that the orientation is correct i.e the bike is facing upwards in the z-axis and the bones are along the x-axis.

Any other ideas?

caladbolg07
12-07-2010, 01:14 AM
Hi,

So after changing the mesh in maya , Ive got the bike to stand up in a straight position and I can also get the wheels to turn.

I am not able to get the bike to move forward though. The code I have was written by looking at the scorpion code and it seems to work with the scorpion vehicle.

Any ideas?

geodav
12-07-2010, 01:33 PM
look through this thread as thats a common fault for beginners, wheelradius / physicassest / code.
there are lots of things that can cause it not to move, any errors in you launch.log

caladbolg07
12-07-2010, 07:51 PM
hey guys,

thanks for all the suggestions. as geodav said the issue was in the physics asset. also there were some issues in the maya file and after a bit of fooling around I managed to get it to work properly.

thanks,
caladbolg07

UT2007
01-05-2011, 02:37 AM
Thanks guy... Think now my vehicle will work since i am struggling for the Axis in Maya.

After reading all this thread, think i got it.

@caladbolg07, right now i have same side effect as your bike, my car is seating on left just like your second picture of bike. Can you tell me the solution concerning the axis u putted for the mesh in maya for having it working ?

Thanks and regards

UT2007
01-05-2011, 04:50 AM
Ok added several file formats to the Project Files and uploaded it to fileplanet...

http://wiki.beyondunreal.com/UDK/Vehicle_Tutorial


Megaupload link, file is corrupted !
Fileplanet, worked fine.

Kindly check the megaupload plz...

UT2007
01-07-2011, 02:30 AM
New questions PLEASE HELP


HELLO GUYS ! :)

here a question for experienced guys that you are. I have set all the required stuff, i am able to accelerate and all but still some part of my car seems not to have collision and so do not react to the world. (here screenshot) please help.

THE PROBLEM
http://img20.imageshack.us/i/er01.jpg
http://img20.imageshack.us/i/er01.jpg

The parameter
http://img593.imageshack.us/i/er02.jpg
http://img407.imageshack.us/i/er03.jpg
http://img148.imageshack.us/i/er04.jpg
http://img593.imageshack.us/i/er02.jpg
http://img407.imageshack.us/i/er03.jpg
http://img148.imageshack.us/i/er04.jpg

Somebody help me and tell me what i forgot or missed and causing my vehicle not to collide and work.

NOTE : i exteded from UDKVehicle and not from UTScorpion.

geodav
01-07-2011, 02:07 PM
check for typo's in your wheels - classes
have you added the perpolycollisions bone names in the mesh editor

UT2007
01-08-2011, 01:17 AM
Good news is i found out how to set proper axis on Maya without doing any rotation to the mesh; so you will have X forward,Z up just like the scorpion when you import.

http://img221.imageshack.us/i/er01.jpg/
http://img577.imageshack.us/i/er02.jpg/

Problem still exist http://img818.imageshack.us/i/er00.jpg/

What's funny is, when i take the script i did and extending from UDKVehicle, and attach the scorpion to it
instead of my car, the scorpion is able to work fine !

Is it because i didnt attacht the animation node in the animationTree (check screenshot), scorpion have one but i dont.
Something in the skeletalmesh editor (animset) which i must set/create which i missed ?


Please help, Regards.

geodav
01-08-2011, 03:15 PM
questions for you
1. does this happen to just one wheel, have you tried reversing into that area
2. have you tried it on a different map
3. do you have any errors/warnings when you compile your scripts
4. do you have any errors/warnings in your launch.log when you play the car

UT2007
02-11-2011, 02:20 AM
Sorry i didnt update you people.


Got it working, i guess now i need to write a Maya v2010 tutorial for vehicle in UDK.

Here some photos of me enjoying my beta vehicle with what i have done so far.

http://img89.imageshack.us/img89/6108/enjoying1.jpg
http://img835.imageshack.us/img835/2311/enjoying2.jpg
http://img259.imageshack.us/img259/2585/enjoying3.jpg
http://img840.imageshack.us/img840/5213/enjoying4.jpg
http://img98.imageshack.us/img98/5498/enjoying5.jpg
http://img521.imageshack.us/img521/4897/enjoying6.jpg


Just need to recheck the wheel radius, but this is not a priority for now since i know where to do that ...

hmmmmm now what's next... weapon done, vehicle done, character ? or polishing the beta game ? ...hmmmm lets see

But you know i am not happy since the way UDK does suspension isnt what i have in mind,

UDK DOES
http://img84.imageshack.us/img84/8691/whatudkdoes.jpg

WHAT I WANT
http://img510.imageshack.us/img510/5046/whatiwant.jpg

because me i dont want it to rotate with the lookat in animtree as UDK does, i want it to go down and up by stretching
Is somebody there can tell me how to accomplish this suspension ?

Please assist.

UT2007
02-11-2011, 02:22 AM
if anybody idea for my suspension, please tell me

geodav
02-11-2011, 02:03 PM
i see that you've posted in nearly every vehicle thread on the forum read http://udn.epicgames.com/Three/SettingUpVehicles.html

also if you read the above page you will notice that when you export your vehicle you need to extend the suspension to the lowest limit.

then you need to write the code for an automatic leveling vehicle as most vehicles in the real/unreal world align themselves to the angle of the ground

UT2007
02-12-2011, 01:44 AM
i see that you've posted in nearly every vehicle thread on the forum read http://udn.epicgames.com/Three/SettingUpVehicles.html

also if you read the above page you will notice that when you export your vehicle you need to extend the suspension to the lowest limit.

then you need to write the code for an automatic leveling vehicle as most vehicles in the real/unreal world align themselves to the angle of the ground

1. http://udn.epicgames.com/Three/SettingUpVehicles.html i have read this 20 times with more than 15 tries before asking in forum ;)

2. i know, and the suspension is at his lowest limit.

3. write a code ? to make it stretch right ahead the Z axis up and down i need to write a code ? if you are right then please sir, explicite your idea with more details so i can write it. What the code should do and where ?, which classe to extend ?, etc... please explicit your idea with more detail

tegleg
02-12-2011, 07:40 AM
if you are asking what class to extend for this suspension you dont stand a chance.
either fake it like i explained in the other thread or forget about it.

UT2007
02-12-2011, 09:48 AM
Fake with fat and thin cylinder like a shock absober i had that idea also but shall i remind you that UDK is rotating and not moving ? how do you want to fake it since his only movement is rotating ?

Till now i don't understand your idea on how which axis or parameter you want to fake it....

geodav
02-12-2011, 01:50 PM
post a link with your content so that people can see where your problem is, off the top of my head i think you can set the lookat's to be rotaion or translation.
as an example for my tracked vehicle tutorial (tank) i have the track section move up and down when the wheel moves up and down so it is posible you just need to look deeper into the properties.

UT2007
02-12-2011, 11:57 PM
post a link with your content so that people can see where your problem is, off the top of my head i think you can set the lookat's to be rotaion or translation.
as an example for my tracked vehicle tutorial (tank) i have the track section move up and down when the wheel moves up and down so it is posible you just need to look deeper into the properties.

Thanks for the Tank idea Geodav, let me do a tank so that i will certainly find how to accomplish my suspension.

By the way, where can i see or find your track vehicle (tank) ??

I dont remember i saw it....

tegleg
02-13-2011, 09:52 AM
at last a solution!
you got there in the end ut2007 :)
the tank is at the bottom of this page
http://sites.google.com/site/ut40kmod/UT40k_mod/udk-written-tutorials/udk_tank

UT2007
02-14-2011, 12:54 AM
Thanks, let me create a tank and see what i missed :)

Thank you guys

Avinash
02-14-2011, 09:49 PM
can any one create video tutorial ..

tegleg
02-15-2011, 06:13 AM
yes geodav has already done that

tegleg
02-16-2011, 04:47 PM
theres some problem with the gearbox :(
it only seems to have 3 forward gears, but it looks like theres 5 in the code
anyone know anything about this?


TorqueVSpeedCurve=(Points=((InVal=-600.0,OutVal=0.0),(InVal=-300.0,OutVal=80.0),(InVal=0.0,OutVal=130.0),(InVal =950.0,OutVal=130.0),(InVal=1050.0,OutVal=10.0),(I nVal=1150.0,OutVal=0.0)))
EngineRPMCurve=(Points=((InVal=-500.0,OutVal=2500.0),(InVal=0.0,OutVal=500.0),(InV al=549.0,OutVal=3500.0),(InVal=550.0,OutVal=1000.0 ),(InVal=849.0,OutVal=4500.0),(InVal=850.0,OutVal= 1500.0),(InVal=1100.0,OutVal=5000.0)))

LaViolette
02-16-2011, 06:44 PM
I believe that the two values are for reverse gears :)

tegleg
02-16-2011, 06:51 PM
so there should be 4 forward gears, and theres only 3 hmmm...

LaViolette
02-16-2011, 07:22 PM
Neutral maybe? (brakes or whatever?)

tegleg
02-16-2011, 07:25 PM
could be neutral
i wonder if i can add some more gears to the array, not many cars only have 3 gears

LaViolette
02-16-2011, 07:32 PM
Vector M12 has 3 gears :p

Anyway, I think that you can, but I doubt that you'll have to change "just" that.

Mougli
02-17-2011, 06:48 AM
theres some problem with the gearbox :(
it only seems to have 3 forward gears, but it looks like theres 5 in the code
anyone know anything about this?


TorqueVSpeedCurve=(Points=((InVal=-600.0,OutVal=0.0),(InVal=-300.0,OutVal=80.0),(InVal=0.0,OutVal=130.0),(InVal =950.0,OutVal=130.0),(InVal=1050.0,OutVal=10.0),(I nVal=1150.0,OutVal=0.0)))
EngineRPMCurve=(Points=((InVal=-500.0,OutVal=2500.0),(InVal=0.0,OutVal=500.0),(InV al=549.0,OutVal=3500.0),(InVal=550.0,OutVal=1000.0 ),(InVal=849.0,OutVal=4500.0),(InVal=850.0,OutVal= 1500.0),(InVal=1100.0,OutVal=5000.0)))


There are no gears in Unreal vehicles. Or rather, there's only one.

TorqueVSpeedCurve defines how much power to give to the wheels according to the vehicle's speed.

EngineRPMCurve is used only for the sound of engine and simulates gears, but behaviour-wise, there aren't any.

If you check my blog out, I'll be soon posting extensive articles about car physics simulation.

LaViolette
02-17-2011, 07:15 AM
Oh you're right I forgot this.
It might be possible thought to simulate gear ratios.

BTW, is there a way to change Pacejka's coefficients used by UDK?

Mougli
02-17-2011, 07:18 AM
Yes and no, as Unreal isn't using a "real" Pacejka curve. But you can change the extremum and asymptote points, which control the approximation of a Pacejka curve that's actually used.

However, keep in mind that the curve is the same for all wheels (but each wheel is able to scale the curve)

tegleg
02-17-2011, 07:41 AM
well yes i know its not real gears
there are only 3 simulated gears then

LaViolette
02-17-2011, 07:55 AM
Just to know, what's the unit of speed in udk? uu/s? (cm/s)

UnWheelModeller
02-17-2011, 07:57 AM
You can add more "gears", UnWheel 2 uses reverse, the first one listed, then 5 forward gears. And, they actually sound like gears, unlike the Scorpion.


EngineRPMCurve=(Points=((InVal=-500.0,OutVal=2500.0),(InVal=0.0,OutVal=300.0),(InV al=1149.0,OutVal=5500.0),(InVal=1150.0,OutVal=2500 .0),(InVal=2149.0,OutVal=5500.0),(InVal=2150.0,Out Val=2500.0),(InVal=2850.0,OutVal=5500.0),(InVal=28 51.0,OutVal=2500.0),(InVal=3850.0,OutVal=5500.0),( InVal=3851.0,OutVal=2500.0),(InVal=4100.0,OutVal=5 500.0)))

Steven

tegleg
02-17-2011, 09:21 AM
awesome thanks
i never even thaught to check unwheel2

zero4
02-24-2011, 09:08 AM
Hi guys!

Big thanks for all of you - this thread is really helpful!

I'm thinking about different vehicle controls. I would like to ask you guys where is the best place to start something like this.
On the left you have joystick. On the right - vehicle.
http://img220.imageshack.us/img220/2964/controlsu.th.jpg (http://img220.imageshack.us/i/controlsu.jpg/)

Uploaded with ImageShack.us (http://imageshack.us)

When I'm turning my joystick to left - car will move left (camera will be attached to vehicle with top-down view)

As I can see we have 2 options to steer the vehicle. Steering and Throttle. I gues that I'll need to check vehicle rotation and change steering depends on joystick and vehicle rotation, am I correct? Example behavior:
- My car is running in right direction
- I want to move him to left.
- Car is changing Steering to 1 and when he reach some rotation Steering will be set to 0

I'm newbie that's why I'm asking you guys for tips.

UT2007
02-24-2011, 09:09 AM
hey nice remind me these 2D game i use to play.... not very tough but dont want to go and dig the vehicle script and give here.... put specific question and i will guide....

Mougli
02-24-2011, 09:12 AM
- Car is changing Steering to 1 and when he reach some rotation Steering will be set to 0


Sound like you know what you should do.

UT2007
02-24-2011, 09:14 AM
he has idea but want to know where to start, its important to have a starting point :)

zero4
02-24-2011, 09:14 AM
Yeah I want to create top-down vehicle deathmatch game :D

I'm still newbie at programming and unreal script, so my question is general: how I can do it? I'm not asking for code but for tips how something like this can be done.



Sound like you know what you should do.

Ok then I'll start to mess with Throttle and Steering. Thanks!

Edit:
First problem :)
I'm checking rotation of my Actor and the values are weird..
When Vehicle is heading up: Actor.Rotation = 48, 615, -1
When Vehicle is heading down: Actor.Rotation = 48, 32360, -3
When Vehicle is heading left: Actor.Rotation = 48,-15831, -4
When Vehicle is heading right: Actor.Rotation = 51, 17098,0

So it will be really hard to determine when it should stop steering. I guess that there is some function to convert the values to something that will help me out, any thoughts?

I think the best place to start messing with the steering is in SetInputs, there will be a lot of if statements to make it work properly...I'm not sure if my mind will be able to create such complicated if statements :D



if(InStrafe < 0 && self.Rotation.Yaw <= 15000)
{
Throttle = 1;
Steering = -1;
}
if(InStrafe < 0 && self.Rotation.Yaw >= 15001)
{
Steering = 0;
Throttle = 1;
}
if(InStrafe > 0 && self.Rotation.Yaw >= -15000)
{
Throttle = 1;
Steering = 1;
}
if(InStrafe > 0 && Rotation.Yaw <= -15000)
{
Throttle = 1;
Steering = 0;
}

I've something like that - and it's 'like' working when I want to move left/right, but I don't know how to create something like this:
http://img263.imageshack.us/img263/1194/controls2.th.jpg (http://img263.imageshack.us/i/controls2.jpg/)

Uploaded with ImageShack.us (http://imageshack.us)

Basically I get these values from joystick:
InForward - from -2 to 2
InStrafe - from -2 to 2
So I think that there is an chance to get this working really good, but I don't think that my programming skill is enough for this :P I'll try. It would be nice to convert values from joystick to car rotation somehow - so I'll have function that will tell me how long should I steer.

Edit:
Yeah I've done it - there is couple of bugs (when vehicle is moving up and we want to move down - he will rotate twice before going down), but basically functionality is there. It was simpler that I can imagine :)

Here's the code for everyone who will like to have such functionality:


simulated function SetInputs(float InForward, float InStrafe, float InUp)
{

KatDzoja = -Atan2(InStrafe,InForward);
KatDzoja *= RadToDeg;

KatDzoja = KatDzoja*32767.0f/180;

Steering = 0;
Throttle =0;

if(Rotation.Yaw < KatDzoja)
{
Steering = -1*Abs(Rotation.Yaw-KatDzoja)/32767.0f;
Throttle = 1;
}
if(Rotation.Yaw > KatDzoja)
{
Steering = 1*Abs(Rotation.Yaw-KatDzoja)/32767.0f;
Throttle = 1;
}


}


I've another question for you guys: anyone know how to attach an weapon to SVehicle? I know that we have UTWeaponVehicle (or similiar) but I don't want to use UT classes, anyone know how we can add weapon to vehicle? I mean what should be the best approach to add an weapon to vehicle?

Mougli
02-25-2011, 08:11 AM
Vehicles are Pawns, so they can have weapons and inventory in the exact same way as a "normal" character.

zero4
02-25-2011, 08:18 AM
Yeah I got it working but I've another issue :) : http://forums.epicgames.com/showthread.php?t=765029

There is a lot of Aim functions there I don't know which should be used to just spawn the projectile and move it in gun direction.

UT2007
02-26-2011, 11:23 AM
.....


very interesting what you are doing.... i really interested to see it working in final result :p

Tsepeche
02-26-2011, 06:05 PM
So... There seems to be yet another problem with my car..
http://img.photobucket.com/albums/v725/l6bit/TFRB22tmp.jpg
It handles smoothly and goes by ground speed, but it's constantly lifted up like that and I have no idea what's even causing it.. I've messed around with the code but nothing seems to fix the problem, any ideas?

Mougli
02-26-2011, 06:13 PM
Does this happen only when you move forward? If so, reduce ChassisTorqueScale in your UDKVehicleSimCar

Jetfire
02-26-2011, 07:39 PM
You can add more "gears", UnWheel 2 uses reverse, the first one listed, then 5 forward gears. And, they actually sound like gears, unlike the Scorpion.


EngineRPMCurve=(Points=((InVal=-500.0,OutVal=2500.0),(InVal=0.0,OutVal=300.0),(InV al=1149.0,OutVal=5500.0),(InVal=1150.0,OutVal=2500 .0),(InVal=2149.0,OutVal=5500.0),(InVal=2150.0,Out Val=2500.0),(InVal=2850.0,OutVal=5500.0),(InVal=28 51.0,OutVal=2500.0),(InVal=3850.0,OutVal=5500.0),( InVal=3851.0,OutVal=2500.0),(InVal=4100.0,OutVal=5 500.0)))

Steven

Heh same solution I arrived at the other day :) Now it just needs some elegant solution to some mechanical clanking at the appropriate points (ps vehicles are all automatics, so no input event to hang a sound off)

Tsepeche
02-26-2011, 10:54 PM
@Mougli
If you're talking about my car, no that's it sitting in idle.

*edit*
Fixed it, turns out I needed to lower the WheelSuspensionStiffness from 50 -> 15

Ga2Z
03-22-2011, 02:49 PM
Hello guys.

What an awesome thread =D!! it really helped me to get on the track making a vehicle I alreadye have it driving around but I cant't find where can I asign the morphers to the corresponding damage, I made the animtree anda I asigned the morpher set by code but I don't know where to look for that part in the code.

Any help would be apreciated.

here's my car, it needs to be tweaked a lot, specially the suspension and the speed, I read here that TorqueVSpeedCurve is the right variable to tweak so I'll try that...

http://img707.imageshack.us/img707/8475/88384785.png (http://img707.imageshack.us/i/88384785.png/)

http://img40.imageshack.us/img40/4411/58851406.png (http://img40.imageshack.us/i/58851406.png/)

geodav
03-22-2011, 02:53 PM
follow my UT3 vehicle tutorials they will help you

Ga2Z
03-22-2011, 03:41 PM
follow my UT3 vehicle tutorials they will help you

Actually, I didn't expect you would answer so fast jaja because I'm trying to follow this links http://sites.google.com/site/ut40kmod/UT40k_mod/ut3-video-tutorials

but everyone concerning to vehicles take me to some ign site and there's nothing...

*EDIT* I finally did it =) thanks

Ga2Z
03-28-2011, 05:22 PM
hello, I've seen that the scorpion vehicle get some parts loose when it receives damage, for example the front engine door or the wheels "protectors" (don't know how to say it in english), these parts get loose an move acoording to some physic I think.... anybody knows how to achive this?

UT2007
03-29-2011, 03:13 AM
hello, I've seen that the scorpion vehicle get some parts loose when it receives damage, for example the front engine door or the wheels "protectors" (don't know how to say it in english), these parts get loose an move acoording to some physic I think.... anybody knows how to achive this?

Damage Nodes + Morph Nodes

http://udn.epicgames.com/Three/SettingUpVehicles.html
http://sites.google.com/site/ut40kmod/UT40k_mod/ut3-video-tutorials

Ga2Z
03-29-2011, 09:37 AM
Damage Nodes + Morph Nodes

http://udn.epicgames.com/Three/SettingUpVehicles.html
http://sites.google.com/site/ut40kmod/UT40k_mod/ut3-video-tutorials


Thanks but that is not my question, I already use the morph nodes and they're working =)

I'm asking about the pieces of the scorpion that get loose and move with the inertia of the car, or for example: GTA, when the car doors are open, they move with the physics and sometimes get closed.

I'm not asking either about the gibs that fly away when the car explodes

*EDIT*

Exactly, I would like the rear bumber to fall from one corner and hit the ground as the bus moves

*EDIT 2*

Guess I found it in the animtree of the scorpion, the damage nodes are the DamageSpring I guess, the question now is: how are they controled by code??

tegleg
03-29-2011, 10:08 AM
in scorpion_content
DamageMorphTargets(0)=(InfluenceBone=LtFront_Fende r,MorphNodeName=MorphNodeW_LtFrontFender,LinkedMor phNodeName=MorphNodeW_Hood,Health=30,DamagePropNam es=(Damage2))

Ga2Z
03-29-2011, 11:28 AM
in scorpion_content
DamageMorphTargets(0)=(InfluenceBone=LtFront_Fende r,MorphNodeName=MorphNodeW_LtFrontFender,LinkedMor phNodeName=MorphNodeW_Hood,Health=30,DamagePropNam es=(Damage2))

yes, that controls the morph assigned to the bone, but yet again that is not my question

tegleg
03-29-2011, 11:43 AM
you said you found it in the animtree?
when the said bone (InfluenceBone=LtFront_Fender) gets damaged to Health=30
these morphs in the animtree will get called.
it uses a spring so anything thats skinned to that bone will hang off as if on a spring (or broken)

if i understand correctly, and i might not

Ga2Z
03-29-2011, 11:54 AM
you said you found it in the animtree?
when the said bone (InfluenceBone=LtFront_Fender) gets damaged to Health=30
these morphs in the animtree will get called.
it uses a spring so anything thats skinned to that bone will hang off as if on a spring (or broken)

if i understand correctly, and i might not

ahhhhhhh okokok, thats the answer I was looking for, thank you very much =)!!! I'm going to try it later.

Now I have another question jajaja I'm trying to assign a particle system template that it can be seen all the time, It is smoke that comes out from the exhaust but the code says this for this kind of effects :


VehicleEffects(0)=(EffectStartTag=BoostStart,Effec tEndTag=BoostStop,EffectTemplate=ParticleSystem'WP _RocketLauncher.Effects.P_WP_RockerLauncher_Muzzle _Flash',EffectSocket=Bus_Humo)

this works when I activate the boost, and it assigned the effect to my socket named "Bus_Humo" but it only works when is boosting and I don't understand where those EffectsStartTag and stop tag are assigned, and I can't just assign the particle to the socket... well at least don't know how :p

geodav
03-29-2011, 01:49 PM
change

EffectStartTag=BoostStart,EffectEndTag=BoostStop

to


EffectStartTag=EngineStart,EffectEndTag=EngineStop

tegleg
03-29-2011, 02:07 PM
to start or stop the effect in code use VehicleEvent()
VehicleEvent( 'BoostStart' );

Ga2Z
03-29-2011, 02:55 PM
Thanks!

I tryed the VehicleEvent but for some reason it didn't work... that unrealScript is dark magic for me :/

geodav
03-29-2011, 03:12 PM
like i said above to get the exhaust smoke to work do as i say
change


EffectStartTag=BoostStart,EffectEndTag=BoostStop

to


EffectStartTag=EngineStart,EffectEndTag=EngineSto

doing this will start the exhaust smoke when you enter the vehicle and stop it when you exit

Ga2Z
03-29-2011, 03:23 PM
like i said above to get the exhaust smoke to work do as i say
change


EffectStartTag=BoostStart,EffectEndTag=BoostStop

to


EffectStartTag=EngineStart,EffectEndTag=EngineSto

doing this will start the exhaust smoke when you enter the vehicle and stop it when you exit

ah sorry I didn't claryfied it, it worked like a charm =) thanks!!

I was just saying that some days ago I tryed the VehicleEvent but no result.

And now that I wrote.... here's a question hahahaha

My car wheels spin really fast when they're not touching the floor, any ideas why is that? (is not an issue but looks a little weird)

geodav
03-29-2011, 03:30 PM
check your wheel radius settings

phoenix401
04-29-2011, 08:18 AM
Once you have attached your vehicle components to the main component (they all become one color), is it normal that you cannot select the individual pieces any longer?

I am not seeing how to create child bones, attach F_L_Tire to Root_Bone, how is this done?

Lastly, once I create a bone do I have to attach it to the vehicle some how?

phoenix401
04-29-2011, 11:27 AM
Well I think I figured out how to attach the bones but they don't show up in the hierarchy window like it appears in a lot of other tutorials. I linked them and when I adjust one the other adjusts as well. I added a skin and attempted to attach the bones and weight them but when I try to move the wheel down (to the lowest point for suspension) the bones just move and not the wheel/vertices... so I am not sure what the deal is.

I tried to export using ActorX and I got a PSK file which successfully imported to UDK. In the content browser I see the model, and the bone hierarchy looks appropriate (Root_Bone -> Sub Bones), but when I add the vehicle to the map nothing shows up. I can see the reference point for where the vehicle should be but the mesh is not there... perhaps I missed something when I exported. I really wasn't sure on the whole exportation process; however, progress is progress.

Also the Scale tool does nothing to the point, so I am assuming there is some thing missing from the PSK file. Can anyone help me out with the gist of a successful export from 3ds to UDK using ActorX? I am fairly certain that even if my bones and skin aren't right that I should at least be able to see my vehicle on the map. Once I have that I can keep playing with the skin and bones until I get it right and then add all the sockets.

For reference, I am just trying to put my vehicle skeletal mesh in the place of the scorpion skeletal mesh.

phoenix401
04-29-2011, 11:43 AM
it is probably a problem if under the scene info in ActorX the skin properties all read as 0s, right? Maybe I need to figure out this who linking and skinning thing.

geodav
04-29-2011, 01:24 PM
no watch all the vehicle tutorials, you have to create the code files then compile them, after that in the editor you place the vehiclefactory, if your 3d programm doesn't show the bone hierary correctly then you have to switch it to show as children

phoenix401
04-29-2011, 02:15 PM
When you say code files do you mean the VehicleContent, VehicleFactory, and Vehicle classes? I have those created and compiled with out an issue but like usually I could just add the Skeletal Mesh to the map and have it be visible but in this case it is not visible. I will take a further look into the tutorials again.

Thank you for your responses and the tutorials, they're well done!

phoenix401
04-29-2011, 10:57 PM
any ideas why a skeletal mesh, when added to the map, would not show up? It seems to be a point but even the point isn't visible... I can just see it because the translation tool is selected for the added object.

phoenix401
04-30-2011, 04:49 AM
Odd, when I play the map from within the editor although I can't see the vehicle in the editor when playing I can see the ghostly shape (translucent version) or the vehicle.

UnWheelModeller
04-30-2011, 10:25 AM
If you are using two monitors, open the log window in the secondary monitor so you can see it while you start a "play in editor" game. The log window will write some of the errors for your vehicle. If you use just one monitor, have it open before you play in editor, and you can see any errors after you exit the game.


any ideas why a skeletal mesh, when added to the map, would not show up? Some editor display modes show only the pivot point.

Steven

T.I.P.
05-01-2011, 09:20 AM
Hello! Show you how you can make a speedometer in UDK?
How can I use the handbrake in the UDK?

phoenix401
06-01-2011, 12:00 AM
So I am attaching some pictures to explain what I am talking about, but I am having a problem with my skeletal mesh inside the editor.

editor-view.JPG (http://www.intriguingds.com/documents/editor-view.JPG)
package-view.JPG (http://www.intriguingds.com/documents/package-view.JPG)
game-view (http://www.intriguingds.com/documents/game-view.JPG)

In the editor view only the pivot point is shown (I think), in the package view my vehicle looks spot on perfect and it looks solid (as in not transparent); however, in game the vehicle is transparent, the wheels are all over the place (but they move), and the whole vehicle is partially sunk into the ground. The vehicle drives and reacts to the surface terrain but I need to figure out why I am getting such different views.

I would take a solid looking checkered pattern, but it would be a huge bonus if I could get a simple color overlay. Any thoughts?

My other problem is my original 3ds file where I did the bones and assembled the vehicle from various files is no longer exporting and importing correctly and therefore I really need to fix this in the editor if possible.

geodav
06-01-2011, 02:01 PM
afaik you can't fix things like that in udk, you need to do it in your 3d programm

ps posted on your other thread ;)
pps if your having problems with "my" tutorials then please post on my support thread

phoenix401
06-01-2011, 02:30 PM
I used a collection of tutorials and primarily just curious if anyone has seen results like this before. I guess I will try to remake the file and apply a simple material... what do you make of the disconnect between the chassis and the wheels? Do I need to do some kind of welding/assembling in 3ds?

geodav
06-01-2011, 02:40 PM
just make sure the bones are linked together correctly in max.

the rest is done in the animtree + code

phoenix401
06-02-2011, 09:26 AM
Well I got a successful import export and now I can see the vehicle in the editor window and it looks solid in game; however I am still having the issue where it is sinking below the surface terrain? Additionally, to get the wheels of the vehicle to import I did some kind of weird linking and now they no longer animate or articulate when you turn... perhaps because I linked them in 3ds, maybe I just need to assign them to bones, which is what I think I did last time but it didn't save for some reason.

Any thoughts on the sinking below the surface issue?

geodav
06-02-2011, 01:50 PM
ok the mesh needs to be a single mesh, i mean all of it wheels/weapons/bits and pieces.
download my DavCorp content and have a look at the landbuggy max file

sinking could be physicasset / suspensetion / wheel radius .....

phoenix401
06-02-2011, 04:11 PM
Hmm, focusing on the simplest thing you mentioned, I did not update any code related to wheel radius (and I didn't look for it). I kind of assumed that the code would automatically update wheel radius size when I loaded my vehicle in.

geodav
06-03-2011, 01:50 PM
all i can suggest is to follow my tutorials as they are proven to work, then post on my support thread and we can try and solve the problems your having

tegleg
06-03-2011, 03:47 PM
all i can suggest is to follow my tutorials as they are proven to work
this is very true
you might have to go through all the vehicle tutorials to get the info you need but its well worth it.

tegleg
06-09-2011, 10:19 AM
heres a 3ds max to udk car runthrough to complement goedavs tutorials
http://www.youtube.com/watch?v=KVxgdvDD3P4&feature=channel_video_title
hopefully if will help someone out

Pete_Bottomley
06-13-2011, 03:55 PM
Hey guys, especially Geodav, tegleg, XxXdanceXxX, Mougli (sorry If I missed anyone),

Thank you for all your help with importing custom vehicles. Whenever I encountered a problem I read and re-read these threads along with watching your video tutorials and downloading all the content. So much support. No questions because you've already solved any issues i've had, just a big thank you!

Cheers guys and thanks for the continued support!

UT2007
06-16-2011, 04:54 AM
Yeah but thing is, this threa has so many pages and its so big ! sometimes i just feel i can solve it by strugglin rather than reading all these pieces cut and putted on random pages of this thread. Guess what till now i am doing OK !

but thats not a suitable solution, i shall prefer to regroup all post putting everything thats must be know and memorized in ONE POST and if possible at another new thread so that it will be on the first post of first page.

tegleg
06-16-2011, 06:03 AM
feel free to do that ut2007

UT2007
06-16-2011, 06:08 AM
Yes, sure.

Frankly i thought about it but was asking myself if people out there prefer reading all pages of this thread or having one manual, i dont want to do if not usefull.

ronnie42
08-04-2011, 01:47 PM
Little confusing, I understand how to import basic imports of 3d static models but unsure how to get it done with heavy kismet, etc.... and using 3ds max.

Ga2Z
10-10-2011, 02:11 AM
Hello, I'm trying to do a steering wheel, I used a bone and I'm using a SkelControlWheel for steering in the animTree, just like a normal wheel and it's steering left and right like I want to, but it is also rotating >.<

So, I connected a UTSkelControl_LockRotation node, and I locked Pitch and Yaw, It kinda does it but when I turn the steering wheel starts rotating like crazy... any ideas please??

Thanks

EDIT: I got it =) messed up with somethings in the code and looks like it solved it jeje

Raayaar
10-17-2011, 06:41 AM
Hi, guys!
I have a simple question: is it possible to make a vehicle drift in UDK? I mean, the default Scorpion is almost glued to the ground and when I messed with long and lat slide factors, it started to behave very unrealistically. I have tweaked and tried a lot of variables in various Scorpion and Vehicle files, but no success so far.

tegleg
10-17-2011, 06:43 AM
download my big van thing from my tutorial thread and have a look at that, it drifts quite well.

Raayaar
10-17-2011, 06:46 AM
Cool, will take a look, thanks!

XxXdanceXxX
10-22-2011, 08:46 AM
UT2007, if you gather all the most important info in this thread i will put it in the first post...

geodav
10-22-2011, 09:32 AM
@Raayaar try playing with the COMOffset= (CenterOfMass)

tegleg
10-22-2011, 09:52 AM
it would be quite a job to gather all the good info into 1 post, good luck with that.

Raayaar, good ballance is important, have the main bone in the exact center and on the floor of your vehicle. you can also play with this in code like geodav said.
also the shape and size of your vehicle plays a role.

once you get it drifting, change this to help stop it just spinning out and hold those big drifts :).
WheelLatAsymptoteSlip=12.5

HavocInferno
10-23-2011, 11:43 AM
I just began doing this tutorial: http://udkc.info/index.php?title=Tutorials:Building_a_vehicle/3
Now I'm struggling with the 3rd page. The rigging part is in maya, and I am using blender, but for god's sake I can't figure out how to get it to work.

I placed the Main_Root bone somewhere in the center of the car, then extruded 4 bones to each wheel, so that the big side of the bone faces towards the Main bone. Each wheel is a separate object in blender as weel as the chassis. I assigned the objects to the bones by selecting each object and its bone, then pressing Ctrl+P and choose "Bone". But when I export it to UDK to test its scale, the skeleton is messed up, with the main bone being at the right spot, but all 4 wheel bones being put into one spot below the main bone...
How would I fix this? Or could anyone rewrite/add the rigging chapter again with Blender?

https://lh6.googleusercontent.com/-cgZIO-xHckw/TqQ1dTk0MZI/AAAAAAAAAes/Y1BT2rPATfE/s859/Unbenannt.PNG (http://udkc.info/index.php?title=Tutorials:Building_a_vehicle/3)

geodav
10-23-2011, 01:58 PM
i'm trying to get blender to work/export the way i+udk wants i'll post a video on my youtube channel when i get there

XxXdanceXxX
10-24-2011, 09:14 AM
HavocInferno, im not sure about blender but one of the problems i had is the model was in multiple objects so i had to merge all the objects into one, then i placed the bones and the i skinned and then i assigned the bones to the vertices of the one object...

DemoMan2
10-24-2011, 11:48 AM
Thanks GeoDav! I look forward to your tutorial on vehicles for UDK using blender. I've had a tough time with the importing process and would recommend when you make your video to explain how to FIX some of the most likely problems with the import process. Everyone always assumes that you know how to do this but I am new to blender and could use the help. Also, I'm using blender 2.60

UnWheelModeller
10-24-2011, 01:25 PM
Here is a complete sample vehicle, for use in Blender, with attached armature ready for export to UDK. It works for 2.49b with Darknets .psk export script.. I plan on adding the vehicle sample for UDK as well with materials, PhysicsAsset, Physical Material and AnimTree.
The armature can be removed from the car by selecting the car, then Shift select the armature, hit Alt-P and select Clear Parent. You can then append your own vehicle with the armature from the sample car.

http://dl.dropbox.com/u/30448751/Sample_Car.zip

Steven

XxXdanceXxX
12-22-2011, 03:36 PM
Thanks Steven...

Almostpeaceful74
02-21-2012, 12:21 AM
Hi everyone!

I'm trying to get a custom flying vehicle into UDK. I made a mesh in 3ds max, added a root bone (it's an airship with no moving parts so I only have one bone), skinned it to the model, imported it into UDK and set up a physics asset and animtree, and made my own class extending UTAirVehicle, but when I go to actor classes to add it to the level, it isn't there. Any idea what I'm missing? I followed a tutorial and made a simple wheeled car that worked fine.

Any help would be extremely appreciated!

geodav
02-21-2012, 01:48 PM
try making a vehiclefactory class for it

Almostpeaceful74
02-21-2012, 10:24 PM
Thanks.
So I made a vehiclefactory class and a vehiclecontent class, based off the cicada's, and got it to show up in the game, but now it appears correctly in the editor but as soon as I hit play it turns into a cicada..

I made sure that the .uc files reference the airship mesh, and in fact there are no mentions of the cicada mesh at all.

gardian06
02-21-2012, 11:47 PM
are you sure it is calling your factory, and not the one for the cicada. try putting a log call in your factory where it generates the object into the world. the next option is see what happens when you take out the stuff that would make a cicada in the world..

Almostpeaceful74
02-22-2012, 12:59 AM
yep, figured it out. the factory was calling the cicada's content file. Now it's in game, and I just have to get it to work properly.

Thanks for the help! :)

Almostpeaceful74
02-22-2012, 02:45 AM
Any tips on how to get the camera to pivot around the vehicle itself, rather than pivoting in space behind it?

This is my camera code, taken from Tegleg's vehicle camera tutorial:


var() name CameraTag;

simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
{
local vector X, Y, Z;

GetActorEyesViewPoint( out_CamLoc, out_CamRot );

GetAxes(Rotation, X, Y, Z);

out_CamLoc = Location - 520 * X;

out_CamLoc.Z = Location.Z + 180;

// out_CamRot.Yaw = Rotation.Yaw;

// out_CamRot.Pitch = (-22.0f *DegToRad) * RadToUnrRot;

return true;
}

tegleg
02-22-2012, 06:06 AM
use a socket location, then you can have it wherever you like

Almostpeaceful74
02-22-2012, 06:04 PM
sorry, I'm not sure I understand. I don't need to change the position of the camera, just the way it moves.

Here's what I have:
http://www.mediafire.com/imgbnc.php/d4a083581c4e2efd4cd622702e5c63175ceb1da73a7905bf3a 59bc1658a8a1ec5g.jpg

and here's what I'm trying to do:
http://www.mediafire.com/imgbnc.php/bf987031a482e27a2e47989d19153f12e8146c6879c029b257 70934fa0eb077c5g.jpg

EDIT:
Also, can someone point out to me how/where I can change the controls of the vehicle? I'm trying to have the mouse only control the camera, and use "A" and "D" for Yaw rather than strafe.

gardian06
02-23-2012, 01:16 AM
you could maybe put a state in the camera class with the different applications of your exec functions

MyCamera.uc
class myCamera extends Camera;
...
exec Wpress() // or whatever the exec that you have is
{
...
}
State normal
{
exec Wpress()
{
...
}
}
State airship
{
...
exec Wpress()
{
...
}
..
}


code will not work, but the structure should be applicable.

Almostpeaceful74
02-23-2012, 02:15 AM
well so far what I'm doing is editing a calcCamera function in the Airship class itself, the camera doesn't have its own file. Should I make one for it? The only time the game needs this camera style is when the player is using an airship

tegleg
02-23-2012, 03:50 AM
the controls are set in SetInputs()
and the key bindings are set in DefaultInput.ini

for the camera you dont need a seperate camera class


simulated function VehicleCalcCamera(float DeltaTime, int SeatIndex, out vector out_CamLoc, out rotator out_CamRot, out vector CamStart, optional bool bPivotOnly)
{
out_CamLoc = Location;
out_CamRot = Seats[SeatIndex].SeatPawn.GetViewRotation();
}

Almostpeaceful74
02-24-2012, 01:39 AM
thanks tegleg!

I tried what you suggested, but all I could get it to do is move the position of the camera, rather than its focus. I put together a workaraound using the law of sines to figure out the position of the camera based on camera pitch and yaw, that finally seems to be working ok, but i still can't figure out how to stop the camera from steering the airship.

Is there a way I can shut off looktosteer so that the vehicle's steering and speed are controlled with just the wasd keys, and not the mouse? I tried changing defaultinput.ini but that changes the controls for the whole game, rather than just the vehicle, and I don't really understand how SetInputs() works :confused:.

Thanks for being so helpful! It means a lot.

tegleg
02-24-2012, 02:15 AM
LookSteer() is called in SetInputs()

have a look in the class that your vehicle is extended from

Raayaar
06-02-2012, 02:29 PM
Hey, guys...
I followed a very good tutorial on youtube (http://www.youtube.com/playlist?list=PL331250169FCD493F&feature=plcp). It all went well, but my car always moves sideways instead of forward. I went through the tut 3 times now, but I always get the same result. And from the comments it looks like I'm not the only one, a few of us have this problem.
Did it happen to any of you? There must be a switched axis of translation, or something... Do you have any idea what could it be?

tegleg
06-02-2012, 02:39 PM
you need to make sure your bone axis and everything are the correct allignment in your 3d moddeling app.

Raayaar
07-14-2012, 08:52 AM
Yes, that was the problem... But the funny thing is that I aligned the bones as the official UDN page says and it was wrong. In Maya the root bone should apparently be aligned in +y, not +x direction. I also have the up axis switched to Max's setting so that shouldn't be a problem.

BTW, tegleg, thanks for your great vehicle examples on your site. It's so freaking hard to make unreal vehicle drift and you made exactly what I had in mind there. I hope that by looking through your examples I can find out what's the secret :)

tegleg
07-14-2012, 08:01 PM
Yes, that was the problem... But the funny thing is that I aligned the bones as the official UDN page says and it was wrong. In Maya the root bone should apparently be aligned in +y, not +x direction. I also have the up axis switched to Max's setting so that shouldn't be a problem.
thank you :)
so that is confirmed that the alignment in maya on the official page is wrong?
this has been the pain in the rear for a long time in a certain project im working on so it would be good to know?

willpinataman
07-15-2012, 06:53 AM
Hi guys thanks for the tutorials really helped me a lot but I have a problem. I can't get the brake power to increase no matter how high I set the brake torque and enginebrakefactor (I am changing them in editor as opposed to code for testing if that has an effect?) What reason could this be or is there simply a max that it can't exceed?

tegleg
07-15-2012, 08:24 AM
increase LatSlipFactor to make the tyres more grippy

willpinataman
07-15-2012, 08:42 AM
increase LatSlipFactor to make the tyres more grippy

Lat slip doesn't seem to have much effect on brakes without effecting the handling, wouldn't long slip have more of an effect?

tegleg
07-15-2012, 10:03 AM
ah yes i meant long slip sorry, it will also make your vehicle accelerate faster so you might need to adjust your torque speed curve.

willpinataman
07-15-2012, 11:15 AM
ah yes i meant long slip sorry, it will also make your vehicle accelerate faster so you might need to adjust your torque speed curve.

Thanks I never thought about doing it that way! Two other quick questions. When I use a steering wheel I have a huge dead zone how can I reduce this?
And for car noises how can I make them I'm assuming getting them off a real life car would not be within copyright or what ever?

Raayaar
07-16-2012, 03:41 AM
thank you :)
so that is confirmed that the alignment in maya on the official page is wrong?
this has been the pain in the rear for a long time in a certain project im working on so it would be good to know?
Yes, I can confirm that in my case I had to turn the root bone so that its local +x axis is aligned with world +y direction. I also contacted the guy who made the tutorial I mentioned above and he also had to do it in Max. So it looks like UDN really got it wrong :) It's also possible it's just a bug in UDK.