Jump to content

Get Form ID


craynaar

Recommended Posts

I'm trying to get the form type or ID of an object that gets "activated' by the player. every time I output it to the logger I get "REFR" for everything and not "WEAP" for weapon or "BOOK" for books or "DOOR" for doors ect.

    RE::BSEventNotifyControl ProcessEvent(const RE::TESActivateEvent* event,
                                          RE::BSTEventSource<RE::TESActivateEvent>*) override {
        auto eventObject = event->objectActivated.get()->GetSavedFormType();
        auto formIntoString = RE::FormTypeToString(eventObject);
        auto eventObjectName = event->objectActivated.get()->GetName();
        logger::info("{} activated of form: {}", eventObjectName,formIntoString);
        return RE::BSEventNotifyControl::kContinue;
    }

This is what I'm trying to do. GetName() works just fine. But I'm trying to filter for one specific group of objects (in my case, FLOR for Flora).

I'm not sure how to pull that identifier out of the event object. I've tried multiple functions but they either don't compile, or give REFR for everything as well.

Edited by craynaar
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...