kiddeath95

Lead Trainie
Veteran
Joined
Mar 12, 2014
Messages
104
Reaction score
14
First Language
English
Primarily Uses
not sure if this is the right place to post this or not, if not, then just redirect it to another topic.

I had an event ready to go for using just variables where: I click on a rock, it says i need a pickaxe; then i go and open a chest that gives me a pickaxe and setting the variable "Pickaxe = 1"; then i would click the rock again and receive an ore; and it would turn the next image of the rock into a brocken down rock. and i changed it to where instead of using the pickaxe variable, if i have the item "Pickaxe" then it would have me click it and receive an item; but the bad part when i did that, after i received the ore, the image stayed the same and asked if i wanted to mine the rock.  How do i make it to where: I click on the rock, it says i need a pickaxe. i open a chest, i obtain a pickaxe. I click on the rock, it asks if i want to mine, and if i say yes (with the pickaxe in inventory) then i would receive an ore, then it would go to an image of the broken down rocks. Then after 10 seconds(with it just processing while everything else is going on) it would go back to the regular image, and if i would go up to it, then it would ask if i want to mine. but if i went up to it while it was in the broken rock image, it would tell me i have to wait a certain amount of time. But i want it to be where like, stone pickaxe can only break stones or weaker rocks, or like a crystal piackaxe could break crystal rocks or weaker. and if they have to weak of a pickaxe to mine it, then it would say that i need a stronger pickaxe. And if you could help me do the same with trees, that be great.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,693
Reaction score
3,023
First Language
Tagalog
Primarily Uses
RMVXA
Make the broken rock as another page having for example Self Switch A = ON as a condition, once you mine it, turn self switch A to ON... Then on the broken rock page, make it run a parallel process that waits for 600 frames, then set self switch A to off...
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,510
Reaction score
12,012
First Language
English
Primarily Uses
RMVXA
It would really help if your broke your post down into paragraphs.  One point you didn't mention is whether the pickaxe is for one use only or can be used on several rocks?  I am going to assume that it is repeated use.  

Chest event - normal with a pickaxe inside.

Rock event page one, graphic of a rock.  Trigger Action button.  Conditional command : Pickaxe in inventory?

if yes, then 

Show text: Do you want to mine?

Show choices YES/NO

If YES:  Change items + 1 ore

text command : You have received 1 Ore.

Self control switch A ON

if NO: Then nothing.

'Else' branch (i.e. no pickaxe in inventory) Text command: You need a pickaxe.

Page 2 Conditioned by Self switch A  This will have to be a parallel process if you want it to continue while you are doing something else.

Graphic broken rock

Wait 600 frames. Self control switch A OFF  (this returns you to the first page and starts the whole process off again).

If you want it so that a stronger pickaxe is needed for some rocks, then for those rocks, change the conditional command at the top of page one to requiring that type of pickaxe.

If you want the stronger pickaxe to be able to break weaker rocks as well, then you will need to nest a second conditional inside one which asks if you have the strong pickaxe.  You put that second conditional (asking if you have an ordinary pickaxe) in the 'Else' branch of the first conditional.

EDIT

Ninja'd, but perhaps the extra detail is useful

EDIT AGAIN

I've just re-read your post, and noticed that you are talking about variables.  There is no need to use a variable switch for something like this, you are not counting how many pickaxes the player has, merely whether one exists or not, and for that the check whether one is in the inventory or not is sufficient.

If you want the pickaxe to be only used once, then after you have given the ore, simply remove it from the inventory using the change Item command, and tell the player "Your pickaxe has broken."
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,645
Reaction score
15,728
First Language
English
Primarily Uses
RMMV
Your request is very complicated. A few paragraphs separating the wall of text would make it so much easier to understand.

Ace has a timer function, but you can only set it on one thing at a time, and it shows the countdown on the screen. I suspect you would not want a countdown displayed, and I suspect you will probably have several rocks in various stages of counting down. So I suggest you use my Multi Timer script (search on the forum for it). It will allow you to set up a timer (not displayed on the screen) for each event, using the event's self switches, so you can have many going at once and not interfere with each other.

You will need to set up each of your pickaxes as separate inventory items. I suggest you create a common event (no trigger) that does something like this:

Control Variables [0001: Pickaxe strength] = 0Conditional Branch: Item [0001: Stone Pickaxe] in Inventory Control Variables [0001: Pickaxe strength] = 1Branch EndConditional Branch: Item [0002: Crystal Pickaxe] in Inventory Control Variables [0001: Pickaxe strength] = 2Branch Endand so on, starting at the weakest and working your way to the strongest, giving each "level" a higher number. When you set this, it will set the variable to 0 (which means you don't have ANY pickaxe), then work through all the possible pickaxes and setting the variable according to the strongest one you have.In your rock event, you didn't say whether you want to ask if they want to mine if they don't have a pickaxe at all, so I'll assume you do. Set up the first page of your rock event like this - no conditions, image is full rock, check Direction Fix, set the following event commands:

Call Common Event (the common event you set up above)Show Text: Would you like to mine this rock?Show Choices: Yes, NoWHEN Yes Conditional Branch: Variable [0001: Pickaxe Strength] >= STRENGTH_NEEDED Play SE (rock breaking SE) Control Self Switches: A = ON Change Items: Ore + 1 Script: set 10 minute timer to turn self switch A off Else Conditional Branch: Variable [0001: Pickaxe Strength] = 0 Show Text: You need to find a pickaxe Else Show Text: Your pickaxe isn't strong enough to break this rock Branch End Branch EndWHEN NoBranch EndWhere I have STRENGTH_NEEDED above, you will put in whatever number you've assigned to that variable for this type of rock (so 1 for stone, 2 for crystal, whatever).In the script call, you're going to make it call the multi timer script from my thread to turn off self switch A on this event after 10 minutes.

Then add the second page of the event which is conditioned by self switch A and has the broken rock image. Also turn on Direction Fix, and show a message saying they need to wait a while. You COULD do a script call to set a variable to exactly how long they need to wait, or you might say they need to wait 10 minutes after breaking the rock.

Everything else is simple chest events, switches and events.

double ninja'd. That's what I get for making it so complicated ;)
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,510
Reaction score
12,012
First Language
English
Primarily Uses
RMVXA
As the op only wants 10 seconds delay before the rock can be mined again, it is unlikely that there will be several rocks processing at the same time, so I think a multi-timer is not needed - unless the player can hurtle round in double-quick time.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,645
Reaction score
15,728
First Language
English
Primarily Uses
RMMV
lol - for some reason I read that as 10 minutes.


*sigh* All that work and explanation for nothing :(
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,693
Reaction score
3,023
First Language
Tagalog
Primarily Uses
RMVXA
Or just use a parallel wait per rock, though that would reset if he moves out of the map...
 

Latest Threads

Latest Posts

Latest Profile Posts

After the initial success with one event, I set up four different events on the same map to detect who is in which slot in my current party, and fortunately it managed to work as intended, with the events changing image to match the party members even as I swapped their positions around in formation. This will be a great tool for immersive scene design.
Finally finished the first hand-drawn map! It took me a week, but I'm so proud!
Actual line of code I just had to write for a plugin:

return Object.keys(this._shopStock).map(key => key.split(",")).map(element => element.map(value => Number(value))).filter(key => key[0] === mapId && key[1] === eventId);

Forum statistics

Threads
118,447
Messages
1,116,053
Members
155,418
Latest member
Onehitwonder
Top