Help with making Ore respawn

HazukiWolfe

Veteran
Veteran
Joined
Jan 15, 2015
Messages
141
Reaction score
26
First Language
English
Primarily Uses
N/A
Well right bow with the base they only get 1 ore a hit and with each pickaxes it just is a +1 and the ore is to make armor, weapons and accessories. There will be other things but those are the main ones.
I never really thought of a mining skill actually
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
409
First Language
German
Primarily Uses
RMMV
Sorry i had no time at the Weekend. But iam putting it together right now, and it seems much much easier than expected.

One Question, should the Ore note only respawn after 30 minutes when its completely empty?
or
if i mine it half empty, should it be also full after 30 minutes?

I would prefer the second one, because than playrs are not forced to mine them empty to avoid more waiting or confusion later on.
 

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
40
First Language
German
Primarily Uses
RMMV
I also started to set something up. But it is not finished and I had no time to finish it yet.

@Bex Maybe you can take some inspiration from my approach. :LZSsmile:

I would highly advice using a common event for all the mining. If something needs to be changed later on.



 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
409
First Language
German
Primarily Uses
RMMV
Its ready, but this isnt like vx-ace, not sure how to share it without uploading to much MB.
I compressed it for Browser, if you download it you can play it.
If you want to open it in rpg maker you need a trick i assume, copy paste this from another projects folder into this one, than you should be able to open it. If someone knows more please let me know. Maybe just sharing the map and database file??? Help =)
notsurebuttry002.PNG

Download Game Project from below. Its packed with Zip windows standard zip tool. unzip it first, than play or do what i mentioned above. (First time since long, iam doing this with MV)

https://www.file-upload.net/download-13645574/OreMining01.zip.html

Edit: @Nilom LoL i came to a similiar solution with the Picks.
Here the Code just if you are also interested.
Here the Ore Note Event
Page1: Action Button, Full Note
◆Comment:Harvestable Ore Note
◆Control Variables:#0004 Ore Note Type = 1
◆Common Event:CE for Ore Note Mining
Page2: Action Button, Condition Self Switch A, Empty Note
◆Comment:Empty Ore Note
◆Text:None, Dim, Bottom
:Text:At the moment there is no Ore here.
:Text:I could return later on.
Page3: Parallell, Condition Self Switch B , Respawn Note
◆Control Variables:#0001 Self Var Timestamp = 0
◆Control Variables:#0002 Self Var NoteMinedXTimes = 0
◆Control Self Switch:A = OFF
◆Control Self Switch:B = OFF

Here the 3 Common Events:
CE1 - This Code becomes the code of the Ore Note calling it.
◆Comment:--------------------------------------------
:Comment:Configuration Start
:Comment:--------------------------------------------
◆Control Variables:#0011 Respawn Time Amount = 60
◆Comment:Value for Timestamp: 1800 = 30 Mins. 1 = 1 Second
◆Comment:--------------------------------------------
:Comment:Configuration End (More or less)
:Comment:--------------------------------------------
◆Control Variables:#0008 Ore amount each time = -1
◆If:Party has Simple Pickaxe
◆Control Variables:#0006 Pick min each Note = 1
◆Control Variables:#0007 Pick max each Note = 5
◆Control Variables:#0008 Ore amount each time = 1
◆Control Variables:#0009 Chance for Diamonds = Random 1..10

:End
◆If:Party has Good Pickaxe
◆Control Variables:#0006 Pick min each Note = 2
◆Control Variables:#0007 Pick max each Note = 7
◆Control Variables:#0008 Ore amount each time = 2
◆Control Variables:#0009 Chance for Diamonds = Random 1..5

:End
◆If:Ore amount each time = -1
◆Text:None, Dim, Bottom
:Text:This won't Work. I can not Move that.
:Text:I need a Mining Pick.
◆Exit Event Processing
◆Comment:"Exit Event Procesing" = Skip to the End of the Eventcode

:End
◆Comment:Timestamp
◆Control Variables:#0001 Self Var Timestamp = Play Time
◆Control Variables:#0001 Self Var Timestamp += Respawn Time Amount
◆Comment:------------------------------------------
◆Control Variables:#0002 Self Var NoteMinedXTimes += 1
◆If:Self Var NoteMinedXTimes > Pick min each Note
◆Control Variables:#0005 Random Break Chance = Random 1..10
◆If:Random Break Chance < 5
◆Control Variables:#0002 Self Var NoteMinedXTimes = Pick max each Note

:End

:End
◆Comment:------------------------------------------
◆Common Event:CE for Items you get
◆Comment:------------------------------------------
◆If:Self Var NoteMinedXTimes ≥ Pick max each Note
◆Control Self Switch:A = ON
◆Comment:The Note will turn Empty now.

:End
CE2: Runs on Parallel (There is also a Solution without permanent Parallel, but than Ore Notes cant respawn right infront of the Player while he is watching)
◆Control Variables:#0003 totalgametime = Play Time
◆Script:for (var a = 1; a <= 50; a++) {
:Script: if (!!$gameMap.event(a)) { // check that event exists
:Script: if (this.getSelfVariableValue($gameMap.mapId(), a, 1) > 0 ) {
:Script: if ($gameVariables.value(3) >= this.getSelfVariableValue($gameMap.mapId(), a, 1)) {
:Script: $gameSelfSwitches.setValue([$gameMap._mapId, a, 'B'], true)
:Script: } } } }
◆Wait:60 frames
CE3: This is called by Common Event1 when needed.
◆If:Ore Note Type = 1
◆Comment:Iron Ore,from which you can get Iron,
:Comment:Copper or the special Diamonds..
◆If:Chance for Diamonds = 1
◆Change Items:Diamonds + {Ore amount each time}
◆Text:None, Window, Bottom
:Text:Rare Special Diamonds found.

:Else
◆Control Variables:#0010 Normal Ore distribution = Random 1..100
◆If:Normal Ore distribution ≤ 35
◆Change Items:Copper + {Ore amount each time}
◆Text:None, Dim, Bottom
:Text:You got \V[8] Copper Ore.

:Else
◆If:Normal Ore distribution ≤ 90
◆Change Items:Iron + {Ore amount each time}
◆Text:None, Dim, Bottom
:Text:You got \V[8] Iron Ore.

:Else
◆If:Normal Ore distribution ≤ 100
◆Text:None, Dim, Bottom
:Text:No Ore thistime.

:Else

:End

:End

:End

:End

:End
Ah and dont forget Yanflys Event Self Variables Plugin.

Edit2:
I made that Events 1 to 50 can have a Ore Note TimeStamp check, so i would recomment using the same Event Ids for Ore on every Map. You can change the Event Id Range like you want.

Edit3:Changed spoiler Name Error.
 
Last edited:

HazukiWolfe

Veteran
Veteran
Joined
Jan 15, 2015
Messages
141
Reaction score
26
First Language
English
Primarily Uses
N/A
thank you both ^_^ Sorry I didn't answer right away, I was with my husband on a 3 day weekend for our first wedding anniversary ^_^ I'll let you guys know how it goes when I set it up
 

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
40
First Language
German
Primarily Uses
RMMV
Don't worry. Congratulations. :kaoblush:
 

HazukiWolfe

Veteran
Veteran
Joined
Jan 15, 2015
Messages
141
Reaction score
26
First Language
English
Primarily Uses
N/A
Ok so I'm setting up what Bex did but I have some questions as I'm not goo at this stuff at all.

I only want the mind to drop Copper ore cause Iron will have its own mine. also I would like to add two more gems to the list. How would I change it for that? Also how would I change the time in the respawn?

Edit: so Some times it will go right to "there is no ore" and sometimes just one thing drops from the mine.
 
Last edited:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
409
First Language
German
Primarily Uses
RMMV
1. I hope you got the Demo Project to Work?
2. And/Or could you rebuild it so it functions?
Iam just asking because if yes, than we realy can continue with your new Questions.
Let me recap what happens when we mine Ore.

