Jump to content

How do I do this Javascript in lua in Urwigo?


Delta68

Recommended Posts

What are you trying to accomplish?  Are you just trying to say you'll allow all values less than or equal to seven until the first number greater than seven is seen, then it's false for all values after that?  You'd have to look in the lua language specification to see if there's an operator that would give you want you want without having to refactor to use an if statement.

Link to comment

I was trying to do bitwise ORs so the player had to talk to three characters before proceeding. Returning to a character a second time would be ignored

 

So, talking to the charaters would OR 1, 2 , 4
Probably a bit excessive for this project so I've used three flags instead now

Thanks

 

Link to comment

Wherigo uses a version of lua that does not come with the bit module. So if you want to implement bitwise operators, you have to implement them yourself.

 

For your problem I think I would define an  array, set the n-th position true and check if they all are true in a loop, (or for just three in an explicit and statement)

 

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...