TRUESPACE - UNREAL3
 
driving in the game
coding the vehicle

Start by setting up the necessary files and folders

http://udn.epicgames.com/Three/UT3Mods.html

http://www.3dbuzz.com/vbforum/sv_home.php
go to the Unreal Tech video category - "[ut3] How do I..." - video series
    Obtain the Scripts for UT3
    Create New Scripts for UT3
    Compile Scripts for UT3
    Test Scripts for UT3
    Publish Scripts for UT3
at this time April 2009 thes videos are on page 5 of the how do I's

http://ut40k.planetunreal.gamespy.com/
ut3 tutorials section

additional add -useunpublished option to the make shortcut mentioned in the 3dbuzz videos
"C:\Program Files\Unreal Tournament 3\Binaries\UT3.exe" make -useunpublished

package name UTMod_ArkII
C:\Documents and Settings\Clinton\My Documents\My Games\Unreal Tournament 3\UTGame\Src\UTMod_ArkII\Classes

copy 5 uc files -

   3 from UTGameContent -
      UTVWeap_ScorpionTurret.uc
      UTVehicleFactory_Scorpion.uc
      UTVehicle_Scorpion_Content.uc

   2 from UTGame -
      UTVehicle_Scorpion.uc
      UTVehicleScorpionWheel.uc

copy by creating text files in the package folder and cut and paste text contents - if just copy the files will get the i with umlauts error
text files named UTVehicle_Roamer.uc etc. replacing Scorpion with Roamer

main root location character local
Determine a guess for the rider position based on Main_Root and an imported UT3 character b_Root

Main_Root (0, 0, 7.897)
b_root (-3.893, 2.796, -0.302)

b_root - Main_Root = (-3.893, 2.796, -8.199)

x10 = (-38.93, 27.96, -81.99)

tS mirror effect, negative Y -> (-38.93, -27.96, -81.99)

(X=0.0,Y=-35.0,Z=-72.0) final value found through trial and error


I was getting crashes caused by the ReadyToSelfDestruct function so it was commented out.


VEHICLE FACTORY

//class UTVehicleFactory_Roamer extends UTVehicleFactory;
class UTVehicleFactory_Scorpion extends UTVehicleFactory;

//SkeletalMesh=SkeletalMesh'VH_Scorpion.Mesh.SK_VH_Scorpion_001'
SkeletalMesh=SkeletalMesh'VH_Roamer.SK_VH_Roamer'

//VehicleClassPath="UTGameContent.UTVehicle_Scorpion_Content"
VehicleClassPath="UTMod_ArkII.UTVehicle_Roamer_Content"
WEAPON

//class UTVWeap_ScorpionTurret extends UTVehicleWeapon
class UTVWeap_RoamerTurret extends UTVehicleWeapon

//VehicleClass=class'UTVehicle_Scorpion_Content'
VehicleClass=class'UTVehicle_Roamer_Content'
WHEEL

//class UTVehicleScorpionWheel extends UTVehicleWheel;
class UTVehicleRoamerWheel extends UTVehicleWheel;

CONTENT

//class UTVehicle_Scorpion_Content extends UTVehicle_Scorpion;
class UTVehicle_Roamer_Content extends UTVehicle_Roamer;

//SkeletalMesh=SkeletalMesh'VH_Scorpion.Mesh.SK_VH_Scorpion_001'
//AnimTreeTemplate=AnimTree'VH_Scorpion.Anims.AT_VH_Scorpion_001'
//PhysicsAsset=PhysicsAsset'VH_Scorpion.Mesh.SK_VH_Scorpion_001_Physics'
//MorphSets[0]=MorphTargetSet'VH_Scorpion.Mesh.VH_Scorpion_MorphTargets'
//AnimSets.Add(AnimSet'VH_Scorpion.Anims.K_VH_Scorpion')

SkeletalMesh=SkeletalMesh'VH_Roamer.SK_VH_Roamer'
AnimTreeTemplate=AnimTree'VH_Roamer.AT_VH_Roamer'
PhysicsAsset=PhysicsAsset'VH_Roamer.SK_VH_Roamer_Physics'
AnimSets.Add(AnimSet'VH_Roamer.K_VH_Roamer')

/*
Seats(0)={( GunClass=class'UTVWeap_ScorpionTurret',
GunSocket=(TurretFireSocket),
GunPivotPoints=(gun_rotate),
TurretVarPrefix="",
TurretControls=(TurretRotate),
SeatIconPos=(X= 0.415,Y=0.5),
CameraTag=GunViewSocket,
CameraBaseOffset=(X=-50.0),
CameraOffset=-175,
WeaponEffects=((SocketName=TurretFireSocket,Offset=(X=-14,Y=5),Scale3D=(X=2.0,Y=3.0,Z=3.0)),(SocketName=TurretFireSocket,Offset=(X=-14,Y=-5),Scale3D=(X=2.0,Y=3.0,Z=3.0)))
)}

*/