Everytime we Mine a Note:
1. The Special Diamonds chance get Rolled in Common Event1.
2. Than common Event 3 checks which value the "Ore Note Type" has. And uses the correct Codeblock for the Ore Note.
3. In common Event 3 we than check if Diamonds Chance is equal to 1, if yes, we get special Diamonds and nothing else.
4. If special Diamonds chance is NOT equal 1, we start with the Normal Ore Note distribution.
5. We Roll a Random Number between 1 and 100 and use the result as condition for the Items we get.
6. Between 91 and 100 there was no ore given. 36 to 90 = Iron, 1 to 35 = Copper.
7. The amount of Ore you get is determind by the Pick you Use. You find it in Common Event 1.
The normal Pick = Control Variables:#0008 Ore amount each time = 1
Special Pick got:
Control Variables:#0008 Ore amount each time = 2
8.
The amount of Times you can mine a Ore Note is also handled by the Pick Settings.
You said you want to mine 1 to 5 trys on each Note.
So sometimes you mine 1 Time and the Note breaks directly afterwards and disapears.
- Isnt that how you wanted it?
The better Pick has 2 to 7 trys on each Note.
9.
The Ore Note can get mined with the normal Pick 1 time guaranteed, but when the Picks minimum try chance is reached we also Roll a random Number between 1 and 10. 0 to 4 = The Note Breaks after this try. 5 to 10 = The Note holds. But no matter the outcome the mining process will continue and you might get an Ore.
IF Ore Note got Mined the Max amount of Times the Pick got, it will break for sure this time.
Yes all off this can be edited and changed, the Demo i offered is just the bare basics to build your System on top.

10. About Respawn Time: Are we talking about individual respawn times for different ore note types?
Where for example Iron would respawn faster than Copper Notes?

General Respawn Time for all Notes is in Common Event 1:
Just replace the 60 with 1800. Its around 30 Minutes than.
Code:
◆Comment:--------------------------------------------
:Comment:Configuration Start
:Comment:--------------------------------------------
◆Control Variables:#0011 Respawn Time Amount = 60
◆Comment:Value for Timestamp: 1800 = 30 Mins. 1 = 1 Second
◆Comment:--------------------------------------------
:Comment:Configuration End (More or less)
:Comment:--------------------------------------------

11. To create an 2nd Ore Note Type.
In your Ore Note Map Events, change this:
Control Variables:#0004 Ore Note Type = 1
to
Control Variables:#0004 Ore Note Type = 2

12. In Common Event 3 you will find the Ore Note Type Variable as example in the first Blocks first Condition.
We just copy the whole block and paste it below itself.
Than we just change the percentages, and the items we want to get.

13.If you have trouble Setting that up, i can help so you have a Working example so you can expand it later on by your own.

14. If you want changes how the System works in general, even that is no problem, we just need to know the details on how it should be and how it plays out ingame exactly.

I hope this Textwall somehow helps and hopefully doesnt sound too much like Klingon.
 
Last edited:

HazukiWolfe

Veteran
Veteran
Joined
Jan 15, 2015
Messages
141
Reaction score
26
First Language
English
Primarily Uses
N/A
Ok this helped a lot more. I'm still kinda slow though XD and yes I was able to open up the demo and copy everything I needed. Thank you. Here are my questions

ok so this just this mine its just a copper mine and it only has the copper ore that comes from it. also I wish there to be a small chance of Lapis, Emerald, and Amethyst to also come from it.

so like with the "If: Chance for Diamonds = 1" could I just change that to lapis and then make copies for emerald and amethyst?

Is "Control Variables : #0011 Respawn Time Amount = 60" 60 frames?

With the normal Pick, can I add "chance for (Gem)" by just coping the "Chance for Diamonds" Control Variable?
Like:
"Control Variable : #0001 Chance for Lapis = Random 1 . . 10"
"Control Variable : #0001 Chance for Emerald = Random 1 . . 10"
"Control Variable : #0001 Chance for Amethyst = Random 1 . . 10"​
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
409
First Language
German
Primarily Uses
RMMV
Theoretically that should be possible (I feel those covered Bugs allready lurking behind the corner =) )
Best make a backup Copy before changing it further.

I dont have much time this afternoon and will probably check it out in the evening.

1. Do we even want to keep this special diamonds chance? and is this set up even ok for you?

