I'm trying to learn how to check if something is in a notebox. I'm thinking of getting into scripting, and with some ideas I have for the future, I want to know how I can check the notebox for something like "<Bible>"
Check a notebox
Learning Ruby and RGSSxThere are several approach. Including....
Or this
Or this
Code:
$data_something[ID].note.include?("<notetag>")
Code:
$data_something[ID].note[/<notetag>/]
Code:
class RPG::Something
def is_something
self.note[/<notetag>/]
end
end
# Usage
$data_something[ID].is_something
So let's say I had the following effect:
"Erase all negative effects."
So then I would want to erase only states with the <negative> notetag.
Secondly, if I wanted to then add the effect "Heal 5% HP for every negative effect erased", how would I do that?
Thirdly, if I had something like "Erase two negative effects", how do I do it and possibly prioritize it? (Like, the two earliest negative ailments are erased only).
"Erase all negative effects."
So then I would want to erase only states with the <negative> notetag.
Secondly, if I wanted to then add the effect "Heal 5% HP for every negative effect erased", how would I do that?
Thirdly, if I had something like "Erase two negative effects", how do I do it and possibly prioritize it? (Like, the two earliest negative ailments are erased only).
Assume you know how to code RGSS, I'd give you pointer.
Every of your question could be done by simply iterate the @states
Where to insert? You can try to insert on item_effect_apply
Every of your question could be done by simply iterate the @states
Code:
@states.each do |state_id|
if $data_states[state_id].negative?
remove_state(state_id) # your first question
heal_hp # your second question
break if two_times_already # your third question
end
end
Code:
if $data_states[state_id].negative?
Wouldn't I need to add "note" and "<negative>" for it to target notetags or does that automatically look into notetags (and will it look for "<>")?
Of course you need the tag. I assume you already have the tag and know how to make one as we have already discussed that in previous reply
Original thread: https://forums.rpgmakerweb.com/threads/check-a-notebox.91897/