Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Help needed: Reset all self switches.
sly maniac
post Aug 3 2010, 06:04 PM
Post #1


Level 1
Group Icon

Group: Member
Posts: 5
Type: Writer
RM Skill: Beginner




I just finished making my game and I thought it would be a cool idea to reset the entire game but keep the main characters items. Just items. I was just wondering how I would reset self switches for all the events instead of going through them all 1 by 1 so I can simulate a new game + feature if you will. Thanks =)
Go to the top of the page
 
+Quote Post
   
Ale Goth
post Aug 3 2010, 08:56 PM
Post #2


Darkness Is But A Good Thing. Use It wisely.
Group Icon

Group: Revolutionary
Posts: 138
Type: Writer
RM Skill: Advanced




There is an option when choosing to turn off switches/variables. It's called batch, all you got to do is select all your switches from 1 to however many switches you used. Choose turn off, and then your good to go smile.gif All switches off.

As for keeping the items, and not level...right? You can use the "Change Equipment" option to remove all the equipment on the main character.
You will also need to remove all other items in inventory with change items. You should do that to avoid losing the main characters items.
After removing all items, just remove all characters and re-add the main character. Keep initialize on so the level resets to one.

This post has been edited by Hatredlust: Aug 3 2010, 09:01 PM


__________________________
COMPLICATED is my middle name!
~I am formerly known as Hatredlust. My new name Is Ale Goth :)
Long live the...!


Go to the top of the page
 
+Quote Post
   
Kread-EX
post Aug 4 2010, 01:59 AM
Post #3


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




You can't batch reset all self-switches, only normal switches. In any event, in order to manipulate a self-switch outside of its event, you need to use a Call Script command, with this syntax:
CODE
key = [3, 1, 'A']
$game_self_switches[key] = true
$game_map.need_refresh = true
The first number is the map ID, the second is the event ID. And the letter is... well the letter.


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   
Ale Goth
post Aug 4 2010, 05:22 AM
Post #4


Darkness Is But A Good Thing. Use It wisely.
Group Icon

Group: Revolutionary
Posts: 138
Type: Writer
RM Skill: Advanced




Oh woops, I didn't notice he said self switches. That would probably need scripting then. Like Kread has shown. That'll take some time to do, if you use a lot of self-switches.


__________________________
COMPLICATED is my middle name!
~I am formerly known as Hatredlust. My new name Is Ale Goth :)
Long live the...!


Go to the top of the page
 
+Quote Post
   
stripe103
post Aug 4 2010, 05:51 AM
Post #5


PHP ERROR: Couldn't get value from UInteger. Value too large
Group Icon

Group: Revolutionary
Posts: 737
Type: Mapper
RM Skill: Intermediate




Just a thought Kread. Can't you reset all self switches by just recreating the self switches object with a call script?
CODE
$game_self_switches = Game_SelfSwitches.new


__________________________

By Axerax

The rest of my sig



Go to the top of the page
 
+Quote Post
   
Kread-EX
post Aug 4 2010, 07:56 AM
Post #6


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




That's a brilliant idea; I'm ashamed to not have thought of this before. As security, you can also remove the previous ones from memory like this.
CODE
$game_self_switches = nil
GC.start
$game_self_switches = Game_SelfSwitches.new
I feel stupid just right now. tongue.gif


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   
stripe103
post Aug 4 2010, 09:38 AM
Post #7


PHP ERROR: Couldn't get value from UInteger. Value too large
Group Icon

Group: Revolutionary
Posts: 737
Type: Mapper
RM Skill: Intermediate




Aww, don't. You can't think of everything biggrin.gif I'm just glad that I thought of it. And for the $game_self_switches = nil. I thought of that first as well, but then I tried to remove it and it worked just as well, but that was only for four self switches. Also, what is the GC.start for? I'm not that much into VX scripting.


__________________________

By Axerax

The rest of my sig



Go to the top of the page
 
+Quote Post
   
Kread-EX
post Aug 4 2010, 09:41 AM
Post #8


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




It's just to be certain that the garbage collector removes old self switches from memory. It's usually not needed, but in rare cases it is.


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   
stripe103
post Aug 4 2010, 09:44 AM
Post #9


PHP ERROR: Couldn't get value from UInteger. Value too large
Group Icon

Group: Revolutionary
Posts: 737
Type: Mapper
RM Skill: Intermediate




Oh okay. Well it is best to be sure.


__________________________

By Axerax

The rest of my sig



Go to the top of the page
 
+Quote Post
   
sly maniac
post Aug 5 2010, 12:41 AM
Post #10


Level 1
Group Icon

Group: Member
Posts: 5
Type: Writer
RM Skill: Beginner




oh wow thanks you guys.
so basically at end event when I ask if they want to start a new game keeping all items, at the bottom I would call in a script with this code
CODE
$game_self_switches = nil
GC.start
$game_self_switches = Game_SelfSwitches.new

that should work right? smile.gif
Go to the top of the page
 
+Quote Post
   
stripe103
post Aug 5 2010, 12:52 AM
Post #11


PHP ERROR: Couldn't get value from UInteger. Value too large
Group Icon

Group: Revolutionary
Posts: 737
Type: Mapper
RM Skill: Intermediate




Yea that should. But be sure to just have the script call if the player hits Yes. We don't want the self switches to reset if the player choose No. tongue.gif


__________________________

By Axerax

The rest of my sig



Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st May 2013 - 10:26 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker