Page 1 of 1

Editing shipped vehicle spawners via LUA? [Solved]

Posted: Wed Aug 01, 2012 8:05 am
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.

Re: Editing shipped vehicle spawners via LUA?

Posted: Wed Aug 01, 2012 8:23 am
by Marth8880
In which part of the LUA are you putting it?

Re: Editing shipped vehicle spawners via LUA?

Posted: Wed Aug 01, 2012 8:34 am
by THEWULFMAN
If I recall correctly you can't edit vehicle spawners with Lua. I remember trying awhile ago and being told thus.

Re: Editing shipped vehicle spawners via LUA?

Posted: Wed Aug 01, 2012 8:37 am
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.

Re: Editing shipped vehicle spawners via LUA?

Posted: Wed Aug 01, 2012 10:57 am
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.

Re: Editing shipped vehicle spawners via LUA?

Posted: Wed Aug 01, 2012 11:23 am
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

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

Posted: Thu Aug 02, 2012 12:53 pm
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.

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

Posted: Thu Aug 02, 2012 1:33 pm
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.