Page 1 of 1
Creating ordinance with the LUA
Posted: Fri Feb 13, 2009 3:20 pm
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!
Re: Creating ordinance with the LUA
Posted: Fri Feb 13, 2009 3:40 pm
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.
Re: Creating ordinance with the LUA
Posted: Fri Feb 13, 2009 3:43 pm
by [RDH]Zerted
You could use CreateEntity() to create the beacon.
Re: Creating ordinance with the LUA
Posted: Fri Feb 13, 2009 3:45 pm
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.
Re: Creating ordinance with the LUA
Posted: Fri Feb 13, 2009 3:47 pm
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).