@Fat Cerberus While testing some changes I made, I bumped into one of the armos statues in the underworld which uses a different code then the overworld statues. The debugger stopped the game with an "illegal path". My code had a leading "/" on the rss path. The debugger has become a very useful tool. I never would have found that error using 1.5.
var MapCompass = [];MapCompass[0] = [false, false, x, y];
if (MapCompass[0][0] == true && MapCompass[0][1] == true) image.blit(MapCompass[0][2], MapCompass[0][3]);
var MapCompass = [];MapCompass[0] = { haveMap: false, haveCompass: false, x: x, y: y };
if (MapCompass[0].haveMap && MapCompass[0].haveCompass) image.blit(MapCompass[0].x, MapCompass[0].y);
That's a really awkward use of arrays there. You could use an object instead:
Code: [Select]var MapCompass = [];MapCompass[0] = { haveMap: false, haveCompass: false, x: x, y: y };Code: [Select]if (MapCompass[0].haveMap && MapCompass[0].haveCompass) image.blit(MapCompass[0].x, MapCompass[0].y);Object literals are basically the best thing about JS and the main reason I fell in love with it.
Also: You don't need to explicitly compare against true in an if statement, the comparison is implied.
Seeing NES Link in FF6 graphics did the brain a hurt.
Quote from: Chad Zechs on September 14, 2017, 05:28:08 pmSeeing NES Link in FF6 graphics did the brain a hurt.@Chad Zechs Brain a little less hurt?
Quote from: Miscreant on September 18, 2017, 12:05:09 pmQuote from: Chad Zechs on September 14, 2017, 05:28:08 pmSeeing NES Link in FF6 graphics did the brain a hurt.@Chad Zechs Brain a little less hurt?Haha y'know I was thinking of that too. Have him metamorph into aLttP link when he enters the ship. Me likey.Also, I haven't had a chance to hit my head against the front of the ship but I've sketched out an idea. Hopefully I'll have something for you this week (regardless of if you'll need it, I'm intrigued to try)
huh? Very simple. If x = 39 destroyperson... why the is he still there when his x = 39?
while(GetPersonX('OldMan') !=39){ UpdateMap(); RenderMap(); FlipScreen();}DestroyPerson("OldMan");
Quote from: Miscreant on September 18, 2017, 03:43:21 pmhuh? Very simple. If x = 39 destroyperson... why the is he still there when his x = 39?That looks like a script that runs once? If yes - the commands to move are queued then the condition is checked (he won't have moved yet so I assume the condition returns false) that then the movement commands execute.
Movement commands do not happen during script execution - in general, sphere is entirely single threaded, at any given time only one thing can be happening.Options:1. Simple option you could use QueuePersonScript to queue destroying the person - this would trigger as soon as the movement queue emptied - no reason to put in a condition check it would just be when he stopped moving.
That's interesting, there seems to be a bug in Sphere 1.5's handling of queued person scripts from the looks of things. Not sure what's wrong yet, I can look into that later.
2. You could put the condition check and DestroyPerson command into the update script - though this seems excessive for a one time event.3. you could put a loop into the script that does:Code: [Select]while(GetPersonX('OldMan') !=39){ UpdateMap(); RenderMap(); FlipScreen();}DestroyPerson("OldMan");UpdateMap and processes the movement queue and Render Map draws the map - a loop like this basically runs the map engine during your script, if you want to have other things happen after the Old Man finishes moving this another way to do it. (Though simply using QueuePersonScript("Old Man", "DestroyPerson('Old Man');", false); may be easier.)