Jump to content

Got Event Handler working for Notes!


EPDGaffney

Recommended Posts

These two scripts:

scn NoteEventHandlerQuestScript

int DoOnce

Begin GameMode
    SetOnMenuClickEventHandler OnMenuClickUDF 1 "MapMenu/GLOW_BRANCH/MM_MainRect/MM_NotesList"
    Set DoOnce to 1
    If DoOnce == 1
        Set DoOnce to 2
    EndIf
End

Begin GameMode                                 ; Note that I tend to 'over-check' in my scripts, to be certain it will work as intended.
    If DoOnce == 2                             ; DoOnce probably didn't need to go past 1 before stopping the script.
        StopQuest NoteEventHandlerQuest
    EndIf
End
scn OnMenuClickUDF

int iMenuID
int iElementID
string_var sElementName

string_var sNoteName
string_var sNoteNameUI


begin Function {iMenuID, iElementID, sElementName}

    let sNoteName := LnGetName NoteEditorID
    let sNoteNameUI := GetActiveUIComponentFullName
    if eval ((Sv_Find "MM_ListItem", sNoteNameUI) > -1) ; check if UI component is a note
        let sNoteNameUI += "/ListItemText/string"
        let sNoteNameUI := GetUiString $sNoteNameUI ; get the name of the highlighted note
            if eval (sNoteName == sNoteNameUI)
                ; do something
            endIf
    endif


    sv_Destruct sElementName, sNoteNameUI, sElementName ; Don't forget to put all the string_vars here

end

Credit to xqdcss and JIP for putting the final touches on what Ladez and Docta Sax initially helped me put together. And me for not taking no for an aswer when the GECK rejected me ten times a day for the past week.

Edited by EPDGaffney
Link to comment
Share on other sites

  • Replies 43
  • Created
  • Last Reply

Top Posters In This Topic

Congrats on forcing the GECK into submission.

 

My only question is: was it necessary to use two GameMode Blocks in order for "NoteEventHandlerQuestScript" to work correctly? Presumably so the script will only process for one frame?

 

-Dubious-

Edited by dubiousintent
Link to comment
Share on other sites

Far as I know, you can't stop a quest from its own script otherwise, and sure enough, when I first wrote it all in one block, it wasn't stopping.

 

Edit: I was going to message you about this in case you wanted to use it in your guide. I asked a lot of people with more experience coding in this engine than I have, and only when I mentioned it on the JIP LN page did I get an answer, which leads me to believe this is something the community are largely unaware of how to do. Not that it would be a terribly common occurence that someone would want to do this, but still...

Edited by EPDGaffney
Link to comment
Share on other sites

I actually meant the idea of interacting with a note in your Pip-Boy. The occurence of such a thing in my mod is quite rare and it doesn't seem to be remotely common knowledge that it's even possible. I don't think many modders would need it, but I do think that the ones that do are going to struggle with finding a way to do so (as I did).

 

Also, happened to find a section in your guide that I think is a bit outdated:

 

 

A "message" is its own kind of object; like a "sort of" note, with it's own Form-ID. The command "ShowMessage" needs a Form-id to point to. You can't just use the message text directly as a parameter. There are 2 kinds of messages though. Read up on Message in the GECK wiki.

There are now many, incredibly convenient functions available via NVSE and JIP LN that facilitate passing message text directly as a parameter, which for whatever reason are not mentioned on the Bethesda wiki or the new one. Your link is to the old wiki, which if I remember right you would prefer to have be a link to the new one, and I would mention that there are new functions so long as the user install plug-ins to take advantage of that.

Link to comment
Share on other sites

 

Also, happened to find a section in your guide that I think is a bit outdated:

 

 

A "message" is its own kind of object; like a "sort of" note, with it's own Form-ID. The command "ShowMessage" needs a Form-id to point to. You can't just use the message text directly as a parameter. There are 2 kinds of messages though. Read up on Message in the GECK wiki.

There are now many, incredibly convenient functions available via NVSE and JIP LN that facilitate passing message text directly as a parameter, which for whatever reason are not mentioned on the Bethesda wiki or the new one. Your link is to the old wiki, which if I remember right you would prefer to have be a link to the new one, and I would mention that there are new functions so long as the user install plug-ins to take advantage of that.

 

LOL ... that sounds like something I wrote ? And yes I am finding I am rather behind the times. :ohmy:

Link to comment
Share on other sites

Haha, well, the old wiki is still useful, in that I haven't found any (potential) misinformation that isn't repeated in the new one, but the new one relatively thoroughly documents all the new JIP functions, whereas anything that JIP released after the new wiki was made will not be mentioned on the Bethesda wiki, at least unless someone is copying the entries from the new wiki, which I don't think anyone is.

Link to comment
Share on other sites

Well thanks for being you ... and stepping up the level of scrutiny. Which I guess I have been hack and slash kind of offering advice on modding. Although I do pride myself on thinking outside the box. Which is finding out just how many roads lead to Rome kind of thing. But eventually ... it is just worthless drivel since I shoot from the hip a lot of times. Un like dubious's attempts to be accurate and thorough.

 

On a side note about your moniker pic. I don't know why exactly ... but I always got the impression it was you holding a 6 string bass. And a closer look ... is a person at the bottom of a winding stair case?

I play bass by the way ... just 4 string though.

So was a little like ... you had my same interests ... but a step or 2 up .

Link to comment
Share on other sites

That's me holding a bowler and cane, inserted into an image from the 2002 Resident Evil remake, as RE is my favourite series (the old ones at least).

 

But I am a musician before anything else, so you somehow got me anyway. I grew up listening to and playing/writing metal, and now I mostly do orchestral stuff but still have a fondness for metal done 'right'. Never played bass however. I assume you mean bass guitar, not upright, as I did play upright for a bit.

Link to comment
Share on other sites

Re: "I actually meant the idea of interacting with a note in your Pip-Boy." How else would you (without a mod built for the purpose; of which I am not currently aware any exist)? Clarification, please? (Recall that we have only seen snippets of code from your work in this area; not a full implementation to see how it is "different".)

 

Re: obsolete info regarding "notes". I can certainly add that there are now more functions available by way of JIP LN NVSE, but it would be more helpful to new mod makers to have a list of such that I can then link to on the wiki. Please remember that I am just collecting this information; not usually implementing it. As someone who has actually looked at those functions for their suitability to your purpose, you will have a much better idea as which are useful than I will simply looking at the myriad of descriptions.

 

And I at least am grateful for your willingness to assist in contributing this knowledge.

 

-Dubious-

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...