2. I would not Copy the chance in CE1, let it like it is.
So if its 1 you get special Ore. But we dont give you special Ore, we make a new Random Variable 1 to 10,
than we make conditions and depending on that we give you Amethist , Lapis or Emerald. Thatway your Iron Note doesnt end up in giving you only special Stuff instead of Iron.
Or do you want the chance to get more than 1 of those at once?
We could make that you get chance for each of your special Ores and additional also Iron.
Than you would get you a chance for more than 1 kind of Ore each try. That is possible but would require some changes to the structure of the codeblock.
Edit2: If the chance for Emerald and Amethist do not need to depend on the pick equiped, than we could use it in the normal ore distribution. instead of getting nothing
when 91 to 100 is rolled. so many possibilities, all depends on which things are needed
for the gameplay.

Let me know how it shall be.
Edit:
Also sorry if somewhere is an error or so, or if i used wrong words to explain.
Iam doing this Mechanic the first Time also =). Happy to help but dont worry all is good on my end.

Edit2:
Quote: "Is "Control Variables : #0011 Respawn Time Amount = 60" 60 frames?"
No it is not. 60 is equal to 60 seconds.
The standard inbuild rpgmakermv Gametime counts in seconds not frames like in vx-ace.

Edit3:
Eventualy i try to rework the whole mechanic, maybe i can come up with something
easier and more flexible.
Sometimes its fun creating those mechanics and improoving myself and learning while doing it.
But normaly i have no use for them in my Projects afterwards. Knowing that this could be of use for someone else is a smal but nice reward =).
 
Last edited:

HazukiWolfe

Veteran
Veteran
Joined
Jan 15, 2015
Messages
141
Reaction score
26
First Language
English
Primarily Uses
N/A
♥ I'm sorry what do you mean keep the special diamond chance? is it just the gem chance?

♥ The best way to describe what i want is like the mining in Stardew Valley. when you hit a node of copper or gold or something else, there is a small chance that you will get a gem from it randomly. it doesn't happen every time but some times.

♥ So what if I wanted the respawn time to be like 3 minutes? what would I have to do? I'm asking so I get a better idea on how this part works for future stuff

I'm sorry if I'm not easy to work with. I'm not the technical one lol My husband is normally the one dealing with this stuff while I'm doing the art aspect of the game lol. I'm wanting to learn though

Edit: Is this wrong?
◆If:Party has Pickaxe
◆Control Variables:#0011 Pick min each Note = 1
◆Control Variables:#0013 Pick max each Note = 5
◆Control Variables:#0016 Ore amount each time = 1
◆Control Variables:#0015 Chance for Lapis = Random 1..10
◆Control Variables:#0018 Chance for Emerald = Random 1..10
◆Control Variables:#0019 Chance for Amethyst = Random 1..10

:End

And this?
◆If:Ore Note Type = 1
◆If:Chance for Lapis = 1
◆Show Animation:This Event, Mine
◆Change Items:Raw Lapis Lazuli + {Ore amount each time}
◆Text:None, Window, Bottom
: :Oh! Lapis!
◆If:Chance for Emerald = 1
◆Show Animation:This Event, Mine
◆Change Items:Raw Emerald + 1
◆Text:None, Window, Bottom
: :Oh! An Emerald!
◆If:Chance for Amethyst = 1
◆Show Animation:This Event, Mine
◆Change Items:Raw Amathyst + 1
◆Text:None, Window, Bottom
: :Oh! An Amethyst!

:End

:Else

:End

:Else
◆Control Variables:#0017 Normal Ore Distribution = Random 1..100
◆If:Normal Ore Distribution ≤ 35
◆Show Animation:This Event, Mine
◆Change Items:Copper Ore + {Ore amount each time}
◆Text:None, Dim, Bottom
: :You got \V[8] Copper Ore.

:Else
◆If:Self Var NoteMinedXTimes ≤ 100
◆Text:None, Dim, Bottom
: :No Ore thistime.

:Else

:End

:End

:End

:End
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
409
First Language
German
Primarily Uses
RMMV
No you are fine. I had worries iam to weird =).
Its my fault, i will come up with something much easier, else we will loose track of what we are doing and if bugs appear we will be
doomed. I feel a little bad that this takes so long. Excuse for today, Hot Weather, much Sun and helped Family in the Garden.
Sorry this ended a little bit unprofessional =).

