Data Realms Fan Forums
http://45.55.195.193/

Preventing release of cargo on Craft gibbing
http://45.55.195.193/viewtopic.php?f=1&t=17837
Page 1 of 2

Author:  Djinn [ Sun Feb 14, 2010 9:09 pm ]
Post subject:  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?

Author:  Mind [ Sun Feb 14, 2010 9:15 pm ]
Post subject:  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

Author:  Djinn [ Sun Feb 14, 2010 9:19 pm ]
Post subject:  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.

Author:  Benpasko [ Sun Feb 14, 2010 9:36 pm ]
Post subject:  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.

Author:  Mind [ Sun Feb 14, 2010 9:38 pm ]
Post subject:  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

Author:  Geti [ Sun Feb 14, 2010 10:08 pm ]
Post subject:  Re: Preventing release of cargo on Craft gibbing

nah, make it so on destroy(self) you remove all your inventory.

Author:  findude [ Sun Feb 14, 2010 10:10 pm ]
Post subject:  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.

Author:  Mind [ Sun Feb 14, 2010 10:14 pm ]
Post subject:  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

Author:  Djinn [ Sun Feb 14, 2010 11:30 pm ]
Post subject:  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.

Author:  Geti [ Mon Feb 15, 2010 6:05 am ]
Post subject:  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.

Author:  Grif [ Mon Feb 15, 2010 8:28 am ]
Post subject:  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.

Author:  numgun [ Mon Feb 15, 2010 11:28 am ]
Post subject:  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.

Author:  Djinn [ Mon Feb 15, 2010 2:08 pm ]
Post subject:  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.

Author:  Grif [ Mon Feb 15, 2010 6:32 pm ]
Post subject:  Re: Preventing release of cargo on Craft gibbing

cough you can force rockets to animate with lua

Author:  Djinn [ Mon Feb 15, 2010 7:48 pm ]
Post subject:  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.

Page 1 of 2 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/