Calling Method From Sequence; Not Working

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
DrewThomasArt
Posts: 60
Joined: Thu Mar 24, 2022 12:07 am

Calling Method From Sequence; Not Working

Post by DrewThomasArt »

I'm trying to have the player buy an item from the shop within a conversation, but the method isn't being called at all (no Debug.Log being shown)

But it works when I want it to spawn coins, using this:
SendMessage(SpawnMyCoins,,Tarul);
{{defaultsequence}}

But when I do the same thing for adding items,
SendMessage(AddSmallPot,,Inventory);
{{defaultsequence}}

Nothing happens. The only code I have in "void AddSmallPot" is the Debug.Log, that's not showing up.
Suddenly it says "Unrecognized shortcut, defaultsequence", and when I remove defaultsequence, it says nothing but doesn't work.
I tried to register it as a Lua but it's been too confusing and I don't know what to write and where to put it.
Any help is greatly appreciated, all I want to do is call the method from my inventory script
User avatar
Tony Li
Posts: 21962
Joined: Thu Jul 18, 2013 1:27 pm

Re: Calling Method From Sequence; Not Working

Post by Tony Li »

Hi,

Try:

Code: Select all

SendMessage(AddSmallPot,,Inventory);
{{default}}
The special keyword is {{default}}, not {{defaultsequence}}.

Also make sure only one GameObject is named "Inventory" and that it has the script with the AddSmallPot() method.

If that's not possible, you could register a Lua function instead, or hook up a scene event. (One caveat with scene events: you can't export or import from other sources such as articy:draft because scene events are Unity-specific.)
DrewThomasArt
Posts: 60
Joined: Thu Mar 24, 2022 12:07 am

Re: Calling Method From Sequence; Not Working

Post by DrewThomasArt »

Tony Li wrote: Wed Nov 09, 2022 9:52 pm Hi,

Try:

Code: Select all

SendMessage(AddSmallPot,,Inventory);
{{default}}
The special keyword is {{default}}, not {{defaultsequence}}.

Also make sure only one GameObject is named "Inventory" and that it has the script with the AddSmallPot() method.

If that's not possible, you could register a Lua function instead, or hook up a scene event. (One caveat with scene events: you can't export or import from other sources such as articy:draft because scene events are Unity-specific.)
Ah, got it thank you, it's working now
User avatar
Tony Li
Posts: 21962
Joined: Thu Jul 18, 2013 1:27 pm

Re: Calling Method From Sequence; Not Working

Post by Tony Li »

Glad I could help!
Post Reply