Seats(0)={( GunClass=class'UTVWeap_RoamerTurret',
GunSocket=(TurretFireSocket),
GunPivotPoints=(gun_rotate),
TurretVarPrefix="",
TurretControls=(TurretRotate),
SeatIconPos=(X= 0.415,Y=0.5),
CameraTag=GunViewSocket,
CameraBaseOffset=(X=-50.0),
CameraOffset=-275,
//make player visible in the roamers drivers seat
bSeatVisible=true,
SeatBone = Main_Root,
//initial guess for seat position
//SeatOffset=(X=-38.9,Y=-27.9,Z=-82.0),
//final value by trial and error

SeatOffset=(X=0.0,Y=-35.0,Z=-72.0),
WeaponEffects=((SocketName=TurretFireSocket,Offset=(X=-14,Y=5),Scale3D=(X=2.0,Y=3.0,Z=3.0)),(SocketName=TurretFireSocket,Offset=(X=-14,Y=-5),Scale3D=(X=2.0,Y=3.0,Z=3.0)))
)}

/*
SpawnMaterialLists[0]=(Materials=(MaterialInterface'VH_Scorpion.Materials.MI_VH_Scorpion_Spawn_Red'))
SpawnMaterialLists[1]=(Materials=(MaterialInterface'VH_Scorpion.Materials.MI_VH_Scorpion_Spawn_Blue'))

TeamMaterials[0]=MaterialInstanceConstant'VH_Scorpion.Materials.MI_VH_Scorpion_Red'
TeamMaterials[1]=MaterialInstanceConstant'VH_Scorpion.Materials.MI_VH_Scorpion_Blue'

*/

SpawnMaterialLists[0]=(Materials=(MaterialInterface'VH_Roamer.MI_VH_Roamer_Spawn_RedBlue'))
SpawnMaterialLists[1]=(Materials=(MaterialInterface'VH_Roamer.MI_VH_Roamer_Spawn_RedBlue'))

TeamMaterials[0]=MaterialInstanceConstant'VH_Roamer.MI_VH_Roamer_RedBlue'
TeamMaterials[1]=MaterialInstanceConstant'VH_Roamer.MI_VH_Roamer_RedBlue'

//DrivingPhysicalMaterial=PhysicalMaterial'vh_scorpion.materials.physmat_scorpiondriving'
//DefaultPhysicalMaterial=PhysicalMaterial'vh_scorpion.materials.physmat_scorpion'
//looks like case doesn't matter

DrivingPhysicalMaterial=PhysicalMaterial'vh_roamer.physmat_roamerdriving'
DefaultPhysicalMaterial=PhysicalMaterial'vh_roamer.physmat_roamer'
VEHICLE

//class UTVehicle_Scorpion extends UTVehicle
class UTVehicle_Roamer extends UTVehicle

/** for roamer steering wheel **/
var() float steerSpeed;
var() float curSteer;

/** Returns true if self destruct conditions (boosting, going fast enough) are met */
//cause crash for roamer?? Yes it is
/*
native final function bool ReadyToSelfDestruct();

function bool EagleEyeTarget()
{
return ReadyToSelfDestruct();
}
*/


simulated function DisplayHud(UTHud Hud, Canvas Canvas, vector2D HudPOS, optional int SeatIndex)
{
local PlayerController PC;
super.DisplayHud(HUD, Canvas, HudPOS, SeatIndex);

PC = PlayerController(Seats[0].SeatPawn.Controller);
if (PC != none)
{
if (Throttle > 0.0 && !bBoostersActivated && (WorldInfo.TimeSeconds - BoostChargeTime > BoostChargeDuration))
{
Hud.DrawToolTip(Canvas, PC, "GBA_Jump", Canvas.ClipX * 0.5, Canvas.ClipY * 0.95, BoostToolTipIconCoords.U, BoostToolTipIconCoords.V, BoostToolTipIconCoords.UL, BoostToolTipIconCoords.VL, Canvas.ClipY / 768);
}
//cause roamer crash
/*
else if (ReadyToSelfDestruct())
{
Hud.DrawToolTip(Canvas, PC, "GBA_Use", Canvas.ClipX * 0.5, Canvas.ClipY * 0.95, EjectToolTipIconCoords.U, EjectToolTipIconCoords.V, EjectToolTipIconCoords.UL, EjectToolTipIconCoords.VL, Canvas.ClipY / 768);
}
*/

}
}

