The RPG Maker Resource Kit

RMRK RPG Maker Creation => General Tutorials and Eventing => RPG Maker General => Tutorials Database => Topic started by: Sshadow on May 14, 2007, 08:48:14 PM

Title: Chests with SELF-switches [Save those valuable database switches] [PICS]
Post by: Sshadow on May 14, 2007, 08:48:14 PM
Why has this not been created before?
My bad if it has, noobie slap for me.

Okay, well basically I'll teach you how to make a treasure chest WITHOUT using those valuable switches, of which you have a limited number.
INSTEAD we'll use a self switch.
Much cleaner, and better.
I believe this is an Rpg-Maker XP feature... so sorry all you other guys.

ANYWAY:
Make a chest, there's TONS of tutorials of how to make them, so I won't clutter the board with another one.


[1]
Once you have your chest, at the VERY end of your event command list, place a "Self switch A = On".
[spoiler](https://rmrk.net/proxy.php?request=http%3A%2F%2Fi72.photobucket.com%2Falbums%2Fi196%2Fkireakiro%2FStep1.jpg&hash=b05229cd8c481ed4a6b8f16c0de1b6ecb8f3de85)
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi72.photobucket.com%2Falbums%2Fi196%2Fkireakiro%2FStep2.jpg&hash=1849de86420c0731d5437bca6d057620bb9f2cf7)[/spoiler]


[2]
Now make ANOTHER event page, within the event.
[spoiler](https://rmrk.net/proxy.php?request=http%3A%2F%2Fi72.photobucket.com%2Falbums%2Fi196%2Fkireakiro%2FStep3.jpg&hash=694be04e98bbb406b31649f57b09668cf62fe2bd)[/spoiler]


[3]
On the SECOND page, set the conditions, to "Self switch A = On".
Set the graphic of this SECOND page, to the open chest of your choice.
[spoiler](https://rmrk.net/proxy.php?request=http%3A%2F%2Fi72.photobucket.com%2Falbums%2Fi196%2Fkireakiro%2FStep4.jpg&hash=25b16294495f7703ce194535730eb8e67d91b7bc)[/spoiler]


[4]
Drop a little message on there like, "The chest is empty..." if you must.
REMEBER, we are dealing with the second page, got it? I highlighted the important things to remember.
[spoiler](https://rmrk.net/proxy.php?request=http%3A%2F%2Fi72.photobucket.com%2Falbums%2Fi196%2Fkireakiro%2FStep5.jpg&hash=eb6c3845c9604e4d93731ef1f4dbf4eddccd3987)[/spoiler]



Bam, you're done.
Rinse and repeat.
Basically, once you recieve your treasure and everything, it turns on that self switch.
If the switch has been turned on, it SKIPS the first page, and goes to the second.
Which should be empty, well not EMPTY, but basically shouldn't give him anything.
So, he can retrieve the item once, but after that it's empty.
Forever.
This method DOES persist throughout map changes.
There's NO way to reset the chest, unless you reset the game.

[EDIT]
Actually ther is ONE way to reset it, with some simple code:
QuoteAnyway the script call:
$game_self_switches[[MAP-ID, EVENT-ID, "LOCAL-SWITCH"]] = flag value
$game_map.need_refresh = true


where MAP-ID is the map id or map number if you will.
where EVENT-ID is the number of the event in the map.
where "LOCAL-SWITCH" is either "A", "B", "C" or "D" depending on which local switch you want to select

flag value is the value you will set the switch to. If you want to turn the switch ON set it to true otherwise false. (i.e. OFF)

Credit to:
Zeriab [For the code to reset the switches[and helpfulness]]


Did I get anything wrong?
Well let me know if Im wrong or something, and I'll fix it up.
Or if you need screenshots, or a demo, I'd be glad to put them up.
ENJOY THOSE SWITCHES YOU JUST FREED UP.

=]

...::Shadow::...
Title: Re: Chests without switches.
Post by: ChaosSpartan28 on May 14, 2007, 08:50:03 PM
Quite a few actually.

Here is one for instance

http://rmrk.net/index.php/topic,6343.msg77585.html#msg77585

Thanks for making this though.

You are new so I will point you to where you can find most of these.

http://rmrk.net/index.php/board,8.0.html
Title: Re: Chests without switches.
Post by: Sshadow on May 14, 2007, 08:54:14 PM
No doubt.
I knew they were out there, but never did I see one within RMRK itself, hence my worry.
[Edit]
I guess I really didn't look too hard then, if there was one right under my nose.
Title: Re: Chests without switches.
Post by: Zeriab on May 14, 2007, 09:36:26 PM
I think it's a good tutorial and well written. (I have no trouble understand what you mean ^_^)
The only thing it needs is pictures.
This is because the people who usually have trouble with these kinds of events doesn't know the location of event commands very well.
Pictures will show them how the event will look and where the buttons and etc. will be positioned.

On a side note: You can with a simple call script reset the chest ;)

Edit:
I forgot. I think you should change the title to Chests with self-switches or something similar. (A self-switch is still a switch)
I thought that either you checked variables, scripted something or a very weird and probably dysfunctional chest.

Anyway the script call:
$game_self_switches[[MAP-ID, EVENT-ID, "LOCAL-SWITCH"]] = flag value
$game_map.need_refresh = true


where MAP-ID is the map id or map number if you will.
where EVENT-ID is the number of the event in the map.
where "LOCAL-SWITCH" is either "A", "B", "C" or "D" depending on which local switch you want to select

flag value is the value you will set the switch to. If you want to turn the switch ON set it to true otherwise false. (i.e. OFF)

Here's an example where the chest is the 4th event in map 3. (Well... has 4 as event ID. Select the event and you can see it as 004)
We turn the local switch A off.
$game_self_switches[[3, 4, "A"]] = false
$game_map.need_refresh = true


I do not know why you would want to do it, but you may have your reasons
Title: Re: Chests with SELF-switches [Save those valuable database switches] [PICS]
Post by: Sshadow on May 14, 2007, 10:34:33 PM
There you go!
Better?
Title: Re: Chests with SELF-switches [Save those valuable database switches] [PICS]
Post by: Kokowam on May 14, 2007, 10:36:27 PM
Yeah, but not your avy. It scares me T_T Also, your sig gives seizures. T_T Lol. Anyways, Zeriab, why would you go about using a Call Script?
Title: Re: Chests with SELF-switches [Save those valuable database switches] [PICS]
Post by: Zeriab on May 14, 2007, 11:01:14 PM
Much better. Thank you *hugs*
I think even more people will benefit from this tutorial. ^_^

@mmoo: The call script is small and easy to use in this case. That's why.
Title: Re: Chests with SELF-switches [Save those valuable database switches] [PICS]
Post by: Halestorm5 on May 15, 2007, 04:28:01 PM
And with a single variable you could make a random chest! Hang on... Does anyone want something like that? XD

And, before u posted the pictures it missed out alot.