Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Mining Event System

I made this system for a simple mining function:

http://i125.photobucket.com/albums/p76/rih29/mining.png[/img]

(Checks to see if copper1 switch is on, if not, player is prompted to Mine or Prospect. If Mine, show message, wait 15 frames, miss, wait 15 frames again, and get some copper ore only if the pickaxe is in the inventory, and then the copper1 switch is turned on so the player can't sit there mining over and over again)
I'm looking to make it so that the source of the rock respawns after a set amount of time. Is this possible? I want to make the respawn rate like 15 or so minutes for every rock after it's been mined from, and I'll have like 5 or 10 variances of each type of rock so that to the player, it seems random as to when you miss and when you hit. I don't want to spend more time than I need making a whole bunch of switches for every single rock, and I don't want the resource to become unavailable after the player has hit every rock, because that would be pretty bad if it was impossible to make certain items after you've already used/sold all the ore available in the game! I also want this to work with my Herblaw system, which is the same, only it's picking herbs and not mining ores.

If anyone can help with this, that'd be great!
 
hmm, similar to my grass cutting, but the grass respawns every time you exit/enter the area, i use erase event and then it comes back next time you enter, so im guessing you could use a self switch on the first page with your event, and on the second page make a wait (15 minutes) 18,000 frames then erase event, i assume this would work but im not positive if youd have to be on that map for 15 minutes for it to erase then respawn next time you enter the map
 
Ok...I think this is pretty simple if I understand you correctly.  First off, you CAN make it random whether it hits/misses by using variables.  Let me tell you how to do this before I move on to the next part.  Here it goes:
Inside the [pickaxe in inventory] conditional branch, right at the top, insert an event that defines a certain variable as a random value between 1 and 2 (I'll use "hit/miss" for now).  Below that, insert your text (You swing the pic...) and your wait command.
So now, directly below that, create another conditional branch that says something like [variable hit/miss == 1].  Under that, insert the event that occurs when you hit.  Under "else," put your miss event.

The other part will take a bit more thought.  I'll get back to you if no one else does first.  Good luck!
 
AbyssalLord":109pozrx said:
Ok...I think this is pretty simple if I understand you correctly.  First off, you CAN make it random whether it hits/misses by using variables.  Let me tell you how to do this before I move on to the next part.  Here it goes:
Inside the [pickaxe in inventory] conditional branch, right at the top, insert an event that defines a certain variable as a random value between 1 and 2 (I'll use "hit/miss" for now).  Below that, insert your text (You swing the pic...) and your wait command.
So now, directly below that, create another conditional branch that says something like [variable hit/miss == 1].  Under that, insert the event that occurs when you hit.  Under "else," put your miss event.

The other part will take a bit more thought.  I'll get back to you if no one else does first.  Good luck!
Wow, thanks! That worked well, (I changed the wait time to 30 frames). Now I just need help so after you mine from it, it destroys itself for like, 15 minutes or so and then reappears.
 
With my limited eventing knowledge, I pose a question:

Wouldn't it be required to use a common event for every single tile, considering I'm pretty sure events don't run unless they're on the same screen?

If that's stupid, just ignore it.
 
AbyssalLord":358aq5xv said:
Script is definitely a possibility, but I believe I know another way that may work.  Unfortunately, I have to go do something right now, so if no one has responed, I'll try it out =)
Alright, I'll just deal with the "Erase Event" for now so it respawns when you come back to the map. :)
 
Woah...I can't figure this out.  Maybe that's because it's 10:30 at night and I woke up really early, but still.  Hmm...ok, I'm going to look at this in a different way.  You may wish to look for a script though. =) Good luck.

EDIT: This is tough for me to figure out without using multiple switches (one for each event).  If only you could run multiple timers at once.
 
I am pretty good at eventing, but for some reason not much of my things ever work  :tongue:. Here's my idea:

Create a completely new common event(parallel process, conditions switch [copper 1] is on)and have it wait for (Blah) frames. 20 frames is roughly a second, and there are 60 seconds in a minute. I do not want to do the math now  :tongue:.

However if you do this you're going to have to make a common event for every mining spot, so maybe a script would be better,  :grin:.

Then, after those frames, have it turn switch [copper 1] off.
http://i229.photobucket.com/albums/ee138/speedolphins/RMXP%20Related/copperrespawn.jpg[/img]

Tell me when this fails. I'll try to fix it.

Happy game making,

~speedolphins
 
speedolphins":6f687qv1 said:
I am pretty good at eventing, but for some reason not much of my things ever work  :tongue:. Here's my idea:

Create a completely new common event(parallel process, conditions switch [copper 1] is on)and have it wait for (Blah) frames. 20 frames is roughly a second, and there are 60 seconds in a minute. I do not want to do the math now  :tongue:.

However if you do this you're going to have to make a common event for every mining spot, so maybe a script would be better,  :grin:.

Then, after those frames, have it turn switch [copper 1] off.
http://i229.photobucket.com/albums/ee138/speedolphins/RMXP%20Related/copperrespawn.jpg[/img]

Tell me when this fails. I'll try to fix it.

Happy game making,

~speedolphins

Ok, speedolphins.  It's nice that you are trying to help, but please read the rest of the thread.  MrRobert said that he did not want to have to waste time using a bunch of switches.  And, I believe that making a common event for each switch would take even longer.  He would never get to the rest of his game!

@MrRobert - I had another idea about the copper ore respawn, but it's not really what you are asking for.  Would it be ok if the respawn was random?  It would only take one variable and one common event for each type of ore (not one per rock).  If you are interested, I'll tell you how (if you do not already know).  :thumb:
 
Hmm... can't you just turn on a self-switch, have it wait a number of frames (parallel process), then turn the self-switch off (for respawning?)

Although, if you leave the map and come back, you'll have to wait 15 minutes AGAIN for it to respawn...
 
Yeah...that's the issue that we're having.  I think I have a better system, though as I mentioned above, it would not be a fifteen minute thing, but rather by chance.

So, let's say self-switch A is on, and the second event page is activated.  On that page would be a conditional branch with the requirement [variable {I'll say "copper" for now} == 1].  Ok, so if said variable is equal to 1, turn self switch off.  Else, display the message "You've already mined from this rock."  To make more rocks, all you have to do is assign a different value of the same variable (conditional branch [variable copper == x]) to each rock. 

Ok, the next step is to create a common event on parallel process.  The first thing you want in this common event is a 20 frame wait command.  Next, just do this [variables-->copper-->set-->random-->1-15 (you can always change this "dice roll" to suit your purposes)].

What this system would do is activate a sort of "dice roll" every second (I know it seems frequent, but it's really not that often).  If the number 1 is rolled, the event with the conditional branch that requires the variable to equal one would respawn (wrong term, but you get the idea).  Also, just to work out a small glitch that may appear in the system, I would continue using the "Erase Event" command.

Please keep in mind that this is a system totally based on chance, so there would be no definite time period between the ore being mined, and the ore returning.  Hope this helps!
 
That's actually a pretty good idea, despite the fact it'll respawn around every 15 seconds. I believe MrRobert wanted it to do so after 15 minutes, so when you set the variable, it should actually be "1...900".
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top