Get value from a plugin-variable

Hi @All,

I write on a Quest-Plugin. Actual, I can start and finish a quest with set quest-rewards automatical. The quest where read in with a JSON-File in an array. Now, I will write in RMMV a if-else-statment, who use information from the plugin like:
Person1:
if quest 2 is finished, then say "Great job, next step", else "You must finished the quest first".

Must I use if-else with script? What must I write in RMMV? What in the plugin?

Thanks for your efforts,
Benjamin
show your code
show your code
What should I show? I don't know, how I must write it 🙂

In RMMV is an NPC, they should say an other text, if the quest 2 ist finished. So, my idea is, I can use the if-else statemant in RMMV to "ask" my plugin "is the quest finised?" and dependet on the awnser (0 or 1) the NPC say text 1 or 2.

What must I do, to realize this?
The if condition event script has a box at the bottom of the last tab for a script call. Put the plugin variable into that box.
Without knowing what you named the quest variables, we can't do much other than give you an idea of where to put it.
The if condition event script has a box at the bottom of the last tab for a script call. Put the plugin variable into that box.
Without knowing what you named the quest variables, we can't do much other than give you an idea of where to put it.

THX 🙂 The quests are in an array. So I write a function to return the value of the quest:
Code:
function getQuestAbgeschlossen(id){
    _debugLog('getQuestAbgeschlossen aufgerufen mit '+id);
    for(var index in bquests){
      if(bquests[index].id == id){
       return bquests[index].abgeschlossen;
      }
    }
  }

So, what must I write in the script-field of the if-statement im RMMV? 🙂
If I'm not mistaken, this function will return true if the quest id supplied to it is completed, so the script box could simply contain
getQuestAbgeschlossen(x), where x is the id you want to check.

Here's a screenshot:
upload_2017-12-22_18-34-19.png
If I'm not mistaken, this function will return true if the quest id supplied to it is completed, so the script box could simply contain
getQuestAbgeschlossen(x), where x is the id you want to check.

Here's a screenshot:
View attachment 78746

Thx so much. 🙂 So, I thought again complicated, than it is ;-)

Merry christmas and a happy new year @All 🙂

Original thread: https://forums.rpgmakerweb.com/threads/get-value-from-a-plugin-variable.88776/