Useful vehicle mode code

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am

Useful vehicle mode code

Post by razac920 »

I don't know if anyone is trying to make all-vehicle game modes anymore, but here's an easy way to keep track of vehicles that you force players into:

Code: Select all

  nextvehicle = "vspawn" // initialize it this way because first vehicle spawn might have occurred before OnObjectInit is set up; "vspawn" is the name of the vehicle spawn in ZE
  OnObjectInit(function(object)
    if GetEntityClass(object) == FindEntityClass("your_vehicle_class_name") then
      nextvehicle = object
    end
 end)
Then you can force each player into such a vehicle like so:

Code: Select all

  OnCharacterSpawn(function(player)
    if nextvehicle then
      local tmp = GetEntityMatrix(GetCharacterUnit(player))
      EnterVehicle(player,nextvehicle)
      nextvehicle = nil
    end
  end)
If you have many players spawning at once, you might need to make a few modifications, but for small scale modes this should work.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Useful vehicle mode code

Post by Teancum »

Nice! I wish I still had the source files to my Xbox mod. I always wanted to do a vehicle deathmatch like the Clone Wars game had.
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am

Re: Useful vehicle mode code

Post by razac920 »

Would this be a free-for-all, everyone in tanks kind of mode? I don't know what game you are referring to.
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Useful vehicle mode code

Post by THEWULFMAN »

2002 Clone Wars game that Pandemic made before SWBF1. It had a multiplayer mode that I used to play a lot. It'd pit the two teams against each other across of a decent-sized map, with the goal being to destroy the enemy base. You'd capture command posts, which would give you more bots to help out.

It was entirely done with vehicles. The GAT and AAT for the CIS, and IFT and AT-RT for the REP.

Fun random thing. The Rhen Var map was completely broken design wise. The AAT's main cannon had unlimited range, but on Rhen Var, the bases were just straight shots down this canyon. So you could as the CIS, just jump in an AAT and destroy the enemy base from the comfort of your own territory.

There was also a wave mode too, still all vehicles.
SnakeEyesRaw
Private
Posts: 44
Joined: Sun Apr 19, 2015 4:10 am
Projects :: Various personal side mods
Games I'm Playing :: SWBF2 - JKA - KotOR

Re: Useful vehicle mode code

Post by SnakeEyesRaw »

THEWULFMAN wrote:2002 Clone Wars game that Pandemic made before SWBF1. It had a multiplayer mode that I used to play a lot. It'd pit the two teams against each other across of a decent-sized map, with the goal being to destroy the enemy base. You'd capture command posts, which would give you more bots to help out.

It was entirely done with vehicles. The GAT and AAT for the CIS, and IFT and AT-RT for the REP.

Fun random thing. The Rhen Var map was completely broken design wise. The AAT's main cannon had unlimited range, but on Rhen Var, the bases were just straight shots down this canyon. So you could as the CIS, just jump in an AAT and destroy the enemy base from the comfort of your own territory.

There was also a wave mode too, still all vehicles.
Wow, I thought I was the only one who played that game. :D
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am

Re: Useful vehicle mode code

Post by razac920 »

Huh. Sounds fun. Maybe I'll work on that next after I finish up my Starship Troopers map. Teancum, out of curiosity, why the Xbox? Can you play custom mods splitscreen on it?
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Re: Useful vehicle mode code

Post by jedimoose32 »

Oh, the hours I poured into beating Clone Wars wave mode with my dad (splitscreen on Gamecube). Dang.
Image

So, yeah, someone should really make a decent Vehicle TDM or Wave mode.

Edit: Mace Windu's voice overs anyone? "Five... four... three... two... one... match begins... NOW!"
Post Reply