Skip to main content

News

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

0 Members and 1 Guest are viewing this topic.
Re: Project ZeC (My Zelda-esque Clone)
Reply #180
What about seeing Setzer's Airship flying over hyrule? 

In part of the story Link finds a journal in an outpost depicting Setzer's arrival in Hyrule which I have been developing a "cutscene" for. Basically, Link finds the journal, screen fades to black, re-enters on the southern portion of Hyrule where the airship come in from off the screen. Flies over the outpost and heads west, while flying over the desert region a Gleeok (2 headed version) launches multiple fireballs at the airship where it is hit and crash lands in the desert.

Actually I never found that one to be bothersome. It's a simple enough image that I never thought twice. Though I did react to the Enterprise better simply because of a less complicated colour scheme haha. I'm not judging, I like the story behind all this. I was just bored, on my lunch break, and wanted to see what I could come up to see if I could appease my pixel-ego.

There was a secondary reason for turning the enterprise into a spriteset besides the map scaling issue. Setzer's Airship has no southern movement sprites. It can only go North, East & West which limits my creation for the cutscene. I'd prefer to use his and am attempting my cutscene with the limited directions. I've been thinking about the possibilty of leaving the enterprise in game. I have "The Tomb of Kain Highwind" and a whole interaction with his ghost coded. The headstones around his level are main characters from Final Fantasy 2(IV). The Enterprise could feasibly be the way they all got to Hyrule, unless I want to code in a flock of random Chocobos somewhere...
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #181
Come to think of it Radnen's sliding map transition got bugged in some recent miniSphere version and I haven't looked into what caused that regression yet...

If I can't get the sliding map to process in 1.5, I'll just have figure out some other way to smooth out the room transitions.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Rhuan
  • [*][*][*][*]
Re: Project ZeC (My Zelda-esque Clone)
Reply #182
The below should work unless there's a typo (it's untested)

In your version you weren't resetting the start points for the sliding yns or xns I think were your variable names - you set them once at the start but you needed to be resetting them in your exit map function; anyway I've set out how I'd do it below including the reset, and hopefully made it shorter/more efficient at the same time. Also I haven't used a v1 RenderScript in a while but I'm pretty sure you can apply them the way I have below, i.e. without making it a string by just passing the function name.

Code: [Select]
var w = 256;
var h = 176;
var s_h = 240;

var sliding_coords = [0,0];
var frozen_player_info;

/*move to another map
string direction = direction that you left the map in
int layer = new layer
map_object map = new map*/

function ExitMap(direction, layer, map)
{
  var Name = GetInputPerson();
  var p_coords = [GetPersonX(),GetPersonY()];
  LastMap = GetCurrentMap();  //used for Dbug
  RingCheck();  //Check to see if blue or red ring
  //assuming I have the coordinates right this will grab the player_info
  frozen_player_info = GrabImage(0,h,w,s_h-h);

  switch(direction)
  {
    case("north"):
      p_coords[1] = 168 - p_coords[1];
      sliding_coords = [0, -h];
      break;
    case("east"):
      p_coords[0] = 264 - p_coors[0];
      sliding_coords = [w, 0];
      break;
    case("south"):
      p_coords[1] - 184 = p_coords[1];
      sliding_coords = [0, h];
      break;
    case("west"):
      p_coords[0] = 264 - p_coords[0];
      sliding_coords = [-w, 0];
      break;
  }

    ChangeMap(map);
    //I assume Foo sets a layer so I have removed the SetPersonLayer call
    Foo(Name, p_coords[0],p_coords[1], GetPersonDirection(name),layer);
    FadeOut(200); // My temp solution for the room transitions

    SetRenderScript(SlidingMap);
}


//Renderscript for transitions
function SlidingMap()
{
  map_image = GrabImage(0, 0, w, h);
  Rectangle(0, 0, w, h, Black);
  map_image.blit(sliding_coords[0], sliding_coords[1]);
  frozen_player_info.blit(0,h);

  if(sliding_coords[0] > 0)
  {
    -- sliding_coords[0];
  }
  else if (sliding_coords[0] < 0)
  {
    ++ sliding_coords[0];
  }
  else if (sliding_coords[1] > 0)
  {
    -- sliding_coords[1];
  }
  else if (sliding_coords[1] < 0)
  {
    ++ sliding_coords[1];
  }
  else
  {
    SetRenderScript(player_info);
  }
}

Re: Project ZeC (My Zelda-esque Clone)
Reply #183
The below should work unless there's a typo (it's untested)

