Announcement
Collapse
No announcement yet.
refreshing myself on the vehicle systems
Collapse
X
-
gaz661 repliedhttps://youtu.be/5L1UbRqZnTo
writing the parachute script was simpler than I thought.i will post it when ive finished tweaking it.
Leave a comment:
-
gaz661 repliedthanks frankit.
in vehicles,only components attached to the root bone give proper collision (unless you set bUseSingleBodyPhysics=0,but then the vehicle wont fly) so I surrounded the cargo area with 5 box components in the phat editor.
to get into the cargo area in flight ive attached a dynamic pathnode and spawn/possess a pawn from there.the figures in the top right are for the ac-130 and you can see when I open the rear doors the speed drops from 280 mph to around 150 with no loss of player control.if you jump while in the back you do travel backward in relation to the plane which isn't realistic,but hay ho.
at the moment there is still 1 area where you get pinched by the phys asset and killed but I think I can tweak it.
still lots to do,but its all working in principle so I will crack on.i will do a gunship variant too.
the flight nodes are based on the race nodes from the donnington map but ive made them dynamic so I can alter the flight path.the bot heads to them in reverse order.(which you can see top left) if the player takes control and then flys of route before handing control back to the bot,he will head back to his last flight node and continue.
the plane script is based once again from 1 of teglegs scripts.thanks teg.
the Ferrari is still half done,i got sucked into character modelling.i will post some results of that soon.
Leave a comment:
-
frankit repliedNice to see you back dude! Very interesting clip...
Q: How does the player walk about the cargo area without being affected or flung out by the motion of the airplane, if you speed up the plane does it make a difference?
BTW: How did the Ferrari turn out? (*cough* asking totally unselfishly)
Leave a comment:
-
gaz661 repliedwhat with 1 thing and another,ive not used udk very much in the last couple of months,but I have been busy in max.mainly on characters.but ive also built this and using a variant of the race pathnodes ive finally got a plane that bots can fly.
theyre not fully autonomous but it works well enough for my purposes.you can even free walk in the cargo bay whilst the bot flys it.happy days.
https://youtu.be/yj2BhFiNih4
Leave a comment:
-
gaz661 repliedtalk about leaving things till the last minute,but its done.
you can download the donnington demo from my website.see my signature below.
enjoy.
edit:sorry,looks like the download isn't working and nothing I can do for a week.i was up all last night trying to upload to my site but godaddy had changed all the servers since I last did anything and it kept timing out.thought I got it sorted this morning,but alas,not.
Leave a comment:
-
tegleg repliedive had an abandoned racing game maybe 70/80% coded sitting around for ages but im not good enough at environment modeling ect to complete it on my own.
its a good experience making a game that has a pre-defined set of simple rules. i learned a lot from it.
best of luck wherever you take it gaz, and thanks for giving stuff away. its good to share the knowledge
Leave a comment:
-
gaz661 repliedI hadn't even thought about making a racing game until halfway through this thread.
Leave a comment:
-
Sci-Fi repliedHay gaz661 have you ever thought about making a rally sport race game?
Leave a comment:
-
gaz661 repliedMaxSpeed=11000 was left over from tegs code.
the lambo has a max speed of 3150 and that equates to 240 something mph.
this setting is a default.when you place the nodes in the level,hit f4 and each node has a maxspeed var you can set individually.
Leave a comment:
-
Sci-Fi repliedThanks for the Code gaz661. I want to make the cars drive around a small city block like in GTA.
Should I change the "MaxSpeed=11000" to a smaller number to make cars move slower?
Leave a comment:
-
gaz661 repliedCode:class RaceAIController extends UDKBot; var array<Race_Pathnode> Waypoints; var int RaceNode; //declare it at the start so you can use it throughout the script var int CloseEnough; var Vector MyTarget; var bool bwantstopit; simulated function PostBeginPlay() { local Race_PathNode Current; super.PostBeginPlay(); //add the pathnodes to the array foreach WorldInfo.AllActors(class'Race_Pathnode',Current) { Waypoints.AddItem( Current ); } } function wantstopit() { bwantstopit = true; } simulated function Tick(float DeltaTime) { //use local as its only needed in this function local int Distance; local vehicle car; /// car = vehicle(Pawn); super.Tick(DeltaTime); Distance = VSize2D(Pawn.Location - Waypoints[RaceNode].Location); if (pawn != none) { if (Distance <= CloseEnough) { RaceNode--; } if (RaceNode <= 0 && Pawn.health > 200) ///558 is the first node on the track .0 is the last { RaceNode = 558; } if (RaceNode <= 1 && Pawn.health < 200) ///if health low at pit entrance make 590 the next node.590 to 559 is the pit lane { RaceNode = 590; } ///end of pits.rejoin track at 508 if (RaceNode == 560) { RaceNode = 508; } if (RaceNode <= 1 && bwantstopit == true) { RaceNode = 590; } } GoToState('Racing'); } state Racing { local int OffsetX; local int OffsetY; Begin: if (Waypoints[RaceNode] != None)// make sure there is a pathnode to move to { //set the max speed SetMaxDesiredSpeed(); //move to it ///MoveTo(Waypoints[RaceNode].Location); OffsetX = Rand(500)-Rand(500); OffsetY = Rand(500)-Rand(500); MyTarget.X = (Waypoints[RaceNode].Location.X + OffsetX); MyTarget.Y = (Waypoints[RaceNode].Location.Y + OffsetY); //so it doesnt fly up n down // MyTarget.Z = Pawn.Location.Z; // MoveTo(Waypoints[RaceNode].Location); MoveTo(MyTarget); } } function SetMaxDesiredSpeed() { local Vehicle V; V = Vehicle(Pawn); if (V != None) { V.AirSpeed = Waypoints[RaceNode].MaxSpeed; V.GroundSpeed = Waypoints[RaceNode].MaxSpeed + Rand(430) -420 ; } } //also give closeenough some velue in default properties DefaultProperties { CloseEnough=1600 racenode=548 bisplayer=true bwantstopit=false }
Code:class Race_Pathnode extends PathNode; var() int MaxSpeed; DefaultProperties { MaxSpeed=11000 bBuildLongPaths=false //this speeds up the build considerably and stops lots of interconnection which we dont need }
Leave a comment:
Leave a comment: