Skip to main content

News

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

0 Members and 8 Guests are viewing this topic.
Re: Project ZeC (My Zelda-esque Clone)
Reply #90
Scrolling up and down complete. Now, I just need to code in the cursor and item selection and then I can replace the original inventory screen with the new one.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #91
There's some sort of glitch in my Map Reference system that wasn't there before coding the scrollable inventory screen.  The game keeps crashing on 2 particular maps stating MapRef has no properties, yet they are clearly defined.... it's another arrrrrrgh moment.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #92
Comment out the render script for the player_info and I can access those, what turns out to be 5, maps. Remove the // and suddenly those maps have no properties. And it is only those maps. I just went through a check of every map in the game to see if any others cause it to crash.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #93
I am really enjoying this, more or less, development blog. Thanks Miscreant! Super cool to get to peek into your mind as you work on this!

  • Rhuan
  • [*][*][*][*]
Re: Project ZeC (My Zelda-esque Clone)
Reply #94
Comment out the render script for the player_info and I can access those, what turns out to be 5, maps. Remove the // and suddenly those maps have no properties. And it is only those maps. I just went through a check of every map in the game to see if any others cause it to crash.
That's bizarre - I assume you're over writing a key variable somewhere - OR do you have two different render scripts and one isn't being called if you call the other?

Re: Project ZeC (My Zelda-esque Clone)
Reply #95
Comment out the render script for the player_info and I can access those, what turns out to be 5, maps. Remove the // and suddenly those maps have no properties. And it is only those maps. I just went through a check of every map in the game to see if any others cause it to crash.
That's bizarre - I assume you're over writing a key variable somewhere - OR do you have two different render scripts and one isn't being called if you call the other?

Thanks to the debugger in Sphere Studio, I discovered that the variables being called were slightly misnamed in the code. You can look at something countless times and it all looks correct... like when everything gets thrown off because you misplace a decimal point somewhere. I corrected the issue and those 5 maps no longer cause the game to crash.
  • Last Edit: September 07, 2017, 04:06:52 pm 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 #96
Thanks to the debugger in Sphere Studio, I discovered that the variables being called were slightly misnamed in the code. You can look at something countless times and it all looks correct... like when everything gets thrown off because you misplace a decimal point somewhere. I corrected the issue and those 5 maps no longer cause the game to crash.

This is good to hear, good that I didn't put all that effort into making a Sphere debugger for nothing :D

You have no idea how many times I was writing code for Sphere 1.5, ended up trying to find a single bug for hours and realized I would have found it in two seconds if it had a stepping debugger.  Well, now it does. ;)
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Project ZeC (My Zelda-esque Clone)
Reply #97
So editing my Kain function I've come across something unusual.

Let me give a little background first:
You find Kain's body laying on the ground.
You go to interact with him and his ghost appears and walks out the door.
You then follow Kain through a series of room where in the 2nd to last room he walks through a wall.
In the last room he walks to a predetermined spot on the map and turns to face the player, where you can interact with him.

Now, all of this is set in the code itself.
Creation of the sprite, movement and script activation.

I have tried the code both ways SCRIPT_ON_ACTIVATE_TOUCH & SCRIPT_ON_ACTIVATE_TALK.

Once you interact with him a series of messages plays on a timed delay.

In the TOUCH version, the event plays through as intended.

In the TALK version, however, the message plays through twice.

I don't get why that would occur. It's kind of perplexing.
  • Last Edit: September 07, 2017, 06:41:27 pm 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 #98
Without seeing your code, it's hard to say for sure; what I do know is that miniSphere's map engine contains dedicated logic to prevent double-activation of a talk script:
https://github.com/fatcerberus/minisphere/blob/v4.8.4/src/minisphere/map_engine.c#L2623-L2632

I'm not sure if there's any such guard in Sphere 1.x.  Maybe that's what you're hitting?
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Project ZeC (My Zelda-esque Clone)
Reply #99
Thanks to the debugger in Sphere Studio, I discovered that the variables being called were slightly misnamed in the code. You can look at something countless times and it all looks correct... like when everything gets thrown off because you misplace a decimal point somewhere. I corrected the issue and those 5 maps no longer cause the game to crash.

This is good to hear, good that I didn't put all that effort into making a Sphere debugger for nothing :D

You have no idea how many times I was writing code for Sphere 1.5, ended up trying to find a single bug for hours and realized I would have found it in two seconds if it had a stepping debugger.  Well, now it does. ;)

It is very useful, however with the slow down of graphics example I posted in the other topic, it makes it very difficult to debug at times. I even tried to roll back to miniSphere 4.5 at one point just so I could continue to debug but Sphere Studio just kept crashing.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #100
Code: [Select]
function GhostKain(id)
{
CreatePerson("Kain", KainGhost, true);

switch (id)
{
case "1":
Foo("Kain", 151, 108, "west", 1);
Move("Kain", COMMAND_MOVE_WEST, 7, false);
Move("Kain", COMMAND_MOVE_NORTH, 1, false);
Move("Kain", COMMAND_MOVE_WEST, 3, false);
FollowingKain = 1;
break;

case "2":
Foo("Kain", 135, 92, "west", 1);
Move("Kain", COMMAND_MOVE_WEST, 9, false);
FollowingKain = 2;
break;

case "3":
Foo("Kain", 182, 92, "west", 1);
Move("Kain", COMMAND_MOVE_WEST, 3.4, false);
Move("Kain", COMMAND_MOVE_SOUTH, 6, false);
FollowingKain = 3;
break;

case "4":
Foo("Kain", 126, 44, "south", 1);
Move("Kain", COMMAND_MOVE_SOUTH, 4, false);
Move("Kain", COMMAND_MOVE_EAST, 2.55, false);
Move("Kain", COMMAND_MOVE_NORTH, 3, false);
Move("Kain", COMMAND_MOVE_EAST, 2, false);
Move("Kain", COMMAND_MOVE_SOUTH, 2, false);
Move("Kain", COMMAND_MOVE_EAST, 4, false);
break;

case "5":
Foo("Kain", 39, 92, "east", 1);
Move("Kain", COMMAND_MOVE_EAST, 5.55, false);
Move("Kain", COMMAND_MOVE_NORTH, 2, false);
QueuePersonCommand("Kain", COMMAND_FACE_EAST, false);
QueuePersonCommand("Kain", COMMAND_FACE_SOUTH, false);
SetPersonScript("Kain", SCRIPT_ON_ACTIVATE_TOUCH, "KainTalk()");
FollowingKain = 1000; //set really really really high so once you talk to him you can not do it again
FoundKain = 1;
break;
}
}

Foo(name, x, y, d, l)
sets x, y, direction and layer of named person

Code: [Select]
function KainTalk()
{
Talk("Kain Highwind", messagetexts[17]);
Delay(5000);
Talk("Kain Highwind", messagetexts[18]);
Delay(5000);
Talk("Kain Highwind", messagetexts[19]);
Delay(5000);
Talk("Kain Highwind", messagetexts[20]);
Delay(5000);
Talk("Kain Highwind", messagetexts[21]);
Delay(5000);
Talk("Kain Highwind", messagetexts[22]);
Delay(5000);
Talk("Kain Highwind", messagetexts[23]);
Delay(5000);
Talk("Kain Highwind", messagetexts[24]);
Delay(5000);
SetBlue();
}

Talk(); was one of the first things I coded (before I started designing my own msgboxes) when I started with Sphere 1.5. It came from the included help file. All I did to it was modify it so it did not require GetKey();

SetBlue(); gives the player the blue ring and changes the spriteset accordingly.
  • Last Edit: September 07, 2017, 07:06:23 pm 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 #101
When is GhostKain() called?
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Project ZeC (My Zelda-esque Clone)
Reply #102
When you interact with his actual body laying on the ground.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Project ZeC (My Zelda-esque Clone)
Reply #103
Hmm... just looking at your code it doesn't seem like anything is amiss.  Does it behave the same way in miniSphere?
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Project ZeC (My Zelda-esque Clone)
Reply #104
Can't test in miniSphere... I tried.

Only a partial screencap. Trying to screencap the whole sequence kept causing an error to the header file of the gif. This is the on touch version where it only cycles the once.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity