Page 1 of 1

Getting bool from other script!!!!

Posted: Fri Mar 15, 2019 5:03 am
by Jacobcullen
If I want to set as a condition the bool from a script outside the Dialogue System, how should I proceed?

I have a public bool IsItemInInventory(string searchedObject) in Inventory.cs, which uses the RPG.Core namespace.

Now I want to only display conversation option 2 if this bool returns true for IsItemInInventory("FireEssence"), i.e. I need the true value of this bool to be a condition.https://appsync.biz/solitaire/ 9apps.ooo/ https://bluestacks.vip/

Re: Getting bool from other script!!!!

Posted: Fri Mar 15, 2019 8:38 am
by Tony Li
Hi,

To do that, you will use the Dialogue System's Lua functionality. Register IsItemInInventory() with Lua, and then use it in conversation option 2's Conditions field. (See: Registering Functions)

Re: Getting bool from other script!!!!

Posted: Mon Feb 03, 2020 11:58 am
by bhaiterabhai
I tried multiple times, with GetComponet and public calling said script, but i cannot access the public bools from this other scripts

Re: Getting bool from other script!!!!

Posted: Mon Feb 03, 2020 12:52 pm
by Tony Li
Please post the code you're using to try to access the variables.