Before you get too deep into your first project, you might consider a naming convention for all of the elements that you add to a mod. It will make finding things and troubleshooting easier for you. For instance 'Banolzskooma' is not a convenient name unless your name or the mod's name is Banol(z).
For instance, my convention is cyr followed by two letters indicating the mod. E.g., Traveling Merchants is cyr_tm. That is the prefix for all objects (and scripts) in the mod (or will be when version 3.0 is complete). Your journal has the prefix SN_ likely representing your name or the mod's name. If that is an appropriate prefix for the entire mod you would do well to use it on all objects including the custom skooma.
But back to the matter at hand... It is easy to prevent the repeated journal entry by performing a journal check first. This is in itself makes the journal update do-once eliminating the need for the
done flag. This is what your script might look like:
Begin Banolzskoomaif ( OnActivate == 1 ) if ( ( GetJournalIndex "SN_BanolzSkooma" ) < 30 ) Journal "SN_BanolzSkooma" 30 endif Activate endifEnd Banolzskooma
Bethesda is not very careful about this precaution, and it most (all?) instances that I recall the journal is not really updated a second time. Still it is better that the player does not receive the message that it has been updated.
Depending on your exact circumstances, you can trigger the journal update for a different situation. You have for when it is activated, but that will only trigger if the object is accessed from the world. If the object is in a container (as you describe) you will not get the journal update. In your situation a check for
OnPCAdd would be more suitable.
Begin Banolzskoomashort OnPCAdd ; this is a variable not a function so it is declaredif ( OnPCAdd == 1 ) if ( ( GetJournalIndex "SN_BanolzSkooma" ) < 30 ) Journal "SN_BanolzSkooma" 30 endif ActivateendifEnd Banolzskooma
Your note poses different problems. In most situations you want the journal update as a consequence of the player reading the note and not merely for having it in the player's inventory. A note can be read by activating it if it is place in the world. However if it is in a chest (or added directly to the player's inventory) the note must be equipped in order to be read. If that is what you are trying to achieve this is my preferred 'note' script (slightly modified for your purpose). It works whether the note is read from the world or from inventory:
Begin SN_NoteScriptshort readNoteshort OnPCEquipshort PCSkipEquipif ( readNote == 1 ) returnendifset PCSkipEquip to 0If ( OnActivate == 1 ) if ( ( GetJournalIndex "SN_BanolzSkooma" ) < 30 ) Journal "SN_BanolzSkooma" 30 endif set readNote to 1 Activate returnendifif ( menumode == 0 ) returnendifset PCSkipEquip to 1If ( OnPCEquip == 1 ) if ( ( GetJournalIndex "SN_BanolzSkooma" ) < 30 ) Journal "SN_BanolzSkooma" 30 endif set readNote to 1 set OnPCEquip to 0 set PCSkipEquip to 0 ActivateendifEnd SN_NoteScript
Edit: for consistent scripting conventions.