+waterfan5 Posted December 12, 2013 Share Posted December 12, 2013 My plan is to more or less keep this as place where I will post incompatibilities between that I am aware off being different Wherigo players Quote Link to comment
+waterfan5 Posted December 12, 2013 Author Share Posted December 12, 2013 The emulator will run the following code fine: Wherigo.TranslatePoint(g_ptStartPoint, 50,90) but the Android player wants this: Wherigo.TranslatePoint(g_ptStartPoint, Wherigo.Distance(50, "ft"),90) Quote Link to comment
+waterfan5 Posted December 12, 2013 Author Share Posted December 12, 2013 Iphone app doesn't like PNG or JPEG file extensions. Quote Link to comment
+waterfan5 Posted December 13, 2013 Author Share Posted December 13, 2013 (edited) Iphone App crashes hard without any warning if you have zones that have an invalid zone point See code below for a reproducable example function MoveZones() MoveZone(zMyZone1) MoveZone(zMyZone2) end function MoveZone(zone) local dist = math.random(20,100) local brg =math.random(0,359) DeactivateZone(zone) local point1 = Player.ObjectLocation local point2 = Wherigo.TranslatePoint(ptStartPoint, Wherigo.Distance(dist,'m'), brg-90) point2 = Wherigo.TranslatePoint(point2, Wherigo.Distance(dist,'m'), brg) local point3 = Wherigo.TranslatePoint(ptStartPoint, Wherigo.Distance(dist ,'m'), brg-90) local point4 = Wherigo.TranslatePoint(ptStartPoint, Wherigo.Distance(dist,'m'), brg) zone.OriginalPoint = point1 zone.Points = {point1, point3, point2, point4, } ActivateZone(zone) end function ActivateZone(zone) zone.Active = true zone.Visible= true end function DeactivateZone(zone) zone.Active = false zone.Visible = false end Edited December 13, 2013 by waterfan5 Quote Link to comment
Ranger Fox Posted December 13, 2013 Share Posted December 13, 2013 (edited) Iphone app doesn't like PNG or JPEG file extensions. Yeah, the app should like JPG extensions. (To others, please note the difference in spelling between JPE and JPG.) Edited December 13, 2013 by Ranger Fox I was in an HTML mood and the forum didn't like [strong]; it wanted [b], which is deprecated HTML. Quote Link to comment
+bretina Posted December 18, 2013 Share Posted December 18, 2013 Trying to see what crashes it here, is it the extra comma on the zone.Points (see bolded area)? /// zone.Points = {point1, point3, point2, point4, } Iphone App crashes hard without any warning if you have zones that have an invalid zone point See code below for a reproducable example function MoveZones() MoveZone(zMyZone1) MoveZone(zMyZone2) end function MoveZone(zone) local dist = math.random(20,100) local brg =math.random(0,359) DeactivateZone(zone) local point1 = Player.ObjectLocation local point2 = Wherigo.TranslatePoint(ptStartPoint, Wherigo.Distance(dist,'m'), brg-90) point2 = Wherigo.TranslatePoint(point2, Wherigo.Distance(dist,'m'), brg) local point3 = Wherigo.TranslatePoint(ptStartPoint, Wherigo.Distance(dist ,'m'), brg-90) local point4 = Wherigo.TranslatePoint(ptStartPoint, Wherigo.Distance(dist,'m'), brg) zone.OriginalPoint = point1 zone.Points = {point1, point3, point2, point4, } ActivateZone(zone) end function ActivateZone(zone) zone.Active = true zone.Visible= true end function DeactivateZone(zone) zone.Active = false zone.Visible = false end Quote Link to comment
+waterfan5 Posted December 19, 2013 Author Share Posted December 19, 2013 My example wasn't great: ptStartPoint is uninitialized in my example, android just skips NIL in zone points, but Iphone bombs. Trying to see what crashes it here, is it the extra comma on the zone.Points (see bolded area)? Quote Link to comment
+waterfan5 Posted December 19, 2013 Author Share Posted December 19, 2013 Here is one of those incompatibilities that can mess with you for hours: The order of objects in "cart.AllZObjects" differs between the different modules. Now in general it is bad to assume that there is an order, but it could explain why one crashes and the other doesn't. Here is an example: you have a zone and media with same name "Monster 1" Now consider the code below. For Emulator and Iphone, my app didn't crash as hard-coded media are always the first in the AllZObjects table. However, on Android, Zones come before Media and this code crashed, as the 'table.get' returns a zone and not the media I was looking for. Ways to prevent this is not to have duplicate names, or to use ID for the table retrieval and not the name. In Urwigo that would mean you have to hard-code all IDs. function TestX() local thisname="Monster 1" local objMedia = table.get(myCart.AllZObjects,thisname) Wherigo.MessageBox{Text="Hello world",Media=objMedia} end -- Get item from table function table.get(table, name) for _, value in pairs(table) do if value.Name ==name then return value end end return nil end Quote Link to comment
+bretina Posted December 19, 2013 Share Posted December 19, 2013 Ahh ok, I see it now. B.t.w. this is a fabulous topic thread. I've been having major headaches with the differences in the players. I have a couple play-anywhere cartridges that will not work on Android, but work on Oregons & iPhone. I have several other Play Anywheres that work fine on Android. Just have not been able to fix it, but coding for 3 platforms is just frustrating. The net effect is I have to put out simple/easy/basic cartridges now as to do anything beyond that I have problems. My example wasn't great: ptStartPoint is uninitialized in my example, android just skips NIL in zone points, but Iphone bombs. Trying to see what crashes it here, is it the extra comma on the zone.Points (see bolded area)? Quote Link to comment
+charlenni Posted January 23, 2014 Share Posted January 23, 2014 It would be nice to have this test cartridges in gwc file format, so zjey are usable for testing. Very best would be, if you make a zip from gwz and gwc, so the we could use it for testing and debuging. Thank you. 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.