Page 1 of 1
scriptable objects and conditions
Posted: Sat Aug 26, 2023 2:35 pm
by NedSanders
Hi!
On the suggestion of Tony Li, I'm using scriptable objects to track certain variables (specifically skills) with numbers attached to them. These obviously are kept separately from the variables in the dialogue system interface. If I want to simply reference them in conversation conditions or use scripts/sequences to change them how do I go about doing this?
Re: scriptable objects and conditions
Posted: Sat Aug 26, 2023 2:54 pm
by Tony Li
Hi,
Write C# methods to access those variables. These C# methods will have to act globally -- for example, accepting a character's name:
Code: Select all
public bool HasLockpickingSkill(string characterName) { ... }
or operating on the conversation's current conversant:
Code: Select all
public bool DoesCurrentConversantHaveLockpicking() { /* check DialogueManager.currentConversant ... */ }
Then
register those methods with Lua.
Re: scriptable objects and conditions
Posted: Sun Aug 27, 2023 7:50 am
by NedSanders
Thanks for the quick reply, Tony.
Could you go into a bit more detail about how to do this? (specifically writing 'methods') - or if not, direct me to some resource that may help me better understand?
Ultimately, all I really need to do is check if a scriptable objects value is above a certain value in the conditions field.
Re: scriptable objects and conditions
Posted: Sun Aug 27, 2023 8:59 am
by Tony Li
Hi,
The link in my previous reply contains instructions and a link to a video tutorial. It does require a bit of familiarity with C# scripting, though, so if you have any questions at all please let me know how I can help.