Note-tags are a common way for users to provide input.
However, different scripters have different ways of treating notes. The two general ways are
1. parse the note once and cache the values in instance variables
2. parse the note everytime a value is needed
The first approach assumes that the note does not change and essentially treats it as initialization data.
The second approach does not assume this and assumes someone may be modifying your note whenever they want and expect you to pick up the new value. Which is of course more forgiving and better for compatibility because it's not hard to modify a note right? It's a string after all (well, by default anyways)
I think it can be difficult to accurately modify a note. There are several different operations
1: append a tag. This is easy, and it would be pretty easy to do it right
2. Modify a tag. This may be somewhat difficult depending on how many other tags the note is cluttered with. For the most part would require you to extract the correct tag and then subsitute or re-build it.
I say it's better to just never try to modify a specific "field" on the note, and instead modify the instance attribute directly if it needs to be changed.
However, different scripters have different ways of treating notes. The two general ways are
1. parse the note once and cache the values in instance variables
2. parse the note everytime a value is needed
The first approach assumes that the note does not change and essentially treats it as initialization data.
The second approach does not assume this and assumes someone may be modifying your note whenever they want and expect you to pick up the new value. Which is of course more forgiving and better for compatibility because it's not hard to modify a note right? It's a string after all (well, by default anyways)
I think it can be difficult to accurately modify a note. There are several different operations
1: append a tag. This is easy, and it would be pretty easy to do it right
2. Modify a tag. This may be somewhat difficult depending on how many other tags the note is cluttered with. For the most part would require you to extract the correct tag and then subsitute or re-build it.
I say it's better to just never try to modify a specific "field" on the note, and instead modify the instance attribute directly if it needs to be changed.
Last edited by a moderator:
