Editing shipped vehicle spawners via LUA? [Solved]

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
Bob
Brigadier General
Brigadier General
Posts: 633
Joined: Thu May 27, 2010 4:28 am
Location: at home

Editing shipped vehicle spawners via LUA? [Solved]

Post by Bob »

I tried to change the vehicle that's spawned by a vehicle spawner via LUA, but to no avail yet.

Code: Select all

    SetProperty("com_item_vehicle_spawn22", "ClassRepATK", "cis_hover_aat")
is what I did but nothing happens, it still spawns the rep hovertanks. Map is Mygeeto, spawn22 and 23 are the vehicle spawners at the Rep's starting CP in conquest mode.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Editing shipped vehicle spawners via LUA?

Post by Marth8880 »

In which part of the LUA are you putting it?
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Editing shipped vehicle spawners via LUA?

Post by THEWULFMAN »

If I recall correctly you can't edit vehicle spawners with Lua. I remember trying awhile ago and being told thus.
Last edited by THEWULFMAN on Wed Aug 01, 2012 10:11 am, edited 1 time in total.
Bob
Brigadier General
Brigadier General
Posts: 633
Joined: Thu May 27, 2010 4:28 am
Location: at home

Re: Editing shipped vehicle spawners via LUA?

Post by Bob »

Marth8880 wrote:In which part of the LUA are you putting it?
In the ScriptPostLoad.

Edit: Screw this, I got a better idea. Thanks for helping, Frayed Wires.
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: Editing shipped vehicle spawners via LUA?

Post by Teancum »

Yeah, I've tried it before too. The only thing I can think of is to use LUA to create a new vehicle spawn using the same coordinates (Matrix?) and then set its properties.

The other option is to make an addon "layer" level that you load after the main level. It would only have the vehicle spawns you need. I did this for Coruscant on the Xbox mod.
Bob
Brigadier General
Brigadier General
Posts: 633
Joined: Thu May 27, 2010 4:28 am
Location: at home

Re: Editing shipped vehicle spawners via LUA?

Post by Bob »

I just created one more side and renamed a ODF. In the LUA I now load

Code: Select all

    ReadDataFile("dc:SIDE\\utat.lvl",
		"rep_hover_fightertank")
instead of

Code: Select all

    ReadDataFile("SIDE\\rep.lvl",
		"rep_hover_fightertank")
The fightertank of the custom side is just an UTAT in disguise. It works, won't interfere with other maps and I didn't do any changes in the map. Victory.

Now I have to stop the UTAT from exploding right after spawning. It's not because it has not enough place, I already scaled it down to 20% of it's original size. Looks cute.

EDIT: It seems to be realy a issue with the UTAT itself, not the spawner or the vehicle's size. Other vehs work fine. Proof:
Hidden/Spoiler:
Image
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Editing shipped vehicle spawners via LUA? [Solved]

Post by DarthD.U.C.K. »

maybe its the ut-at's collision that causes the exploding. some vehicles have problems when being spawned on platforms. you could try to increase the heigth of the spawn so that it spawns in the air and then falls down.
Bob
Brigadier General
Brigadier General
Posts: 633
Joined: Thu May 27, 2010 4:28 am
Location: at home

Re: Editing shipped vehicle spawners via LUA? [Solved]

Post by Bob »

I already made a new UT-AT ODF on the basis of the rep fightertank's ODF. There are no striking differences between the two files so I don't know what's wrong, but it doesn't matter anymore because the new one works.
Post Reply