In your version you weren't resetting the start points for the sliding yns or xns I think were your variable names - you set them once at the start but you needed to be resetting them in your exit map function; anyway I've set out how I'd do it below including the reset, and hopefully made it shorter/more efficient at the same time. Also I haven't used a v1 RenderScript in a while but I'm pretty sure you can apply them the way I have below, i.e. without making it a string by just passing the function name.

Code: [Select]
var w = 256;
var h = 176;
var s_h = 240;

var sliding_coords = [0,0];
var frozen_player_info;

/*move to another map
string direction = direction that you left the map in
int layer = new layer
map_object map = new map*/

function ExitMap(direction, layer, map)
{
  var Name = GetInputPerson();
  var p_coords = [GetPersonX(),GetPersonY()];
  LastMap = GetCurrentMap();  //used for Dbug
  RingCheck();  //Check to see if blue or red ring
  //assuming I have the coordinates right this will grab the player_info
  frozen_player_info = GrabImage(0,h,w,s_h-h);

  switch(direction)
  {
    case("north"):
      p_coords[1] = 168 - p_coords[1];
      sliding_coords = [0, -h];
      break;
    case("east"):
      p_coords[0] = 264 - p_coors[0];
      sliding_coords = [w, 0];
      break;
    case("south"):
      p_coords[1] - 184 = p_coords[1];
      sliding_coords = [0, h];
      break;
    case("west"):
      p_coords[0] = 264 - p_coords[0];
      sliding_coords = [-w, 0];
      break;
  }

    ChangeMap(map);
    //I assume Foo sets a layer so I have removed the SetPersonLayer call
    Foo(Name, p_coords[0],p_coords[1], GetPersonDirection(name),layer);
    FadeOut(200); // My temp solution for the room transitions

    SetRenderScript(SlidingMap);
}


//Renderscript for transitions
function SlidingMap()
{
  map_image = GrabImage(0, 0, w, h);
  Rectangle(0, 0, w, h, Black);
  map_image.blit(sliding_coords[0], sliding_coords[1]);
  frozen_player_info.blit(0,h);

  if(sliding_coords[0] > 0)
  {
    -- sliding_coords[0];
  }
  else if (sliding_coords[0] < 0)
  {
    ++ sliding_coords[0];
  }
  else if (sliding_coords[1] > 0)
  {
    -- sliding_coords[1];
  }
  else if (sliding_coords[1] < 0)
  {
    ++ sliding_coords[1];
  }
  else
  {
    SetRenderScript(player_info);
  }
}

I will give that a try and let you know. My version of Foo(), the direction and layer are conditional. When I was placing objects on a map with only one layer it seemed kind of redundent to set the layer property.

Code: [Select]
function Foo(name, x, y, d, l)
{
 SetPersonX(name, x);
 SetPersonY(name, y);
 if (d) SetPersonDirection(name, d);
 if (l) SetPersonLayer(name, l);
}

That is Foo. A simple little function I use in a ton of places.
  • Last Edit: September 14, 2017, 08:07:25 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Rhuan
  • [*][*][*][*]
Re: Project ZeC (My Zelda-esque Clone)
Reply #184
SetPersonDirection isn't expensive, as you needed to set the layer anyway I just thought I'd use what was there.

  • Rhuan
  • [*][*][*][*]
Re: Project ZeC (My Zelda-esque Clone)
Reply #185
To clarify, the key thing you were missing before is what I'm doing with the sliding_coords, these need to be set each time you wish to do a transition - your version set them once as globals but never reset them - the transition render script overwrites these values with 0 when it's finished (which is how it knows it is done) so you have to set them again each time.

Re: Project ZeC (My Zelda-esque Clone)
Reply #186
I've referenced Foo() a few times in the forum. Figured I post it. The first time I referenced it, I was told about SetPersonXYFloat() because the example I had posted was just using the x, y portion. My GenerateShop() function has soooo much Foo().
  • Last Edit: September 14, 2017, 11:27:57 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #187
To clarify, the key thing you were missing before is what I'm doing with the sliding_coords, these need to be set each time you wish to do a transition - your version set them once as globals but never reset them - the transition render script overwrites these values with 0 when it's finished (which is how it knows it is done) so you have to set them again each time.

That never even occurred to me because I was going off of your suggestion to set the variables globally. Resetting them never ever crossed my mind
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #188
There was a secondary reason for turning the enterprise into a spriteset besides the map scaling issue. Setzer's Airship has no southern movement sprites. It can only go North, East & West which limits my creation for the cutscene. I'd prefer to use his and am attempting my cutscene with the limited directions. I've been thinking about the possibilty of leaving the enterprise in game. I have "The Tomb of Kain Highwind" and a whole interaction with his ghost coded. The headstones around his level are main characters from Final Fantasy 2(IV). The Enterprise could feasibly be the way they all got to Hyrule, unless I want to code in a flock of random Chocobos somewhere...

Send me the sprites and I'll see if I can pixel up some south facing ship magic.

Re: Project ZeC (My Zelda-esque Clone)
Reply #189
@Rhuan Just did a quick count... I currently have 310 maps. To change them all at this point to use ExitMap() would entail roughly around 1200 edits in total. I am going to see if I can make some edits to use the map exit naming I already have in place.

Update: After setting up a seperate little sphere program to test and refine, the map scrolling is functioning very well. I recoded my current map exit directionals to incorporate your code. The ExitMap() function will be implemented for future maps. It's just the hours I forsee spending on editing my already existing maps...
  • Last Edit: September 14, 2017, 11:06:04 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 #190
That's a great example of why I really dislike the .rmp map format feature of embedded scripts.  It makes it *really* difficult to edit things later, and encourages copying and pasting code between maps which is very bad if you end up with a bunch of maps and later discover a bug in the embedded code that affects all of them...
Sphere 5.6.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Project ZeC (My Zelda-esque Clone)
Reply #191
That's a great example of why I really dislike the .rmp map format feature of embedded scripts.  It makes it *really* difficult to edit things later, and encourages copying and pasting code between maps which is very bad if you end up with a bunch of maps and later discover a bug in the embedded code that affects all of them...

It wasn't so much of a bug but me not liking the transition that was occurring in my dungeon level maps. The transitions between map segments on the Overworld and Underworld maps were fine. If I wasn't being overly particular about it, my existing map exits were fine. However,  along the lines of your statement... I have a warp platform in one of my maps that is just a "return to" point. I can't remember what links to it. I thought to myself "I can just run a search on my js files for that map segment." I then realized that what ever point warps to that tile is stored in a map somewhere and there's no way to run a search to find the "return to" point. Having to open each map individually and examine the triggers or zone would be very time consuming. The Overworld and Underworld combined are currently 199 files with 6 or 7 left to create for the Underworld putting the total at 205 or 206. The epic scope of ZeC still continues to astound me. 2 worlds... 13 dungeons, the palace, the outpost...
  • Last Edit: September 14, 2017, 11:23:51 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #192
There was a secondary reason for turning the enterprise into a spriteset besides the map scaling issue. Setzer's Airship has no southern movement sprites. It can only go North, East & West which limits my creation for the cutscene. I'd prefer to use his and am attempting my cutscene with the limited directions. I've been thinking about the possibilty of leaving the enterprise in game. I have "The Tomb of Kain Highwind" and a whole interaction with his ghost coded. The headstones around his level are main characters from Final Fantasy 2(IV). The Enterprise could feasibly be the way they all got to Hyrule, unless I want to code in a flock of random Chocobos somewhere...

Send me the sprites and I'll see if I can pixel up some south facing ship magic.

Here you go...

If you can create the southern directionals, I will be very impressed with your spriting skills.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Project ZeC (My Zelda-esque Clone)
Reply #193
It wasn't so much of a bug but me not liking the transition that was occurring in my dungeon level maps. The transitions between map segments on the Overworld and Underworld maps were fine. If I wasn't being overly particular about it, my existing map exits were fine. However,  along the lines of your statement... I have a warp platform in one of my maps that is just a "return to" point. I can't remember what links to it. I thought to myself "I can just run a search on my js files for that map segment." I then realized that what ever point warps to that tile is stored in a map somewhere and there's no way to run a search to find the "return to" point. Having to open each map individually and examine the triggers or zone would be very time consuming. The Overworld and Underworld combined are currently 199 files with 6 or 7 left to create for the Underworld putting the total at 205 or 206. The epic scope of ZeC still continues to astound me. 2 worlds... 13 dungeons, the palace, the outpost...

In the future you should look into using persist.js (it's floating around here somewhere).  That would let you store your map and entity code in .js files rather than in the maps themselves, and let you manipulate entities outside the map that hosts them.
Sphere 5.6.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Project ZeC (My Zelda-esque Clone)
Reply #194
Quote from: Fat Cerberus

In the future you should look into using persist.js (it's floating around here somewhere).  That would let you store your map and entity code in .js files rather than in the maps themselves, and let you manipulate entities outside the map that hosts them.

Doing a quick search of my dev folders finds that I have persist.js already. When I first started with Sphere I tried to download as many tutorials and demos I could find.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity