Yo Ewan

Veteran
Veteran
Joined
Mar 30, 2016
Messages
35
Reaction score
2
First Language
English
Primarily Uses
Hi.


Does anyone know how I can make a refilling chest, like in The Elder Scrolls or something?


I have many dungeons in my game, but when the player runs out, they've run out of loot to swindle, weapons to grab, money to collect ect..


If you can't event it, is there a script?


Thanks!


Yo Ewan
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,967
Reaction score
14,817
First Language
English
Primarily Uses
RMVXA
Just use erase event on the chest once the loot is collected. Then when the player returns the chest will be there again to loot. If you want the loot to be random set it up so that it creates a random number then the loot the player finds is based on that number.


If you don't want the chests disappearing, you can instead reset the self switch so the chests are closed when you leave the dungeon, but that requires a script call. I don't recall it off the top of my head though.


Edit: Found it. The script call to reset self switch A is $game_self_switches[[id of the map the event is on, id of the event, 'A']] = false


So for example:


$game_self_switches[[68, 63, 'A']] = false


This would turn off switch A on event 63 on map 68 in your game.


Change A to B, C, or D if you use those self switches instead.
 
Last edited by a moderator:

Yo Ewan

Veteran
Veteran
Joined
Mar 30, 2016
Messages
35
Reaction score
2
First Language
English
Primarily Uses
Just use erase event on the chest once the loot is collected. Then when the player returns the chest will be there again to loot. If you want the loot to be random set it up so that it creates a random number then the loot the player finds is based on that number.


If you don't want the chests disappearing, you can instead reset the self switch so the chests are closed when you leave the dungeon, but that requires a script call. I don't recall it off the top of my head though.


Edit: Found it. The script call to reset self switch A is $game_self_switches[[id of the map the event is on, id of the event, 'A']] = false


So for example:


$game_self_switches[[68, 63, 'A']] = false


This would turn off switch A on event 63 on map 68 in your game.


Change A to B, C, or D if you use those self switches instead.

Thanks. That should do....


..


....However, is there a way I could make it so it takes a little while to respawn?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,967
Reaction score
14,817
First Language
English
Primarily Uses
RMVXA
It will take a script to make them respawn after x time. Though you could do it that the dungeon resets as the player leaves (as in do all the self switch resets on your transfer event to exit the dungeon). Whichever is easier for you.
 

Yo Ewan

Veteran
Veteran
Joined
Mar 30, 2016
Messages
35
Reaction score
2
First Language
English
Primarily Uses

Latest Threads

Latest Posts

Latest Profile Posts

Cosmetix.gif

Hey man, why don't you do some progress on your game? Oh, because you'd rather wake up at 5am and spend the night making a cosmetics system for your side view battlers? Ok.
spillycup wrote on Finnuval's profile.
i love u so much! i’m so happy you’re in my life right now :kaocry:
To my horror, I found out I got zero Jack Vance books in my bookshelf! :kaoback: Where do y'all go in the internet to buy used books? Like, not Amazon?
Marquise* wrote on Mrs_Allykat's profile.
Your new logo is sooooo attractive! Feels like those sour liquid candy mixed with the wrapping of the popping candy rocks ones. ^^ It gives flavor and taste to our eyes. ^^
Sorry I couldn't comment before, I relogged here for someone's B-Day yesterday. ((Yeah yeah... been scared got on the throne and all as usual. Being social seems harder than walking now. So sorry to everyone and especially you.))
How goes the game make?

Forum statistics

Threads
116,991
Messages
1,103,616
Members
152,877
Latest member
sleepguardplus
Top