Skip to main content

News

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

Re: Project ZeC (My Zelda-esque Clone)
Reply #345
"persist.js" questions:

Quote from: http://wiki.spheredev.org/index.php/Script:Persist.js
Map Events:
1st - the map state. Usually named map.
2nd - the world state. Usually named world

Person Events:
1st - the person state. Usually named self.
2nd - the map state. Usually named map.
3rd - the world state. Usually named world

If I understand this correctly, 'self' refers to the actual mapname.js or would it be the mapname.rmp file because of the example. As an example using actual ZeC references...

The player enters the cave with the first sword:
Code: [Select]
//swordcave.js
({
visited: false,
enter: function (self)
{
 if (!self.visited)
 {
 GenerateShop("OldMan", "WoodenSword");
 self.visited = true;
}
},
leaveSouth: function ()
{
Warp(55, 39, 0, "south", Start);
}
})

According to that, when the player enters swordcave.rmp and already collected the sword the GenerateShop() would not process because visited is true.

What I'm hazy on is the map & world portions of the optional parameters.

Code: [Select]
talk: function (self, map, world)

What exactly do they reference? If 'self' is the map then what is 'map'? I'm not very sure about that. The wiki page doesn't really seem to explain it. Unless, I misread something. Although, I have read & reread the page a few times trying to understand the concepts before posting about it.

Also, what does 'world' set? From reading, it appears that 'world' would be used for set/getWorldState(). If that is correct, then I would need to add 'world' to the dungeon items, doors & whatever other variable setting entities I would want to add into a game save file?

Am I correct in my understanding about any of this?
  • Last Edit: October 02, 2017, 12:21:40 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Project ZeC (My Zelda-esque Clone)
Reply #346
Self: The current entity running the script. This applies to scripts that belong to people.

Map: This is the map scope. Writing data into this object is accessible by all entities and methods on that map.

World: This is the world scope. Writing data into this object makes it available to all maps and people. This is great to store quest variables and world reactions. A death of a person on map A  can be talked about on map C by writing the variables to that object.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

Re: Project ZeC (My Zelda-esque Clone)
Reply #347
That is a better explaination than the wiki. Although, not a fan of a "death" example. I've been trying to figure this out for a little while now. Based on that, any item stored in a map that the player collected would be part of 'world' so the variable can be stored in a save file?

I lost the ability to use miniSphere for the time being because of my fried power supply.  As a result, I'm still porting the dungeon levels over to persist.js manually. I've been trying to update the map files as I do it. I don't have many dungeon levels left to port over then I can get back to creating the remaining levels and finishing some of the core functionalities.
  • Last Edit: October 02, 2017, 05:25:27 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Project ZeC (My Zelda-esque Clone)
Reply #348
That is a better explaination than the wiki. Although, not a fan of a "death" example. I've been trying to figure this out for a little while now. Based on that, any item stored in a map that the player collected would be part of 'world' so the variable can be stored in a save file?

Yes, this is a perfect example of storing things in a save file. :)
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: Project ZeC (My Zelda-esque Clone)
Reply #349
That is a better explaination than the wiki. Although, not a fan of a "death" example

Not sure I follow - it's a good example of when you'd want to associate something with the world rather than a specific map.
miniSphere 5.0b4 (stable: 4.8.8) - Cell compiler - SSj debugger - thread | on GitHub
For the sake of our continued health I very much hope that Fat Cerberus does not become skilled enough at whatever arcane art it would require to cause computers to spawn enourmous man eating pigs ~Rhuan

Re: Project ZeC (My Zelda-esque Clone)
Reply #350
All currently created maps have been ported over to use persist.js. Need to go through a few of them though because I think I may have some typos.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #351
That is a better explaination than the wiki. Although, not a fan of a "death" example

Not sure I follow - it's a good example of when you'd want to associate something with the world rather than a specific map.

eh, could have just as easily been (a festival, a comet coursing though the night sky, a meteor shower, a bridge, a tunnel, a new building, any number of things...)going on in map A that was being talked about in map C...
  • Last Edit: October 03, 2017, 01:52:44 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #352
Created the basic Layout for Level 7. Item and Triforce are collectable. Now to design what the individual rooms will look like.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #353
Level 7... for the time being. Doors need to be coded in and I've already noticed a few things that could use re-editing.
  • Last Edit: October 03, 2017, 04:44:15 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #354
Now I need to come up with a design for Level 8. I have a few different ones ProtoLeveled. I'm not sure if I am going to use one of them or come up with something else.

The Ideas so far...
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #355
The Link of Liberty??

Edit: Looking at this, I almost want to edit it so his shield is in the other hand like the actual Statue of Liberty holding the tablet.
  • Last Edit: October 04, 2017, 01:36:17 am by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #356
Created a Hidden Character in one of the Programmers Room. Using PlaySound(), I gave the character the functionality to "say" (currently five, more will be added) different things when the player "talks" to the character.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #357
Now I need to come up with a design for Level 8. I have a few different ones ProtoLeveled. I'm not sure if I am going to use one of them or come up with something else.

The Ideas so far...

1. Demon head? 2. ET? 3. Not sure of the third one... 4. Either a zombie character or something Dr Jekyll/Mr Hyde game? 5. The last one looks familiar too but can't place it.

Re: Project ZeC (My Zelda-esque Clone)
Reply #358
Now I need to come up with a design for Level 8. I have a few different ones ProtoLeveled. I'm not sure if I am going to use one of them or come up with something else.

The Ideas so far...

1. Demon head? 2. ET? 3. Not sure of the third one... 4. Either a zombie character or something Dr Jekyll/Mr Hyde game? 5. The last one looks familiar too but can't place it.

1. Was kinda supposed to look like the chalice from Atari 2600 Adventure.

2. ET - hailed as the worst video game for the 2600. Although the more I look at it, it kind of resembles the actual level 5 from original LoZ.

3, 4 & 5 I just threw random rooms together.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #359
I see the chalice now.