Edit:
♥ So what if I wanted the respawn time to be like 3 minutes?
Set it to 180. 1 = 1 Second, 60 = 60 Seconds = 1Minute, 180 = 180 Seconds = 3 Minutes.

Edit:
♥ The best way to describe what i want is like the mining in Stardew Valley. ...
The roll of the special diamond chance is doing exactly that, and the picks can influence the chance.
In Stardew Valley, do the get only the special ore or also special ore (i mean Gems) and normal ore at the same time?

Edit:
♥ I'm sorry what do you mean keep the special diamond chance? is it just the gem chance?
Yes it is the Gem chance that can be influenced by the owned mining pick item.

Sorry for all those Edits.

Sorry i cant answer the rest at the moment.
 
Last edited:

HazukiWolfe

Veteran
Veteran
Joined
Jan 15, 2015
Messages
141
Reaction score
26
First Language
English
Primarily Uses
N/A
Nah its cool ^_^ I'm just glad someone is helping me out. I was out in my garden not to long ago watering the flowers I'm trying to keep alive XD
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
409
First Language
German
Primarily Uses
RMMV
1 Question which drowned by all that text.
When mining the Iron Note, do you get "Iron or Gem"? or "Iron + and maybe Gem" ? or " Iron + maybe emerald + maybe lapis"?
or " Iron + maybe emerald or maybe lapis"
This is making my head smoke right now, because i dont know how you want it to be.
 

HazukiWolfe

Veteran
Veteran
Joined
Jan 15, 2015
Messages
141
Reaction score
26
First Language
English
Primarily Uses
N/A
>.< I'm sorry. I'm horrible at explaining things.

They mine the copper vein and they always get copper but sometimes they get copper + 1 of the 3 gems. Is that better?
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
409
First Language
German
Primarily Uses
RMMV
Thank you very much, thats way better. This detail makes a big difference in the setup =). I can also exlude the chance for getting nothing, that makes things also a little less complex.
 

HazukiWolfe

Veteran
Veteran
Joined
Jan 15, 2015
Messages
141
Reaction score
26
First Language
English
Primarily Uses
N/A
ok good ^_^

This is such a head ache and I am so grateful for your help. I have so many ideas for this game and I'm just realizing that I am going to be going through hell trying to figure it all out lol
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
409
First Language
German
Primarily Uses
RMMV
I feel like detective columbo right now, one more Question...

About the Ore Respawn. The Timer thingy is clear and working, but the respawn, should Ore Notes be able to respawn visible infront of the player, when the Time Stamp Timer is finished? Or should the Player change Maps before that takes place if timer is finished?
 

HazukiWolfe

Veteran
Veteran
Joined
Jan 15, 2015
Messages
141
Reaction score
26
First Language
English
Primarily Uses
N/A
I like when it appears in front of the player. Also helps me feel better when I see it working XD
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
409
First Language
German
Primarily Uses
RMMV
Do you need a Textbox which tells you how much Copper and Lapis you found when mining a ore Note 1 Time? Or do you want a number float up from that Note and maybe also show a icon for the correct ore type?
I have a little time left over and started to rebuild it, the code allready shrunk around 1/3.
 

Latest Threads

Latest Profile Posts

Looking back at some sketches, and game design documents on my PC dated summer of 2015. I started development with the release of MZ, but in 2015, I felt a strong desire to make a game out of the blue. I remember feeling sad for no apparent reason, and all these ideas rushed into my head. Now that I think about it, since that day, everything has become easier to do on my PC . . . it’s very creepy.
Everything's going to be alright! We're all in this together. <3
Aaaaannd published my game's tech demo. :D

Feel free to download and play it. And give feedback!
Hey everyone, we know that the edit bar is missing. We're working on it. You can talk about it in the announcement here: https://forums.rpgmakerweb.com/index.php?threads/forum-errors-missing-edit-bar-etc.132715/
So, explain why we can no longer use BBC code or smilies in our posts? This sparks much sadness...

Forum statistics

Threads
107,794
Messages
1,032,263
Members
139,941
Latest member
Finley
Top