Skip to main content

News

Topic: Project ZeC (My Zelda-esque Clone) (Read 61466 times) previous topic - next topic

0 Members and 5 Guests are viewing this topic.
  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Project ZeC (My Zelda-esque Clone)
Reply #225
I know you restored your backup already, but in the future if you lock up it's usually because your code got into an infinite loop somehow.  If you're using the debugger you should be able to press the Pause button on the toolbar to break out and see where it's stuck.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Project ZeC (My Zelda-esque Clone)
Reply #226
Once I restored the functioning code, I started to try a different idea to code the MapRef(). The second attempt didn't cause the game to crash on startup & the debugger was very much a help while implementing the added functionality.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #227
@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.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Project ZeC (My Zelda-esque Clone)
Reply #228
@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.

The very first thing I did after I found out Duktape had a built-in debugger was to start looking at how I could implement it in miniSphere.  I wished that Sphere 1.5 had something like it for years.  The number of hours I lost hunting down stubborn bugs in my own code that something like SSj Blue would have lit up with a neon sign in a few seconds... it's insane to think about.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Project ZeC (My Zelda-esque Clone)
Reply #229
No doors are currently coded in...
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #230
I am attemping to combine the Map and Compass values for each level for the MapRef().

In theory:
Code: [Select]
var MapCompass = [];
MapCompass[0] = [false, false, x, y];

Would the following be a valid statement?
Code: [Select]
if (MapCompass[0][0] == true && MapCompass[0][1] == true) image.blit(MapCompass[0][2], MapCompass[0][3]);
  • Last Edit: September 18, 2017, 01:44:43 am by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Project ZeC (My Zelda-esque Clone)
Reply #231
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.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Project ZeC (My Zelda-esque Clone)
Reply #232
That's a really awkward use of arrays there.  You could use an object instead:
That's why I asked before trying to code anything like that. It seemed logical but that's that fuzzy logic...
Quote
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.
An object would be much easier to manipulate and remember just what it is you're coding. Looking at the syntax I posted, it would most likely get very confusing after awhile.
Quote
Also: You don't need to explicitly compare against true in an if statement, the comparison is implied.
Good to know. For a long time, I hardly ever used true/false. I always coded with 0/1. One of my old college professors was always fond of saying "its either on or its off."
  • Last Edit: September 18, 2017, 02:03:41 am by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #233
Seeing NES Link in FF6 graphics did the brain a hurt.

@Chad Zechs Brain a little less hurt?
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #234
Seeing 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)

Re: Project ZeC (My Zelda-esque Clone)
Reply #235
Seeing 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)

No rush. I posted a partial section of my tasklist in the sphere studio thread. There is still much core functionality to code before really getting into the creation of the cutscene. That's going to takes some time to edit, especially with the 2 headed Gleeok attack that I have planned.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #236
huh? Very simple. If x = 39 destroyperson... why the is he still there when his x = 39?
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Rhuan
  • [*][*][*][*]
Re: Project ZeC (My Zelda-esque Clone)
Reply #237
huh? 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) 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.

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

Re: Project ZeC (My Zelda-esque Clone)
Reply #238

huh? 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.
In LoZ certain npcs just vanish after you talk to them. I thought hey, lets move him to the stairs first, that way it looks like left the room. Yeah, It occurs once, in Level3.

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

I'm having some sort of buggy reactions when  QueuePersonScript.

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.

I'm not really sure why. My CollectTriforce() (posted in sphere vs minisphere) uses the QueuePersonScript. I thought from Fat Cerberus's comment it was limited to 1.5 however, the other night, minisphere started to react in the same way.
Quote
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.)
The only thing that happens after the npc uses the stairs is a paricular door in the level gets unlocked.

I can try the QueuePersonScript with this npc but with the one in CollectTriforce() becoming unresponvise...
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Rhuan
  • [*][*][*][*]
Re: Project ZeC (My Zelda-esque Clone)
Reply #239
My read of your other topic was that it was the Delay that wasn't working, not the QueuePersonScript, that aside if you don't want to use QueuePersonScript, then use the loop method.