editing script of vehicle?

The place to chat about mods and other Unreal related stuff :-)
Post Reply
User avatar
Kobra
Posts: 2418
https://www.facebook.com/warszawa.kuchnie.na.wymiar/
Joined: Sun Sep 05, 2004 11:47 am

editing script of vehicle?

Post by Kobra »

i dont get it which values i have to edit to remove the guns on the vehicle or even replace the gun with another one..
also the battle bike has a problem that both sides of teams can join the bike, its not locked fot your opponents.
i am wondering if someone can help :S

this is the script of the battle bike:

Code: Select all

//-----------------------------------------------------------
//  Factory for Vehicles
//  for GameTypes Other than ONS
//-----------------------------------------------------------
class VCTF_FragEdSpecialFactory extends SVehicleFactory
    placeable;

var()   float           RespawnTime;
var     float           PreSpawnEffectTime;
var()   bool            bReverseBlueTeamDirection;
var     bool            bActive;
var     bool            bPreSpawn; // Neither the vehicle or build effect have been spawned yet
var     class<Emitter>  RedBuildEffectClass, BlueBuildEffectClass;
var     Emitter         BuildEffect;
var()     byte             TeamNum;
var FragEdSpecial Bike;
var() bool bChangeBikeWeapon;
var() class<FragEdSpecialBike_Weapons> WeaponClass;

function PreBeginPlay()
{
}
simulated event PostBeginPlay()
{
    if ( Level.NetMode != NM_DedicatedServer )
		VehicleClass.static.StaticPrecache(Level);
}

simulated function UpdatePrecacheMaterials()
{
    Level.AddPrecacheMaterial(Material'VMParticleTextures.buildEffects.PC_buildBorderNew');
    Level.AddPrecacheMaterial(Material'VMParticleTextures.buildEffects.PC_buildStreaks');
    VehicleClass.static.StaticPrecache(Level);
}

function PostNetBeginPlay()
{
   		Activate();
}

function Activate()
{
        bActive = True;
        bPreSpawn = True;
        Timer();
}

function Deactivate()
{
    bActive = False;
}

event VehicleDestroyed(Vehicle V)
{
	Super.VehicleDestroyed(V);

    bPreSpawn = True;
    SetTimer(RespawnTime - PreSpawnEffectTime, False);
}

function SpawnVehicle()
{
	local Pawn P;
	local bool bBlocked;

    foreach CollidingActors(class'Pawn', P, VehicleClass.default.CollisionRadius * 1.25)
	{
		bBlocked = true;
		if (PlayerController(P.Controller) != None)
			PlayerController(P.Controller).ReceiveLocalizedMessage(class'ONSOnslaughtMessage', 11);
	}

    if (bBlocked)
    	SetTimer(1, false); //try again later
    else
    {

            Bike = spawn(class'FragEdSpecial',,, Location, Rotation);

		if (Bike != None )
		{

            VehicleCount++;
            Bike.BikeWeaponClass= WeaponClass;
            if(bChangeBikeWeapon==true)
            Bike.NewWeapon();
			Bike.SetTeamNum(TeamNum);
			Bike.Event = Tag;
			Bike.ParentFactory = Self;
		}
    }
}

function SpawnBuildEffect()
{
    local rotator YawRot;

    YawRot = Rotation;
    YawRot.Roll = 0;
    YawRot.Pitch = 0;

    if (TeamNum == 0)
       BuildEffect = spawn(RedBuildEffectClass,,, Location, YawRot);
    else
       BuildEffect = spawn(BlueBuildEffectClass,,, Location, YawRot);
}

function Timer()
{
	if (bActive && VehicleCount < MaxVehicleCount)
	{
        if (bPreSpawn)
        {
            bPreSpawn = False;
            SpawnBuildEffect();
            SetTimer(PreSpawnEffectTime, False);
        }
        else
    	   SpawnVehicle();


    }
}

event Trigger( Actor Other, Pawn EventInstigator )
{
}

User avatar
}TCP{ZzCaT
Posts: 1348
Joined: Fri Dec 20, 2002 8:56 pm
Location: Tukker Country

Post by }TCP{ZzCaT »

Seems to me that you would have to take a look at the parent classes. I don't see any code for actually picking up a vehicle.

ZZ
User avatar
}TCP{Wolf
Site Admin
Posts: 4663
Joined: Thu Dec 19, 2002 7:30 pm
Location: https://signal.me/#eu/4zInut2kHeg_ry0GD ... pdqka17o2F
Contact:

Post by }TCP{Wolf »

I am not aware it is possible to change the guns.... :?:
-=]I AM GETTING TOO OLD FOR SUBTLETY[=-

mail: chaos.worx[at]gmx.net
IRC Quakenet +OTR: }TCP{Wolf @#oldunreal @#tcp.clan
Jabber/XMPP +OTR: Wolfy359@jabber.org
Threema: CR6Y9YSS
Signal: see profile
ICQ: dead since russian takeover disables OTR
User avatar
Kobra
Posts: 2418
Joined: Sun Sep 05, 2004 11:47 am

Post by Kobra »

whats the parent class?
and if its not possible to change the guns in the script then where else?
User avatar
}TCP{Carnage
Posts: 4597
Joined: Thu Dec 19, 2002 5:22 pm
Location: Nightbar Rooie Ooren
Contact:

Post by }TCP{Carnage »

Well i know some maps on our server also have custom vehicles and they have custom weapons too .. should take a lookie at "ONS-ColdFusion T32" perhaps u can get some idea of how they did it
Patience Is A Virtue
Anger Is A Gift

Unreal 1 - 32 slot 227h- }TCP{ Funhouse #6 [MonsterMash !!][url=unreal://95.170.68.21:8218]-:: Go There ::-[/url]
Unreal 1 - 8 slot 227f - }TCP{ Funhouse #7 [TeamArenaMaster !!] [url=unreal://tcpclan.nl:8888]-:: Go There ::-[/url]
UT2004 - 12 slot }TCP{ Funhouse #1 [TAM / Freezetag] !! [url=ut2004://95.170.68.21:8318]-:: Go There ::-[/url]
UT2004 - 32 slot }TCP{ Funhouse #2 [Freon Madness] !! [url=ut2004://95.170.68.21:9118]-:: Go There ::-[/url]
UT2004 - 2/4 slot }TCP{ Funhouse #3 [1vs1 or 2 vs 2] !! [url=ut2004://tcpclan.nl:7777]-:: Go There ::-[/url]
UT2004 - 12 slot }TCP{ Funhouse #4 [ONS/TAM/AM/Moso 12p] !! [url=ut2004://85.17.208.88:7777]-:: Go There ::-[/url]
UT2004 - 8 slot }TCP{FunHouse #5 [TAM/1on1-DM] !! [url=ut2004://46.228.201.243:7777]-:: Go There ::-[/url]




Open Source Beer
The }TCP{ Website
User avatar
}TCP{Snowbird
Posts: 3007
Joined: Tue Nov 22, 2005 5:09 pm
Location: Germany

Post by }TCP{Snowbird »

I hahve never gone in this area myself, but did look it up. It seems that the weapons code and the vehicle code are 2 different codes? And they should be found in the classes. This is what I had found in another forum.

"Vehicle use ONSWeapon for the driver and ONSWeaponPawn for the passenger.
you will need to extends it from them to change the weapon.
the redeemer use a extends of Weapon and is not handle the same way."

You will find these under Actor Class, Pawn, Vehicle.


As for the battle bike...I have not been playing lately, and I really want to try it out. I think (smell something burning?) there is something in the actor class....Forget that I just looked. I will download the bike and try now.
User avatar
Kobra
Posts: 2418
Joined: Sun Sep 05, 2004 11:47 am

Post by Kobra »

ok, it didnt work how i wished.. i wanted to put the plasma gun of the scorpion and the twin beam gun on the bikes, without any success...
but at least it was possible to kill the OVERKILL guns of the bikes ( dunno what the designer thought by giving them such strong guns, you can kill a powernode in a few seconds with the bike-minigun)

anyway, i think im done with ToySoldiersV2 this sunday evening :)
User avatar
}TCP{Carnage
Posts: 4597
Joined: Thu Dec 19, 2002 5:22 pm
Location: Nightbar Rooie Ooren
Contact:

Post by }TCP{Carnage »

Sounds great m8 :)

Maybe u can also look into the channel thing .. coz ure map realy plays poorly with 32 people on it .. not that the map is bad just the pings go quite i big way .. i took it off the list for now untill we are done testing
Patience Is A Virtue
Anger Is A Gift

