Jump to content

Author Functions in Urwigo


nuclearjanitor

Recommended Posts

I would like to use an author function to manipulate a variable set by a user input, display a message, and alter attributes of character commands. I understand how to do this in Builder; however, that syntax does not appear to be the same as Urwigo. I tried reading the code in the *.urwigo file to glean something there, but that is proving to be most difficult. Can somebody please offer some advice on syntax for arguements in author functions.

 

Example, this is how I would write it in Builder. What is the translation to Urwigo speak?

 

function zinputQuestion1:ongetinput(input)

local var_name_1 = tonumber(input)

local var_name_2 = (var_name_1 * 2)

Wherigo.MessageBox{Text=[[Thank you, the answer is: ]] ...var_name_2... ,}

zcharacterGuy.Commands["Question1"].Enabled = false

zcharacterGuy.Commands["Question2"].Enabled = true

end

 

Thank you!

Nick

Link to comment

Well, I may still be in the Builder mindset... I have discovered, and am exploring, the 'Numeric operation' expression in Urwigo. This may free me from the need of an author script that would have been required for this operation in Builder...

 

I am liking Urwigo more and more...

 

I am still interested in syntax for author scripts, though it may just be for curiousity's sake.

Link to comment
On 11/2/2010 at 7:10 PM, nuclearjanitor said:

I would like to use an author function to manipulate a variable set by a user input, display a message, and alter attributes of character commands. I understand how to do this in Builder; however, that syntax does not appear to be the same as Urwigo. I tried reading the code in the *.urwigo file to glean something there, but that is proving to be most difficult. Can somebody please offer some advice on syntax for arguements in author functions.

 

Example, this is how I would write it in Builder. What is the translation to Wherigo speak?

 

function zinputQuestion1:ongetinput(input)

local var_name_1 = tonumber(input)

local var_name_2 = (var_name_1 * 2)

Wherigo.MessageBox{Text=[[Thank you, the answer is: ]] ...var_name_2... ,}

zcharacterGuy.Commands["Question1"].Enabled = false

zcharacterGuy.Commands["Question2"].Enabled = true

end

 

Thank you!

Nick

Thinking About It, It sounds easy, although I thought This is not possible.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...