prop man. device - Getting the prop of the DamagedEvent?

Instead of making so many instances of the prop manipulator device I was wondering if we can just get the prop which caused the prop manipulator device to propagate the Damaged Event?
It’s not so useful to know that “a prop” was damaged or destroyed but rather I want to know exactly which prop so that I could read data from a custom prop and do something with that.
I’m guessing not since the API documentation doesn’t cover anything like that.

How have you solved this problem?
To me it sounds like one way is to have a tag and attach it to each prop manipulator which observes a prop of the type I want to observe so that I know which kind of item was damaged or destroyed, then during loading I would get all devices with that tag and Subscribe to that event. I was kind of hoping to be able to skip this whole tagging process and just subscribe to each and every prop manipulator and then getting the prop being damage to determine what logic I want to use.

It’s really unfortunate the prop man doesn’t provide the prop in the event.

For a lot of my props, I’ve created a prop man and attached it to each prop. When I duplicate a prop I select it and it’s prop man together so I make a new pair. I have to add these to @editable arrays in my custom device(s) in the same order (so the Verse code can match prop and prop man … prop[0] and propMan[0], then prop[1] and propMan[1]). Tedious, but it works. I set these individual prop mans to use a very small zone covering a small part of the prop.

I tried using tags on the props and prop mans, and could associate the prop and prop man based on their locations (within a small margin of each other) but, at least back when I tried this 1+ year ago, I found it worked most of the time, but didn’t seem to be reliable, so I gave up on it.

In an older project I haven’t touched in over a year, I think I did something that was pretty useful (easier at least) - but I only cared about eliminations in that case (custom loot chests). As far as I recall I used a single prop man with a large zone covering many chests, when I got an elim event i loop through all the chests to find any for which IsValid was now false - then I dropped loot at the transform stored for that chest, and removed it from the valid chests list.

Yeah that sounds really tedious. Still, good job in finding a workaround.

Assuming you registered all props in that manipulator, and that the pivot points of those props are set correctly, you could use a method like this

FindClosestProp(Player: player)<transacts><decides>:creative_prop=
    var RetProp : ?tuple(creative_prop, float) = false
    Character := Player.GetFortCharacter[]
    PlayerCheckLocation := Character.GetTransform().Translation + Character.GetViewRotation().RotateVector(vector3{X := 150.0})
    for(
        Prop : Props
        Prop.IsValid[]
        DistanceToPlayer := Distance(Prop.GetTransform().Translation, PlayerCheckLocation)
        MinDistanceToPlayerFound := if(Tuple := RetProp?) then Tuple(1) else 9999.9
        DistanceToPlayer < MinDistanceToPlayerFound
    ):
        set RetProp = option{(Prop, DistanceToPlayer)}
    RetProp?(0)

Thanks for the input, yeah I guess comparing distance might be the best bet for now. At least it’s a somewhat interesting problem to work with the tools available to come up with solutions on how to make the gameplay features one wants

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.