Unreal 1 - 32 slot 227h- }TCP{ Funhouse #6 [MonsterMash !!][url=unreal://95.170.68.21:8218]-:: Go There ::-[/url]
Unreal 1 - 8 slot 227f - }TCP{ Funhouse #7 [TeamArenaMaster !!] [url=unreal://tcpclan.nl:8888]-:: Go There ::-[/url]
UT2004 - 12 slot }TCP{ Funhouse #1 [TAM / Freezetag] !! [url=ut2004://95.170.68.21:8318]-:: Go There ::-[/url]
UT2004 - 32 slot }TCP{ Funhouse #2 [Freon Madness] !! [url=ut2004://95.170.68.21:9118]-:: Go There ::-[/url]
UT2004 - 2/4 slot }TCP{ Funhouse #3 [1vs1 or 2 vs 2] !! [url=ut2004://tcpclan.nl:7777]-:: Go There ::-[/url]
UT2004 - 12 slot }TCP{ Funhouse #4 [ONS/TAM/AM/Moso 12p] !! [url=ut2004://85.17.208.88:7777]-:: Go There ::-[/url]
UT2004 - 8 slot }TCP{FunHouse #5 [TAM/1on1-DM] !! [url=ut2004://46.228.201.243:7777]-:: Go There ::-[/url]




Open Source Beer
The }TCP{ Website
User avatar
Kobra
Posts: 2418
Joined: Sun Sep 05, 2004 11:47 am

Post by Kobra »

ok i will try, but if it doesnt work i will just send the map here and maybe someone else can find out how to fix the channels :)
User avatar
}TCP{ZzCaT
Posts: 1348
Joined: Fri Dec 20, 2002 8:56 pm
Location: Tukker Country

Post by }TCP{ZzCaT »

}TCP{Kobra wrote:whats the parent class?
and if its not possible to change the guns in the script then where else?
An object class inherits properties from a parent class. So class 'mercedes' is of a class 'car' could tell you that a mercedes has the property 'wheels' in common with all other cars, or better with all objects of class 'car'.

Thus 'wheels' needs not be defined again in class 'mercedes', because it has already been defined in it's parent class 'car'. If it is there nevertheless, then basically some changes will have been made to it in comparison to the code in class 'car'.

These are all basics of object oriented programming.


ZZ
User avatar
Kobra
Posts: 2418
Joined: Sun Sep 05, 2004 11:47 am

Post by Kobra »

ok, got it.. so 'car' ist the parent class of 'mercedes' and 'wheels' and everything else what belongs to that.
but where can i find that codes? and if i would find it i dont think i could figure out what to change :(
User avatar
}TCP{ZzCaT
Posts: 1348
Joined: Fri Dec 20, 2002 8:56 pm
Location: Tukker Country

Post by }TCP{ZzCaT »

}TCP{Kobra wrote:ok, got it.. so 'car' ist the parent class of 'mercedes' and 'wheels' and everything else what belongs to that.
but where can i find that codes? and if i would find it i dont think i could figure out what to change :(
Well if I'm not mistaking the classes are shown in a tree like manner. Parent classes would be above their children, closer to the root class.

As far as I can see, starting from the root class 'object', classes go as follows:

object -> actor -> svehiclefactory -> onsvehiclefactory -> onstankfactory

So onsvehiclefactory would be a parent of onstankfactory. If you can't find the code you're looking for in onstankfactory, just move to it's parent (onsvehiclefactiry) etcetera. Some classes may be mixin classes or import some external protocol. Like for instance a weapon would use an imported sound and an animation. I suspect vehicles also use some animations and static meshes.

If you want to mount a turret onto a vehicle you would find that the vehicle is made up of different classes (vehicle, turret, gun, etc.) How these are put together exactly is beyond me. Maybe Wolf would know.

ZZ
User avatar
}TCP{Snowbird
Posts: 3007
Joined: Tue Nov 22, 2005 5:09 pm
Location: Germany

Post by }TCP{Snowbird »

Nice breakdown, Cat. :shock:

Sounds like you really know what you are doing.
User avatar
}TCP{ZzCaT
Posts: 1348
Joined: Fri Dec 20, 2002 8:56 pm
Location: Tukker Country

Post by }TCP{ZzCaT »

DAFrank wrote:Nice breakdown, Cat. :shock:

Sounds like you really know what you are doing.
Alas I don't have any hands on experience with unreal script. I do program for a living tho, be it in visual Dataflex.

ZZ
Post Reply