Skip to main content

News

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

0 Members and 6 Guests are viewing this topic.
  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Project ZeC (My Zelda-esque Clone)
Reply #300
@Miscreant The persist.js map script syntax is a bit weird, basically the whole file is a big object literal which is eval()'d.  It was done that way as a necessary evil because otherwise, with traditional JS, all the functions in the file would be global.  Putting them into an object which can be eval'd gets around that limitation.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Project ZeC (My Zelda-esque Clone)
Reply #301
You have to have a comma after each function definition in the map script (other than the last one), like in the attached.
Added in the commas, the map scripts are functioning.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #302
@Miscreant The persist.js map script syntax is a bit weird, basically the whole file is a big object literal which is eval()'d.  It was done that way as a necessary evil because otherwise, with traditional JS, all the functions in the file would be global.  Putting them into an object which can be eval'd gets around that limitation.

Which version should I be using? The one from the wiki, the one I found posted in the forums or Radnen's analogue?

Also, I can infer that zones and triggers would still be need to coded internally in the map file. Looking through the 1.5 api file(which I started this project with) it does not appear that the zones or triggers can be created externally with coding.
  • Last Edit: September 25, 2017, 10:54:32 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 #303
Radnen's analogue.js is newer and fixes a few nagging bugs that persist had, so I would recommend that.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Project ZeC (My Zelda-esque Clone)
Reply #304
Also, I can infer that zones and triggers would still be need to coded internally in the map file. Looking through the 1.5 api file(which I started this project with) it does not appear that the zone or triggers can be created externally with coding.

Yeah, the problem with zones and triggers is that they are not named, so there's no provision for them in persist.js.  One of the unfortunate limitations of the classic map engine. :(
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Project ZeC (My Zelda-esque Clone)
Reply #305
I'm going to attempt to port the project maps to use the persist functionality. At over 400 maps this could take some time. I think the levels will be the most time consuming to port over.
  • Last Edit: September 25, 2017, 12:49:44 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #306
Shops, ProgramersRooms and the first column of the overworld maps are now recoded for persist.js.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Rhuan
  • [*][*][*][*]
Re: Project ZeC (My Zelda-esque Clone)
Reply #307
I'm going to attempt to port the project maps to use the persist functionality. At over 400 maps this could take some time. I think the levels will be the most time consuming to port over.
I could pull all the scripts out with a script I have if you want me too... Let me know if you want the help.

Re: Project ZeC (My Zelda-esque Clone)
Reply #308
It's actually going quicker than I thought it would. The overworld is now 1/4th of the way ported over. The map exits are quick and simple. Porting the person entities is what takes a few moments. Especially on maps where there are a good number of Armos statues.

Also, I've already added you into my credits.txt for the assistance you've provided thus far.
  • Last Edit: September 25, 2017, 04:04:05 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #309
All of the shops, programmers rooms and the entire overworld has been recoded to use persist.js. I was going through the overworld testing all the various shops, rupee caves and heart container caves to make sure they functioned properly with persist.js. In Sphere, every cave is functional but one heart container cave. Everytime, i go to enter the cave, Sphere crashes. I loaded up miniSphere to process it through the debugger and that one cave had functionality. No errors. Load it back up in Sphere, try it again. Crashed. I'm trying to figure out what is causing this one cave to crash the game. The coding is virtually identical to the other heart caves that function, the only difference is the variable name to check if you collected the heart container.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Project ZeC (My Zelda-esque Clone)
Reply #310
Another benefit to persist.js which I'm sure you've seen already is that you can use the debugger to step inside the map scripts.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Project ZeC (My Zelda-esque Clone)
Reply #311
Another benefit to persist.js which I'm sure you've seen already is that you can use the debugger to step inside the map scripts.

miniSphere processes the script correctly. The debugger found no errors with it.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #312
Now with persist, I'm thinking about doing a little restructuring to one of my main data modules. Changing variables between maps is much quicker now.
  • Last Edit: September 26, 2017, 04:11:44 am by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #313
The underworld is a little more that 1/2 ported over to use persist.js.

In the process of converting the map files, I found a couple that, since I haven't had cause to open for coding in some time, they were still using my original exit map functionality from before I created the actual function.

Those maps are now implemented with the newer functions.

Plus, there were a few maps that had exits coded which didn't have those exits.
  • Last Edit: September 26, 2017, 06:25:49 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #314
I'm going to attempt to port the project maps to use the persist functionality. At over 400 maps this could take some time. I think the levels will be the most time consuming to port over.
I could pull all the scripts out with a script I have if you want me too... Let me know if you want the help.

@Rhuan This is taking longer than expected. I've got the overworld and underwold ported over along with all the shops and extras. I still have 6 dungeon levels to port to persist. How long would this script take?
  • Last Edit: September 27, 2017, 01:02:34 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity