Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.
Im new to RMXP and have a very basic understanding of events and variables. What i want to know is how do i make a certain item drop off of a random monster once a quest is accepted, but the item only drops once. Ive created a new monster that has the item as a drop, but i cant seem to make it appear for the quest. Ive looked for a tutorial and havent found one :S help or a link to a tutorial will be great :D thanks!
well i want them to be just a random encounter, but thats only active during the quest. if thats making sense. So when the quest is accepted, you will be able to encounter the monster and get the item, but when the quest is completed, u cant encounter the monster anymore.
Hmm...
If I was doing this, I would make the quest, and the probability of getting the item, a variable. Then, this is what I would do.
@>Control Variables:[0010]+=RandomNo.(0...10)
@>Conditional Branch: Variable[0009]==1
@>Control Variables:[0010]+=RandomNo.(0...10)
@>Conditional Branch: Variable[0010]>=5
@>Text: You gained the item!
@>Change Items: [quest item], +1
@>
: Else
@>Text: You find nothing.
@>Control Variables:[0010]=0
@>
: Branch End
@>
: Else
@>
: Branch End
What that does is, if you have taken on the quest,which you need to get the item, that variable is set to one and the first conditional branch is passed. Then the chance of getting the item is a random number, and the second conditional branch is checking to see if that random number is equal to or above a set value. If it isn't, then you don't get the item and the variable number returns to zero for another try.
If you place that on your random monster troop list, with the variable of enemy HP=0, that should mean that you get the item at the end of the battle.
Well, if you only want/need one item, you could add @>Control Variable: [0009=quest]+1 if you get the item, then the quest will be finished and won't match the first conditional branch.
EDIT:
You would still encounter the monster, but you wouldn't get the item.
yea, im not too good with understanding the script, so i dont know whats wrong :S ive hopefully followed what you've said correctly, when i test it the item drops before i talk to the quest giver. now wether i've labled the quest wrong i dont know :S
Well, if you have the event as:
@> Text: (Random text)
@>Conditional Branch: Variable[0009]==0
@>Control Variables: (quest variable): +1
: Else
: Branch End
Huh.... I thought I'd put that in. Good spotting Wichu!
Yeah, you could turn the quest variable to 0, or raise it up to 2, which could signal the completion of the quest. I would personally raise the variable, since if it's at 0, you might be able to do the quest again. And if it's at 2, then you can add an event that will only work once you have completed the quest.