Creating ordinance with the LUA

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
User avatar
jangoisbaddest
Lieutenant General
Lieutenant General
Posts: 661
Joined: Mon Feb 27, 2006 12:10 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: All Along The Watchtower

Creating ordinance with the LUA

Post by jangoisbaddest »

hello! I was wondering if it was possible to spawn an ordinance class with the LUA (like at a path node). Basically, I want to create the illusion of an airstrike by spawning a beacon at that path point and subsequently have a hail of fire rain from the sky once the player accomplishes something (in other words, I don't want an airstrike weapon - I want to use the script to trigger this at a specific point). Another possibly use for this is actually creating explosions on the fly via the LUA (by creating an ordinance with no geometry and an explosion, and then killing it immidiately).

It may not be possible, and I'd like to know if it isn't. I'll of course be testing this, but I'd still appriciate any input anyone can provide. Thank you!
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Creating ordinance with the LUA

Post by Maveritchell »

It's easy to create an explosion whenever you want - kill an object that has an explosion. Having an ordnance is something else, though. I don't think what you want to do can be done as you've written it.

If I were doing this, what I'd do would be to make an effect that looked like your "airstrike," trigger that effect through an explosion, and if you needed damage to come afterward trigger another explosion (or series of explosions) later.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Creating ordinance with the LUA

Post by [RDH]Zerted »

You could use CreateEntity() to create the beacon.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Creating ordinance with the LUA

Post by Maveritchell »

[RDH]Zerted wrote:You could use CreateEntity() to create the beacon.
A beacon is an ordnance, not an entity. "Spawning" a beacon doesn't even make sense.
User avatar
jangoisbaddest
Lieutenant General
Lieutenant General
Posts: 661
Joined: Mon Feb 27, 2006 12:10 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: All Along The Watchtower

Re: Creating ordinance with the LUA

Post by jangoisbaddest »

Maveritchell wrote:It's easy to create an explosion whenever you want - kill an object that has an explosion. Having an ordnance is something else, though. I don't think what you want to do can be done as you've written it.

If I were doing this, what I'd do would be to make an effect that looked like your "airstrike," trigger that effect through an explosion, and if you needed damage to come afterward trigger another explosion (or series of explosions) later.
Ah, ok. I'll look into creating a new effect. Thanks for the tip Mav! Saved me a lot of testing time.
Maveritchell wrote:
[RDH]Zerted wrote:You could use CreateEntity() to create the beacon.
A beacon is an ordnance, not an entity. "Spawning" a beacon doesn't even make sense.
I tested that about half an hour ago. It doesn't seem to work (though I admit it might be programmer's error).
Post Reply