Change Title Screen Based on Game Achievements or Global Save

RadiantCadenza

Veteran
Veteran
Joined
Nov 6, 2012
Messages
99
Reaction score
62
First Language
English
Primarily Uses
I'm currently making a game with multiple endings, and what I would like to do is add a picture/icon to the title screen for each of the endings that have been achieved. That way the player can track which of the endings they have gotten if they want to attempt multiple playthings to see them all. 

Fomar0153 has a persistent data script (which can be found in the January 2013 restaff release) that seems like it would help me solve half that problem, in that I could easily use that to set persistent switches to track which endings have been triggered. Though, I'm not entirely sure if it loads the persistent switches when the game starts or when you load a file. (the latter wouldn't do much for me on the title screen itself) 

So, how would I go about implementing something like that? Would I need a custom script, or is that something I can put together using a combination of the persistent data save and some other trick? 
 

Yato

(aka Racheal)
Veteran
Joined
Mar 17, 2012
Messages
825
Reaction score
346
Primarily Uses
I can't speak to if Fomar's script will help or not as I'm on a phone and can't download it, but I can tell you I have accomplished something similar before.

What I did is I saved a separate file, which I called system or something like that, that tracked which endings had been unlocked. This file was loaded as soon as the game booted. I can take a look at porting it to Ace once I'm home.

Alternatively, a map-based title screen might help?
 
Last edited by a moderator:

ShinGamix

DS Style 4Ever!
Veteran
Joined
Mar 18, 2012
Messages
3,905
Reaction score
451
First Language
April Fools
Primarily Uses
N/A
I would like to see this done. This is a great idea!!
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
I think Fomar already suggested using his script in another thread like this... and if he doesn't load the switches at start-up, you can always modify the database loading...
 

RadiantCadenza

Veteran
Veteran
Joined
Nov 6, 2012
Messages
99
Reaction score
62
First Language
English
Primarily Uses
I tried modifying this script to accomplish this: http://forums.rpgmakerweb.com/index.php?/topic/984-albics-pictured-title-screen/

By adding switch checks to the setting conditions like so:

if $game_switches[21] DRAW_TITLE_TWO = true else DRAW_TITLE_TWO = false endAnd switch 21 is a persistent switch set using Fomar's script.
The game crashes on start-up; As far as I can tell, that's because the switches aren't initialized before starting or loading a new game so trying to check for them on the title screen returns nil. 

So I guess I need to "modify the database loading" like adiktuzmiko said, but I have no clue how to do that.

I should probably point out that I'm a total newbie at RPG maker's scripting language, though I know some C++ and Java so I know enough about coding in general to make some small tweaks and edits.

 

Racheal, it sounds like your method works pretty similar to Fomar's script; his saves to a file called PersistentData.rvdata2, which I'm guessing is like your system file, but I guess this one loads differently. 
If using a map based title screen script will force the switches to load on start up then that might be a functional work around. I can try that next if this won't work, I'll just need to event out the title screen menu and hide the map under a paralax or something since I don't actually want a tile map for the title screen. 

It might be better to use some kind of persistent global variable instead of the game's switches, but I'm not really sure how to go about setting those up. 
 

djDarkX

Retro & Remastered Music Guru
Veteran
Joined
Jan 17, 2013
Messages
2,700
Reaction score
1,901
First Language
Music
Primarily Uses
RMMV
It's not working because you're supposed to use:

if $game_switches[n] == true

code

else

code

end
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
from my experience, it should actually work since game switches is a boolean so it's already true or false...
 

RadiantCadenza

Veteran
Veteran
Joined
Nov 6, 2012
Messages
99
Reaction score
62
First Language
English
Primarily Uses
It's not working because you're supposed to use:

if $game_switches[n] == true

code

else

code

end
Oh, I thought an if check on a switch still returns true or false without that. So checking for it to be false would be: if !$game_switches[21]

Am I wrong about that?

I tried changing it to your recommendation, and I still get a nomethod error on startup. 

It occurs on line 48, which is the line that says if $game_switches[21] == true

and it says undefined method '[]' for nil:NilClass

I'm pretty sure that means I can't call the function that checks the game switches on the title screen without changing something else first. 

Thanks anyway though. 
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
then it means that it doesn't find $game_switches
 

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,268
Reaction score
1,422
First Language
English
Primarily Uses
RMXP
I suggest not using Fomar's Persistent Data script for this. Its integration is placed in game specific classes which is not initialized when you first come to the title screen.

Instead I suggest deliberately take care of the global data with a structure that should be controlled outside the Game_XXX structures.

You can base this off Fomar's script and try to get it to with your new class. As you have some experience it should be possible :)

For Dreamscape I did something similar although I tied it in with a more generic structure recording a lot of accumulated game details. To help positioning the icons I created this struct:

Medal = Struct.new:)symbol, :x, :y, :icon)I create instances of these during startup. Then at the title screen I run through them where I retrieve the :symbol parameter from my storage file an check whether it should be displayed or not.

*hugs*

P.s. remember to consider error handling which is trickier than it seems.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

RadiantCadenza

Veteran
Veteran
Joined
Nov 6, 2012
Messages
99
Reaction score
62
First Language
English
Primarily Uses
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
My mistake, the only reason I didn't put it here in the first place is that I wasn't sure if there was a workaround that didn't require scripts, so I didn't think it was strictly a script request thing. I was kinda on the fence. 

Well, anyway, I tried out Racheal's suggestion and tried out a script that replaces the title screen with a map.

Since that basically starts a new game and drops the main character on a map, it forces all the game data to initialize, so Fomar's script will work for this purpose now. I have to event out the title screen instead, but that's not too big of an extra step.

Unfortunately, the other side-effect is that it seems to be incompatible with a couple of map scripts I had. Slippery tiles and Force movement tiles, both by Yanfly, if I remember properly. Both of which crash the game if used with the mapped title screen for some reason, so I had to delete them. It'd be nice to still be able to use them, but thankfully those effects can also be evented with a little extra work.

So, that method has a couple of trade-offs, but It's ultimately simpler than trying to code my own persistent data script. 

Thanks for all the ideas and input, everyone! 
 

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

Latest Threads

Latest Posts

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,074
Members
137,578
Latest member
JamesLightning
Top