Object destruction fires ordnace?

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
Caleb1117
2008 Most Original Avatar
Posts: 3096
Joined: Sun Aug 20, 2006 5:55 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: X-Fire: caleb1117 ಠ_ಠ

Object destruction fires ordnace?

Post by Caleb1117 »

Long time since I made a topic here. :P

Anyway, I have an DestructibleBuilding, object, and when it dies, I want it to have a small explosion on site, and also, fire Force Lightning, omni-directionally, causing harm to anyone in range of it.

How could I do this? It's probably alot simpler then I'm making it out to be in my head.
User avatar
tsurugi13
Lieutenant Colonel
Lieutenant Colonel
Posts: 543
Joined: Mon Dec 17, 2007 6:16 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Battling the ISA menace on Helghan.

Re: Object destruction fires ordnace?

Post by tsurugi13 »

Caleb1117 wrote:How could I do this? It's probably alot simpler then I'm making it out to be in my head.
No, I think it really is that complicated! You might be able to give it an explosion odf like when a vehicle dies, then make the explosion lightning, but only maybe.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Object destruction fires ordnace?

Post by Maveritchell »

tsurugi13 wrote:No, I think it really is that complicated! You might be able to give it an explosion odf like when a vehicle dies, then make the explosion lightning, but only maybe.
What he said. The easiest thing to do is just make an explosion effect that looks like force lightning. Only controllables can actually use weapons, which are what fire ordnances. Almost anything can trigger an explosion, though.
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: Object destruction fires ordnace?

Post by [RDH]Zerted »

I know you can do the damage by creating a time bomb entity at the location where the building was destroyed.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Object destruction fires ordnace?

Post by Maveritchell »

[RDH]Zerted wrote:I know you can do the damage by creating a time bomb entity at the location where the building was destroyed.
That still doesn't fire a new ordnance. Timebombs are just a dispensable (a mine) object; all their damage is done through an exp file.
theITfactor
Chief Warrant Officer
Chief Warrant Officer
Posts: 327
Joined: Wed Jun 28, 2006 12:56 pm
Projects :: The Pwnfest and Games Complex
Games I'm Playing :: SWTOR
xbox live or psn: You and I Know
Location: The Old Republic
Contact:

Re: Object destruction fires ordnace?

Post by theITfactor »

[RDH]Zerted wrote:I know you can do the damage by creating a time bomb entity at the location where the building was destroyed.
Maybe make an invisible insta-splode time bomb with a force lightning explosion?

Here is the code for spawning a timebomb on your location, Zerted helped me with it.
Hidden/Spoiler:
---------------------
-----Man Cannon------
---------------------

--when a unit spawns, create a time bomb on him
local eventSpawn = OnObjectKill(
function(object, killer)
if not killer then return end --do nothing if no killer
if not IsCharacterHuman(killer) then return end --do nothing unless killer is a human

local name = GetEntityName(object)

if (name == "launch") or
(name == "launch1") or
(name == "launch2") then
--make sure the player hasn't died already
local unit = GetCharacterUnit( killer )
if not unit then return end

--get the unit's location
local point = GetEntityMatrix( unit )

--drop a time bomb directly on the unit
CreateEntity("fun_weap_inf_timebomb_ord", point, "fun_weap_inf_timebomb_ord")
end
end
)
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: Object destruction fires ordnace?

Post by [RDH]Zerted »

Maveritchell wrote:...Timebombs are just a dispensable (a mine) object; all their damage is done through an exp file....
Oh yeah, good point. Can you tell I don't do much with effects and explosions.
Post Reply