function DriverLeft()
{
/*
//cause roamer crash on exit vehicle ?
// YEP, CAUSES CRASH
if ( ReadyToSelfDestruct() )
{
SelfDestructInstigator = (Driver != none) ? Driver.Controller : None;

bShouldEject = true;
if ( PlayerController(SelfDestructInstigator) != None )
{
PlayerController(SelfDestructInstigator).ClientPlaySound(EjectSoundCue);
}

BoostStartTime = WorldInfo.TimeSeconds - MaxBoostDuration + 1.0;
bSelfDestructArmed = true;
PlaySelfDestruct();
}
else if (bBladesExtended)
{
SetBladesExtended(false);
}
*/

Super.DriverLeft();
}

/*
// roamer crash
function CheckScriptedSelfDestruct()
{
if ( ReadyToSelfDestruct() )
{
DriverLeave(true);
ClearTimer('CheckScriptedSelfDestruct');
}
}
*/

/**
* Tie roamer vehicle steering input to the steering wheel bone
* original CalcCamera in SVehicle
**/

simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
{
local SkelControlSingleBone SkelControl;//place to store skeleton control for steering wheel
const myDegreeToURot = 182.044449; // 65536/360 error already defined
local float deltaSteer;
local float realSteer;

SkelControl = SkelControlSingleBone(Mesh.FindSkelControl('Steering_Wheel_Cont'));
deltaSteer = Steering - curSteer; // Steering = -1, 0, 1 for left, center, right
realSteer = curSteer + deltaSteer * steerSpeed;
if(realSteer > 1.0)
realSteer=1.0 ;
else if(realSteer < -1.0)
realSteer = -1.0;
curSteer = realSteer;

SkelControl.BoneRotation.Yaw = realSteer * -120.0 * myDegreeToURot;

Super.CalcCamera( fDeltaTime, out_CamLoc, out_CamRot, out_FOV );
//`log("calculate camera");
return true;
}
// **************************************************************


//COMOffset=(x=-40.0,y=0.0,z=-36.0)
COMOffset=(x=-40.0,y=0.0,z=-45.0)



//Begin Object Class=UTVehicleScorpionWheel Name=RRWheel

Begin Object Class=UTVehicleRoamerWheel Name=RRWheel

//Begin Object Class=UTVehicleScorpionWheel Name=LRWheel
Begin Object Class=UTVehicleRoamerWheel Name=LRWheel

//Begin Object Class=UTVehicleScorpionWheel Name=RFWheel
Begin Object Class=UTVehicleRoamerWheel Name=RFWheel

//Begin Object Class=UTVehicleScorpionWheel Name=LFWheel
Begin Object Class=UTVehicleRoamerWheel Name=LFWheel


//BoneOffset=(X=0.0,Y=20.0,Z=0.0)

//BoneOffset=(X=0.0,Y=-20.0,Z=0.0)

//BoneOffset=(X=0.0,Y=20.0,Z=0.0)

//BoneOffset=(X=0.0,Y=-20.0,Z=0.0)

// for roamer steering wheel animation
//steerSpeed rate wheel turns when it has a steering input
steerSpeed = 0.31
curSteer = 0

// *************************



Misc Unorganized Notes

"C:\Program Files\Unreal Tournament 3\Binaries\UT3.exe" make - useunpublished
"C:\Program Files\Unreal Tournament 3\Binaries\UT3.exe" - useunpublished


tab - editactor class=utvehicle or utvehicle_roamer to fiddle with physical simulation values

tab - summon utmod_arkii.utvehicle_roamer_content to get into game without the factory

tab, god - for god mode keep from getting crushed when use summon

f10 - like tab but multi lined

f10,
   god,
   summon utgamecontent.utvehicle_scorpion_content,
   f10 back to the game

copied VCTF_Sandstorm map to unpublished CustomMaps folder so have good test map
if crashing when try to run map from editor, rename the file before starting ued.

only dynamic lights effect skeletal/static meshes

Dennys videos matinee skel mesh tutorial - http://www.vimeo.com/411379

can also run animation from properties via animSet

console command show bones
shot - screen res screen shot
tiledshot - high res screen shot

DrivingAnim - "manta_idle_sitting" riding position is defined


uTAnimBlendBYWeapon didn't get any blending in editor
UTAnimBlendByDriving get expected blending in editor, still nothing in game



http://en.wikipedia.org/wiki/Ark_II

http://www.angelfire.com/tv2/ark2/home.html

http://www.3dbuzz.com

http://udn.epicgames.com/Three/UT3ModHome.html

http://www.vimeo.com/411379

http://wiki.beyondunreal.com/

http://utforums.epicgames.com/forumdisplay.php?f=20

http://ut40k.planetunreal.gamespy.com/




Page 1   Page 2   Page 3   Page 4