Author |
Message |
Djinn
Joined: Sun Oct 29, 2006 4:26 am Posts: 298
|
Preventing release of cargo on Craft gibbing
Another question - believe me, I'm going somewhere with this: Is there a way to prevent cargo from being released when a ship gibs? Or is the best idea still to just make some mini explosion that destroys all cargo invisibly?
|
Sun Feb 14, 2010 9:09 pm |
|
|
Mind
Joined: Thu Mar 06, 2008 10:54 pm Posts: 1360 Location: USA
|
Re: Preventing release of cargo on Craft gibbing
Someone else could probably answer this better but a stupid workaround could be to make a "box" around the ship and say something like if the ship is dead then kill everyone in the box. But I don't know the real answer. :3
|
Sun Feb 14, 2010 9:15 pm |
|
|
Djinn
Joined: Sun Oct 29, 2006 4:26 am Posts: 298
|
Re: Preventing release of cargo on Craft gibbing
I mean, that would work - though I don't actually know how to do that, but it seems odd there's not a more elegant solution.
|
Sun Feb 14, 2010 9:19 pm |
|
|
Benpasko
Joined: Sun Aug 09, 2009 9:26 am Posts: 1633
|
Re: Preventing release of cargo on Craft gibbing
Have it release 99999 Sharpness 5 lifetime particles when it dies, or somesuch. That way, it shreds everything inside of it when it gets killed. Like, take a zero-division bomb, change the duration of all the bullets and explosions to a ridiculously low number, and have it do that explosion when the craft dies.
|
Sun Feb 14, 2010 9:36 pm |
|
|
Mind
Joined: Thu Mar 06, 2008 10:54 pm Posts: 1360 Location: USA
|
Re: Preventing release of cargo on Craft gibbing
Djinn wrote: Or is the best idea still to just make some mini explosion that destroys all cargo invisibly?
:P
|
Sun Feb 14, 2010 9:38 pm |
|
|
Geti
Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
|
Re: Preventing release of cargo on Craft gibbing
nah, make it so on destroy(self) you remove all your inventory.
|
Sun Feb 14, 2010 10:08 pm |
|
|
findude
Joined: Tue Dec 12, 2006 3:10 pm Posts: 495 Location: Uncertain quantum state
|
Re: Preventing release of cargo on Craft gibbing
Remove(self) is the biggest lie of Lua. (It crashes CC very randomly and stupidly) Use this (wont make craft gibs, spawn them with Lua as well) Code: function Update(self) if self.Health < 2 then self.LifeTime = 1 end end Disclaimer: Not tested.
|
Sun Feb 14, 2010 10:10 pm |
|
|
Mind
Joined: Thu Mar 06, 2008 10:54 pm Posts: 1360 Location: USA
|
Re: Preventing release of cargo on Craft gibbing
I'd go with Geti's. I don't completely understand waht ur trying to do with urs findude o_O
|
Sun Feb 14, 2010 10:14 pm |
|
|
Djinn
Joined: Sun Oct 29, 2006 4:26 am Posts: 298
|
Re: Preventing release of cargo on Craft gibbing
findude wrote: Remove(self) is the biggest lie of Lua. (It crashes CC very randomly and stupidly) Use this (wont make craft gibs, spawn them with Lua as well) Code: function Update(self) if self.Health < 2 then self.LifeTime = 1 end end Disclaimer: Not tested. Sweet, where do I attach this? Can't test atm, watching Olympic speed skating, haha.
|
Sun Feb 14, 2010 11:30 pm |
|
|
Geti
Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
|
Re: Preventing release of cargo on Craft gibbing
you need to add a ScriptPath line in your actor definition. eg ScriptPath = "MOD.rte/paths/morepaths/scripts/SOMESCRIPT.lua" or whatever. however, destroy self shouldnt bug out in this sense since we arent using any moveableman features for removing the inventory.
Last edited by Geti on Mon Feb 15, 2010 9:27 am, edited 1 time in total.
|
Mon Feb 15, 2010 6:05 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Preventing release of cargo on Craft gibbing
Basically, what FD's script would do is delete the rocket entirely if its health dropped below 2.
Obviously, this isn't ideal, but it's possible.
From what I understand (somewhat more than others), it might actually be better to circumvent the problem in a different way: only add inventory when it's needed, rather than having a set limit. That way, you can manage the count with lua, and there's no worries about things dropping out when you die.
|
Mon Feb 15, 2010 8:28 am |
|
|
numgun
Joined: Sat Jan 13, 2007 11:04 pm Posts: 2932
|
Re: Preventing release of cargo on Craft gibbing
I'd see only two ways to do this:
1) FD's suggestion: Make a Lua script that deletes the object when its supposed to gib with Lifetime = 1 and spawn an explosion at that location with the same script.
2) Sounds like you're making a "something" that eats stuff so perhaps you could make the whole eating part be done through Lua. Ex. make the fire button replicate the craft tractoring function in which ever way you want. I'd be a little more complex depending how'd you do it, but it'd still work.
|
Mon Feb 15, 2010 11:28 am |
|
|
Djinn
Joined: Sun Oct 29, 2006 4:26 am Posts: 298
|
Re: Preventing release of cargo on Craft gibbing
numgun wrote: 2) Sounds like you're making a "something" that eats stuff so perhaps you could make the whole eating part be done through Lua. Ex. make the fire button replicate the craft tractoring function in which ever way you want. I'd be a little more complex depending how'd you do it, but it'd still work. It's actually the opposite - it's something that spawns with stuff in its inventory, that releases them (being a rocket) after a period of time (tied to animation, which is why I didn't use an emitter, which may actually still be more elegant). Either way, looks like the nicest way is still with an invisexplosion.
|
Mon Feb 15, 2010 2:08 pm |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Preventing release of cargo on Craft gibbing
cough you can force rockets to animate with lua
|
Mon Feb 15, 2010 6:32 pm |
|
|
Djinn
Joined: Sun Oct 29, 2006 4:26 am Posts: 298
|
Re: Preventing release of cargo on Craft gibbing
Grif wrote: cough you can force rockets to animate with lua I mean, yeah, I saw that, but if I was going to force it to animate with Lua, I could just as easily use a completely different class. The nice thing about a rocket is that it releases predictably while simultaneously animating and it has a health bar. But yeah with Lua I could pretty much force that on anything.
|
Mon Feb 15, 2010 7:48 pm |
|
|
|