Page 1 of 1

Object destruction fires ordnace?

Posted: Thu Jul 10, 2008 1:33 pm
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.

Re: Object destruction fires ordnace?

Posted: Thu Jul 10, 2008 5:18 pm
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.

Re: Object destruction fires ordnace?

Posted: Thu Jul 10, 2008 5:37 pm
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.

Re: Object destruction fires ordnace?

Posted: Thu Jul 10, 2008 6:26 pm
by [RDH]Zerted
I know you can do the damage by creating a time bomb entity at the location where the building was destroyed.

Re: Object destruction fires ordnace?

Posted: Thu Jul 10, 2008 6:36 pm
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.

Re: Object destruction fires ordnace?

Posted: Thu Jul 10, 2008 8:35 pm
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
)

Re: Object destruction fires ordnace?

Posted: Thu Jul 10, 2008 9:45 pm
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.