Page 1 of 1

Spawning Vehicles in a .LUA?

Posted: Sun Jan 14, 2007 5:42 pm
by Broadus
I'm modding on the PSP, and my only means of modifying it are by making my own mission.lvl, or hex editing anything else.
Knowing this, I was wondering, is it possible to add vehicles into a map just by scripting them in via the .LUA file for a level? Assuming I somehow knew the coordinates of where I wanted to place it.
I know vehicles are supposed to spawn depending on what team owns what control point, but I wouldn't mind if I could get a vehicle to spawn in one place indefinitely.
Like, I want to add an LAAT to Geonosis, somewhere in the big, open area around where the Republic's AT-TE is. Would that be at all possible in the .LUA?

I dunno' if AI flying LAATs use path nodes to navigate, but if they do, it'd mean that the AI wouldn't be able to fly it, as I'm sure there'd be no path nodes on Geonosis. Not that the AI could fly a gunship even if there were path nodes telling it the right places to go.

Posted: Sun Jan 14, 2007 6:27 pm
by Ace_Azzameen_5
You might be able to create a lua script that will alter a vehicle spawn' objects' properties, so that after a time goes off, the atte point gives you a laat instead. OR, simply make it so that when rep gets say the hangar, they get an atte. I don't know the fine details, only that this is possible in the pc version.

Can you create a mission lua like we all can for pc?
]

Posted: Sun Jan 14, 2007 10:45 pm
by Broadus
Yes, I can create a mission .LUA that is perfectly identical to the PC, except that it's compatible with the PSP.
Your suggestion makes a crapload of sense. Here's an idea I had: The Republic gets three hover tanks, but in the .LUA they're just commented out of the "read" section so that they don't appear (they appear in CTF when the AT-TE is taken out). I hex edited the geo1.lvl and replaced all occurences of the hover tank with the gunship. This made gunships spawn instead of tanks. I'm not using Geonosis CTF on the PSP, so it's not like I "lost" the tanks, since they don't appear in Conquest (they give the Republic too much power).
Two LAATs spawn a little too close to eachother, so one blows up if the other takes off. Oh, well.
Anyway, thanks for the idea! Problem solved!

I'm just wondering, is there a gunship (one that came with the game by default) that moves slower? Or, differently? The normal gunships fly fast and don't turn too well.

Posted: Mon Jan 15, 2007 1:51 am
by [RDH]Zerted
You can use the SetProperty methods and change unit/object/entity stats. Use this to set the speeds to a lower value and change the turn rate.

Posted: Mon Jan 15, 2007 2:06 am
by Broadus
Cool idea. I tried it out, but I couldn't really change anything. The speed wouldn't change, and I'm trying to change the health of the gunships but that isn't working either. The only thing I could pull off was making an unrideable uta_fly_ride_gunship have a different takeoff height.

Posted: Mon Jan 15, 2007 9:54 pm
by [RDH]Zerted
There are a few set properties (SetClass, SetObject, SetEntity, etc...) functions. Make sure you are using the right one and what is your code?

Posted: Mon Jan 15, 2007 10:52 pm
by Broadus
Well, I don't know which SetProperties are the ones that work, but I've seen MaxHealth and CurHealth used all of the time to make stuff indestructable, and it's not working for me.