Data Realms Fan Forums http://45.55.195.193/ |
|
Finding emitters to heal wounds http://45.55.195.193/viewtopic.php?f=73&t=14614 |
Page 1 of 1 |
Author: | Darlos9D [ Thu May 14, 2009 1:11 am ] |
Post subject: | Finding emitters to heal wounds |
Alright, so, as a starting project I'd like to create regenerating actors and equipment. And by regenerating I mean their parts lose wounds overtime, until they return to being pristine. Now, looking around the Lua class index we have, I'm wondering how possible that will be. First I checked out both the Attachable and Actor classes and all of their parents, and found no function that gives you back all of the things that are attached to an object in question. The best I can do is somehow put Attachable:IsAttachedTo() to use in order to look at all attachables in the scene and see which ones are attached to the object in question, and then do what I need to do. The problem here is looking at all attachables in the scene. I know you can do MovableMan.Actors to find all actors, but I'm not looking for actors here, I'm looking for wounds, which are emitters, which are attachables (which, incidentally, are MOSRotatings). So what can I reference in MovableMan to get attachables? Also, here's an even more important question: if I eliminate wounds by finding them in this manner, will this actually lessen the number of wounds the object is considered to have taken so far in regards to GibWoundLimit? I remember back in the day I tried something similar by just making wounds with a limited lifespan. They visibly disappeared off of the objects, but the objects still took the same number of hits to gib that you would expect even after they disappeared. I might just be asking too much, though I would hope some direct control over current/max wounds will be implemented in the future if this is the case. |
Author: | TheLastBanana [ Thu May 14, 2009 2:00 am ] |
Post subject: | Re: Finding emitters to heal wounds |
Well, if you're looking for emitters, they'd be under MovableMan.Particles in the same way as actors. Unfortunately, anything attached to something else (such as armor or wounds) can't be accessed in Lua yet. So removing them would be impossible. |
Author: | Darlos9D [ Thu May 14, 2009 2:19 am ] |
Post subject: | Re: Finding emitters to heal wounds |
TheLastBanana wrote: Well, if you're looking for emitters, they'd be under MovableMan.Particles in the same way as actors. Unfortunately, anything attached to something else (such as armor or wounds) can't be accessed in Lua yet. So removing them would be impossible. Well, if I just find emitters and use Attachable:IsAttachedTo() to find out whether or not they're attached to the object I care about, I wind up with effectively the same power. The only problem is it might get a tad intensive. |
Author: | TheLastBanana [ Thu May 14, 2009 2:23 am ] |
Post subject: | Re: Finding emitters to heal wounds |
Again, you can't actually access attached objects. Functions don't run on them and you can't get any of their properties. Also, MovableMan.Particles doesn't return them. So instead, you'll have to go through all the MOIDs and see which ones are there and still active, and even then it will probably not work. |
Author: | Darlos9D [ Thu May 14, 2009 2:45 am ] |
Post subject: | Re: Finding emitters to heal wounds |
Wait... okay, what can and can't actually use scripts? This might be a good question, since even putting self:GibThis() in the update function for a script I have a helmet calling isn't doing anything. I feel there's such a lack of information... |
Author: | Daman [ Thu May 14, 2009 3:02 am ] |
Post subject: | Re: Finding emitters to heal wounds |
Darlos9D wrote: Wait... okay, what can and can't actually use scripts? This might be a good question, since even putting self:GibThis() in the update function for a script I have a helmet calling isn't doing anything. I feel there's such a lack of information... He's saying they're not exposed to lua/aren't an entity you can actually check for see: you can't unless MovableMan has a method to return everything and anything I don't have a clue how CC names things, but one could check the name a name you're looking for or a regex of anything with gib/wound/etc in it. I don't know if that variable is accessible, though I'm pretty sure you name gibs as well in CC. but he said they can't be accessed as they can't be retrieved so good luck man otherwise you could always use attachable:Detach() Quote: Also, here's an even more important question: if I eliminate wounds by finding them in this manner, will this actually lessen the number of wounds the object is considered to have taken so far in regards to GibWoundLimit? Yeah I doubt it they're probably just graphical representations. |
Author: | Darlos9D [ Thu May 14, 2009 3:21 am ] |
Post subject: | Re: Finding emitters to heal wounds |
Daman wrote: He's saying they're not exposed to lua/aren't an entity you can actually check for see: you can't Yeah, thanks, I think I already got that part. Daman wrote: unless MovableMan has a method to return everything and anything I honestly worry about the overhead of a bunch of body and armor parts on every actor in my mod thats currently in play checking every other possible thing in the scene over and over if I go that far. Though Banana said something about looking through the MOIDs somehow, though I don't know how to do that. I suppose I could give that a shot just for education's sake. Daman wrote: but he said they can't be accessed as they can't be retrieved so good luck man otherwise you could always use attachable:Detach() Well, that was my plan. But... see above problems. Daman wrote: Yeah I doubt it they're probably just graphical representations. That's what I figured, due to my old experiments. Everything else is moot in the face of this basic problem. So... /thread I guess. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |