Please help me about script for Skill Note

Hi guys,

I have changed the display of skill description to allow it to get the text i write in its Note Box overwritting this method:

class Window_Help < Window_Base #-------------------------------------------------------------------------- # * Set Item # item : Skills and items etc. #-------------------------------------------------------------------------- def set_item(item) set_text(item ? item.description + "\n" + item.note : "") endendThe problem is: I'm using other scripts that required Note Tags "<example>" in the Note Box in order to use, and the method above also write these Note Tags inside my description. Now i want to changed this Set_Item method to ignore any Note Tags between these "<" and ">" or only display from a certain line (Like display from line 5 in Note Box cuz 1 to 4 are used for Note Tag of other scripts) so how can i do it?
I can't test this now, but you can try this:

item.note.gsub(/\s*<.+>\s*/, " ")This should replace all occurences of "<...>", including the whitespaces around, with a space.
unfortunately it depends on the scripts in your project if a simple filter of the <..> tags will work or not - some scripts have different formats for their tags, for example https://yanflychannel.wordpress.com/rmvxa/battle-scripts/lunatic-targets/

(check the second option there - the "String" would still be printed in such a case).

It would be a lot better if you follow the same structure as all scripts do: instead of ignoring other notetags and use what is left, define your own tag, search for it and then use only that part of the notetag to display.

for example

<item description>description as you want</item description>
That is a lot more work, but it will improve compatibility and still allow you to use the note box for its original purpose: your developer notes that no one can see ingame.
unfortunately it depends on the scripts in your project if a simple filter of the <..> tags will work or not - some scripts have different formats for their tags, for example https://yanflychannel.wordpress.com/rmvxa/battle-scripts/lunatic-targets/

(check the second option there - the "String" would still be printed in such a case).

It would be a lot better if you follow the same structure as all scripts do: instead of ignoring other notetags and use what is left, define your own tag, search for it and then use only that part of the notetag to display.

for example

<item description>description as you want</item description>That is a lot more work, but it will improve compatibility and still allow you to use the note box for its original purpose: your developer notes that no one can see ingame.
I know the method from lavra can't be used in some certain script tags and defining an own tag like you mentioned is the best way. But actually i have very very little knowledge about scripting so it is really hard for me to do this.
item.note.match(/<note>(.+)<\/note>/).flatten.joinNow this is still untested and will probably not work quite right, but in theory it should get you everything encased in "<note>...</note>", join it together and give you the string back.

Did i mention i'm one of the few guys who actually like regexes? 😀
item.note.match(/<note>(.+)<\/note>/).flatten.joinNow this is still untested and will probably not work quite right, but in theory it should get you everything encased in "<note>...</note>", join it together and give you the string back.
I have tested your method with the single <note> you mentioned above and it worked, but somehow it added some space before the description text. I think it is caused by some <note> i used above the description.

And about <note>...</note>, i have not used any of them so i'm not sure about that, but i will remember this method and try it when necessary.
Ah, in this case you can just change the tagname to something else that is unique.
I wrote the description over all tags and the problem about odd space was solved.

By the way, Andar's method is highly recommended for those who are good at scripting (not including me ;_;  ) 

Thank you all for your help  🙂

Original thread: https://forums.rpgmakerweb.com/threads/please-help-me-about-script-for-skill-note.39092/