Accessing scripts

Announcements, support questions, and discussion for the Dialogue System.
hrohibil
Posts: 368
Joined: Thu Nov 04, 2021 12:50 pm

Re: Accessing scripts

Post by hrohibil »

I did watch that video.

I don’t have any greater or equal to option for this getCurrentCash() >= getFoodPrice()??

I also tried to paste it directly into the condition field without using the custom drop-down???
That did not work either .

I would like to troubleshoot the getCurrentCash() <= getFoodPrice() so I know at least that will work as long as my currentCash is less than foodPrice .

We’re my screenshot correct where I set that parameter to double and the return to book?

Sorry again for bothering you with this Toni I just really want it to work..
User avatar
Tony Li
Posts: 21676
Joined: Thu Jul 18, 2013 1:27 pm

Re: Accessing scripts

Post by Tony Li »

Hi,

You don't need to set up the CustomLuaFunctionInfo asset. It's an optional convenience, and I think it's just making things more confusing right now.

Make sure you've registered your functions correctly:

lua.png
lua.png (61.41 KiB) Viewed 80 times

Then set up your conversation with those functions in the Conditions and/or Script fields. Type it in manually:
  • Player: "I want to buy food."
    • NPC: "Sure thing. Here is today's food."
      Conditions:

      Code: Select all

      getCurrentCash() >= getFoodPrice()
      Script:

      Code: Select all

      buyFood()
    • NPC: "Sorry you don’t have enough cash"
      Conditions:

      Code: Select all

      getCurrentCash() < getFoodPrice()
hrohibil
Posts: 368
Joined: Thu Nov 04, 2021 12:50 pm

Re: Accessing scripts

Post by hrohibil »

Thank you so much Toni!!!!

I was just about to record a video for you but this typing in it manual worked like a charmed!!!
Your are the legend!!!!!!!!!!!!!

Can i just add more into the awake LUA registration as the shop also sell guns?

Thank you again......
User avatar
Tony Li
Posts: 21676
Joined: Thu Jul 18, 2013 1:27 pm

Re: Accessing scripts

Post by Tony Li »

Yes, that's fine.
Post Reply