creating vehicles

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

beefsack

the authority in beef
Nov 22, 2002
241
0
16
39
Canberra, Australia
beefsack.blogspot.com
i searched for vehicle threads and only found one useless to me so i will post anew.

does anyone know where i might find a tutorial on creating vehicles. i havent found a particularly helpful one yet, and have had some troubles creating one from scratch and not having it control really poorly :/ ive been told by someone to not bother subclassing kcar and just subclass kvehicle cos it gives more control but that seems very daunting...
 

beefsack

the authority in beef
Nov 22, 2002
241
0
16
39
Canberra, Australia
beefsack.blogspot.com
heh yeah so i guess it will be a lot of trial and error ;) how about this then. ive been trying to make it so that the player spawns as a certain vehicle. i managed to do it by spawning the vehicle above the player then using KDriverEnter when the player spawns, but this is messy :/ what i want to do is set the pawn class to the vehicle class that i made, but then it doesnt control like a vehicle should, the chassis only flips around when you move the mouse :/ ive been stuffing around with using bits of KDriverEnter but have had no luck yet. any ideas?
 

Radiosity

Minty Fresh!
Jan 3, 2003
2,217
0
0
45
UK
www.radiant-studios.net
Find the Hoverbike Madness mutator and have a look at the code from that, it may help you out a bit since it automatically spawns the player as one of the hoverbikes that come with the game.
 

beefsack

the authority in beef
Nov 22, 2002
241
0
16
39
Canberra, Australia
beefsack.blogspot.com
ok, sorry about the spam, but i got another related question. ive been trying to change the skin of the bulldog in the script. basically, now you can spawn as a bulldog, and now i want to make it so it has a different skin depending on what team you are on. during the RestartPlayer function in the gameinfo class i have made i tried to change aPlayer.Pawn.Skins[0] to the texture i wanted depending on the team and after that did super.RestartPlayer. it did nothing :p i assume its cos only meshes have skins or something stupid like that. here is the code anyways.
Code:
class BulldogTest extends xTeamGame;

#exec OBJ LOAD FILE=BulldogTestTex.utx

function RestartPlayer(Controller aPlayer) {
    local Pawn p;
    if (aPlayer.PlayerReplicationInfo.TeamID == 0)
        aPlayer.Pawn.Skins[0] = texture'BulldogTestTex.Skin1';
    else
        aPlayer.Pawn.Skins[0] = texture'BulldogTestTex.Skin2';

    Super.RestartPlayer(aPlayer);

    p = aPlayer.Pawn;
    NewBulldog(aPlayer.Pawn).PostSpawn(aPlayer.Pawn); // This is just the function to get the spawning to work correctly
}
can someone tell me whats wrong?
 

Rens2Sea

Total Exp: 1338 > leet
Aug 22, 2002
97
0
0
Lelystad - Holland
You are changing the skin of the player that will ocuppy the bulldog, but not the bulldog itself.

You can try:
Code:
function RestartPlayer(Controller aPlayer) {
    local Pawn p;
    if (aPlayer.PlayerReplicationInfo.TeamID == 0)
        aPlayer.Pawn.Skins[0] = texture'BulldogTestTex.Skin1';
    else
        aPlayer.Pawn.Skins[0] = texture'BulldogTestTex.Skin2';

    Super.RestartPlayer(aPlayer);

    p = aPlayer.Pawn;

    [b]if (aPlayer.PlayerReplicationInfo.TeamID == 0)
       NewBulldog(aPlayer.Pawn).Skins[0] = texture'BulldogTestTex.Skin1';
    else
       NewBulldog(aPlayer.Pawn).Skins[0] = texture'BulldogTestTex.Skin2';
[/b]

    NewBulldog(aPlayer.Pawn).PostSpawn(aPlayer.Pawn);
}

But that might not work :|

Soooo...

You can try to do it the DeathBall way :p
Have a NewBulldog_red and a NewBulldog_blue that both are childs of NewBulldog but have a different skin/model. Then just spawn the correct car depending on wich team you are like:

Code:
    if (aPlayer.PlayerReplicationInfo.TeamID == 0)
       NewBulldog_red(aPlayer.Pawn).PostSpawn(aPlayer.Pawn);
    else
       NewBulldog_blue(aPlayer.Pawn).PostSpawn(aPlayer.Pawn);
Btw, why use TeamID? I always use Team.TeamIndex :eek: Might not matter tho...
 
Last edited:

beefsack

the authority in beef
Nov 22, 2002
241
0
16
39
Canberra, Australia
beefsack.blogspot.com
i thought they were the same :/ and btw i think its a problem with static meshes using materials instead of skins or something, cos in my gameinfo subclass the pawn class itself is NewBulldog, but i will give it a go anyways :) ill wait till tomoz tho, cos i wanna eat+sleep now ;)

just a simple question which might answer my question if your suggestion wont work tomorrow. how to you change the material of a static mesh? if it is skins and rens way will work then pls flame me :p and i will implement it tomorrow.
 

ZappyAd

Leafcutter
Nov 5, 2002
13
0
0
Visit site
I do this for my vehicles and just use Skins[0] = newskin.

The only difference is that I do it from within the vehicle object, not externally. So I have something like:
Code:
myVehicle.SetSkin(newSkin)

and within my vehicle object I have:

Code:
simulated function SetSkin(material newSkin)
{
    skins[0] = newSkin;
}

That might be totally irrelevant but it seems to work...
 
Last edited:

beefsack

the authority in beef
Nov 22, 2002
241
0
16
39
Canberra, Australia
beefsack.blogspot.com
someone asked me how to do it so i ended up making some sample code. hopefully people will find it useful. ive never done anything like this before and im not sure whether i should put it up on unealwiki or something. im sure their are contributors hangin about in the forum so what do you guys think?

anyways heres the sample
 

Attachments

  • BulldogSpawn.zip
    11 KB · Views: 33

jasongw

New Member
Jun 24, 2003
2
0
0
Here's a question: How do you modify the physics for a certain character model so that it can fly? :)

Jason
 

Echelon9

New Member
Apr 12, 2003
2
0
0
Australia
Visit site
Snowboarding????

Hey i'm looking into the possibility of a snowboarding mod for ut2k3.
I'm wondering if making the board a vehicle with a player model on top is the best way to set things up? Or should the whole snowboarder and board be one vehicle? Or could the boarding be part of the player model with slidding physics set high?

Any ideas would be great... im looking for the best way to make the physics look kinda realistic, while having as much control over the animations of the boarder ie tricks, grabs, slides.
E9
 

jlebrech

New Member
Jul 10, 2003
5
0
0
Uscripting is strange everytime someone does a change to a player they seem to change a temporary pawn and then they do a sort of copy of the temporary to the proper object :)