Getting bool from other script!!!!

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Jacobcullen
Posts: 2
Joined: Sat Mar 09, 2019 4:31 am

Getting bool from other script!!!!

Post 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/
Last edited by Jacobcullen on Sat Mar 16, 2019 3:04 pm, edited 1 time in total.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Getting bool from other script!!!!

Post 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)
bhaiterabhai
Posts: 1
Joined: Mon Feb 03, 2020 11:57 am

Re: Getting bool from other script!!!!

Post by bhaiterabhai »

I tried multiple times, with GetComponet and public calling said script, but i cannot access the public bools from this other scripts
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Getting bool from other script!!!!

Post by Tony Li »

Please post the code you're using to try to access the variables.
Post Reply