Detecting Debug/Playtest mode?

Shin Kitsune

KITSUNE Game Design
Veteran
Joined
Oct 15, 2012
Messages
149
Reaction score
37
First Language
ENG/SPA
Primarily Uses
RMMV
Hello everyone.


This might pretty much go in RGSS2 but I'm not sure. What I want to do is the game to detect if it's running on Playtest mode, then activate a Switch if it is. Then I would use eventing to have some Conditional branches detect if this switch is on so the game can do stuff like giving debug-exclusive items, for example.


Is there a way to do it?


Thanks in advance.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
This should get you what you want - the example turns on switch 1, so substitute that with whatever you want.

Code:
module DataManager
  class << self
    alias my_create_game_objects create_game_objects
  end

  def self.create_game_objects
    my_create_game_objects
    $game_switches[1] = $TEST
  end
end




I haven't tested this, so if you get an error when you try it, post back with the details.  I could have made a syntax error or something.


If you also want to cater for a game that might have been started in regular mode (not play test), but is then loaded during play test, or vice versa, also add this:

Code:
class Scene_Load < Scene_File
  alias my_on_load_success on_load_success
  
  def on_load_success
    $game_switches[1] = $TEST
    my_on_load_success
  end
end


This means every time a new game is started, or a game is loaded, it will update switch 1 based on whether you're playing from the editor or playing a 'regular' game.


And yeah, either RGSS2 Script Requests, or RGSSx Script Support would be the appropriate place.
 
Last edited by a moderator:

Shin Kitsune

KITSUNE Game Design
Veteran
Joined
Oct 15, 2012
Messages
149
Reaction score
37
First Language
ENG/SPA
Primarily Uses
RMMV
Thanks! I will give them a try.


Do I have to enter them somewhere specific in the RGSS modules?


Also, my bad. I actually meant to say RGSS3, not RGSS2, since it's a VX Ace project. Do they still work well with it?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
lol - yeah, I actually looked at Ace when I wrote those.  Never even occurred to me that RGSS2 = VX :)



Just create a new slot below Materials and paste both of them into it together.
 

Shin Kitsune

KITSUNE Game Design
Veteran
Joined
Oct 15, 2012
Messages
149
Reaction score
37
First Language
ENG/SPA
Primarily Uses
RMMV
Great! So far the scripts have given no problem, and they did the trick for what I wanted! Thanks a lot!
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,070
Members
137,577
Latest member
SadaSoda
Top