View unanswered posts | View active topics It is currently Thu Dec 26, 2024 4:55 pm



Reply to topic  [ 7 posts ] 
 Finding emitters to heal wounds 
Author Message
User avatar

Joined: Mon Jul 16, 2007 9:50 am
Posts: 1512
Location: Tallahassee, FL
Reply with quote
Post 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.


Thu May 14, 2009 1:11 am
Profile YIM
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post 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.


Thu May 14, 2009 2:00 am
Profile WWW
User avatar

Joined: Mon Jul 16, 2007 9:50 am
Posts: 1512
Location: Tallahassee, FL
Reply with quote
Post 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.


Thu May 14, 2009 2:19 am
Profile YIM
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post 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.


Thu May 14, 2009 2:23 am
Profile WWW
User avatar

Joined: Mon Jul 16, 2007 9:50 am
Posts: 1512
Location: Tallahassee, FL
Reply with quote
Post 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...


Thu May 14, 2009 2:45 am
Profile YIM
User avatar

Joined: Fri Jan 26, 2007 3:22 am
Posts: 1451
Reply with quote
Post 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.


Thu May 14, 2009 3:02 am
Profile
User avatar

Joined: Mon Jul 16, 2007 9:50 am
Posts: 1512
Location: Tallahassee, FL
Reply with quote
Post 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.


Thu May 14, 2009 3:21 am
Profile YIM
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.082s | 14 Queries | GZIP : Off ]