Page 1 of 1

Add/Change vehicles via lua. [Solved]

Posted: Thu Aug 18, 2016 12:29 pm
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?

Re: Add/Change vehicles via lua.

Posted: Thu Aug 18, 2016 12:37 pm
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.

Re: Add/Change vehicles via lua.

Posted: Thu Aug 18, 2016 12:57 pm
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"

Re: Add/Change vehicles via lua.

Posted: Thu Aug 18, 2016 1:58 pm
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.

Re: Add/Change vehicles via lua.

Posted: Thu Aug 18, 2016 2:16 pm
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

Re: Add/Change vehicles via lua.

Posted: Thu Aug 18, 2016 3:17 pm
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.

Re: Add/Change vehicles via lua.

Posted: Thu Aug 18, 2016 11:08 pm
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!