Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

! var definition is ignored #122

Open
oakandsage opened this issue Jun 14, 2018 · 4 comments
Open

! var definition is ignored #122

oakandsage opened this issue Jun 14, 2018 · 4 comments

Comments

@oakandsage
Copy link

Using version 1.14.9, with the following begin.rive

! version = 2.0

! var myvar = hello

+ print
- myvar is <get myvar>

I expect that the user input print will result in myvar is hello but instead, it results in myvar is undefined

I also tried putting the print trigger into a different file titled hello.rive but this didn't change the behavior.

@kirsle
Copy link
Member

kirsle commented Jun 14, 2018

Hi

! var myvar = hello sets a bot variable named myvar and you'd retreive it with <bot myvar>

User variables are set with <set> and retrieved with <get>.

! version = 2.0

! var myvar = hello

+ print
- myvar is <bot myvar>

@oakandsage
Copy link
Author

oakandsage commented Jun 14, 2018 via email

@snoopyjc
Copy link
Contributor

I agree naming the command "! var" to set them and to get them is confusing. Same applies to the other types of variables.

@johnnymast
Copy link

Hi, Author of Rivescript-PHP here, This is kind of off-topic but the Rivescript specs also dictate you can set bot variables in responses. This is something I missed while implementing the bot command.

+ init 
- <bot name=Johnny>done.

+ what is your name
- my name is <bot name>

I know this is off the topic of this issue but I assume not many developers know of this ability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants