+tozainamboku Posted February 24, 2012 Share Posted February 24, 2012 I got an email from someone playing my cartridge with the iPhone player. They got to a point in the game where I ask a series of questions (using Inputs). Each answer is a number. When the last question is answered, I compute a checksum and display the answers given and whether or not the checksum is correct. If it isn't, the Player is given a chance to enter the answers again. The Player reported that the cartridge crashed after he entered the answer to the last question. My first question has to due with Lua on the iPhone. I compute the checksum via a call to a Lua function that takes a variable number of arguments and calls itself recursively. Here's the function function sum(s, ...) if s == nil then return 0 else return s + sum(...) end end Is there something with Lua on the iphone that it can't handle this function? I suppose that I could just add the 5 numbers together and avoid calling this function. After the cartridge crashed, the Player was able to restart the iPhone app. It's not clear from his email if he reloaded the last saved game or if the iphone just restores an image of what it last had. It seems, however that he was still able to see some zones and was able to move from zone to zone but didn't see everything he should have seen in the zones. If he restored the last saved game, it is likely that these zones were not active. I am wondering if the iPhone app might show inactive but visible zones and allow users to navigate from zone to zone. In that case the cartridge may not be updating the items and characters that are visible as you exit or enter zones. The description I got from the user would be consistent with restoring the last saved game and then being in a different inactive zone. Quote Link to comment
+jonny65 Posted February 24, 2012 Share Posted February 24, 2012 Do you use "handwritten" lua code or is this the lua code generated from urwigo ? The expression "numeric operation" in urwigo placed in a function which you call several times and each time you add a number, should be a simple way without any conflicts. Quote Link to comment
+charlenni Posted February 25, 2012 Share Posted February 25, 2012 I think, the problem on the iPhone player are arrays and I think, ... is one. On normal lua interpreters you get a nil if you access an entry, which didn't exist in the array. The player on the iPhone crashes. If you do tab = {1,2,3} print(tab[4]) you would get on the iPhone player a crash, on all other players you would get a nil. Quote Link to comment
Recommended Posts
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.