Add/Change vehicles 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
CdtFox
2nd Lieutenant
2nd Lieutenant
Posts: 379
Joined: Wed Feb 17, 2016 8:51 am
Projects :: BUC and Designated Days
Games I'm Playing :: SWBF2+EAW+Subnautica
xbox live or psn: No gamertag set
Location: France
Contact:

Add/Change vehicles via lua. [Solved]

Post by CdtFox »

Hey GT,

I want to know if this is possible to change a vehicule by another on stocks maps via lua, for an era mod without chaging the spawn via Zeroeditor.

Example: I want to change the "rep_walk_oneman_atst" in "uta1c_con" by my custom one, how I can do this?
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Add/Change vehicles via lua.

Post by AnthonyBF2 »

I think you can use something like this but cannot confirm;

SetProperty("VehicleSpawn", "ClassAllDEF", "all_fly_snowspeeder")

VehicleSpawn = the name of the vehicle spawn you're wanting to edit. If that doesn't work there is also SetClassProperty.
CdtFox
2nd Lieutenant
2nd Lieutenant
Posts: 379
Joined: Wed Feb 17, 2016 8:51 am
Projects :: BUC and Designated Days
Games I'm Playing :: SWBF2+EAW+Subnautica
xbox live or psn: No gamertag set
Location: France
Contact:

Re: Add/Change vehicles via lua.

Post by CdtFox »

AnthonyBF2 wrote:I think you can use something like this but cannot confirm;

SetProperty("VehicleSpawn", "ClassAllDEF", "all_fly_snowspeeder")

VehicleSpawn = the name of the vehicle spawn you're wanting to edit. If that doesn't work there is also SetClassProperty.
Tried both, but the AT-ST is still spawning :|

Where "SetProperty"/"SetClassProperty" should go? I've putted just after "SetMemoryPoolSize"
thelegend
Sith
Sith
Posts: 1433
Joined: Thu Jan 23, 2014 6:01 am
Projects :: Star Wars - Battlefront III Legacy
Games I'm Playing :: Swbf GTA CoD LoL KH
xbox live or psn: El_Fabricio#
Location: Right behind you :)

Re: Add/Change vehicles via lua.

Post by thelegend »

Does SetInstanceProperty actually exist? For command posts spawn paths can be switched via SetProperty.
By the way you need to put these Property lines below function scriptpostload to run them.
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: Add/Change vehicles via lua.

Post by Teancum »

thelegend wrote:Does SetInstanceProperty actually exist?
Nope. But it would be super useful if it did exist. Years ago I pulled all every LUA command from the game engine with a hex editor script. You can find them in the following topic: http://www.gametoast.com/viewtopic.php?f=27&t=12469
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Add/Change vehicles via lua.

Post by AQT »

Similar topics found via the search function:

viewtopic.php?p=400929
viewtopic.php?f=27&t=29909

First topic indicates that using SetProperty does not work on vehicle spawns. Second topic details the steps needed to implement new vehicle spawns without having to load an entire edited stock map.
CdtFox
2nd Lieutenant
2nd Lieutenant
Posts: 379
Joined: Wed Feb 17, 2016 8:51 am
Projects :: BUC and Designated Days
Games I'm Playing :: SWBF2+EAW+Subnautica
xbox live or psn: No gamertag set
Location: France
Contact:

Re: Add/Change vehicles via lua.

Post by CdtFox »

AQT wrote:Similar topics found via the search function:

viewtopic.php?p=400929
viewtopic.php?f=27&t=29909

First topic indicates that using SetProperty does not work on vehicle spawns. Second topic details the steps needed to implement new vehicle spawns without having to load an entire edited stock map.
Waoo, graet AQT! Thanks!
Post Reply