Random situations in-game

Andrea87Sky

Just a random musician/coder.
Veteran
Joined
Aug 30, 2017
Messages
84
Reaction score
1
First Language
Italian
Primarily Uses
RMXP
(Engine: RPG Maker XP, and sorry for the bad english)

There's a way for make like a script for make a random situation in game? I mean, i wanna do like to show 3 pictures randomly in the title screen as background, for example randomly show the third picture as background, and randomly again show the first and etc. I don't know if someone will understand what i'm saying :C
 

DerVVulfman

Resident Werewolf
Veteran
Joined
Jun 26, 2012
Messages
314
Reaction score
153
First Language
English
Primarily Uses
RMXP
So each time you run your game, the title screen may be different? Well, yeah.... that would be possible.

FIRST, let me say that you're fortunate. Random numbers are easy to generate with RGSS and can be fairly random as RGSS automatically seeds the system based on the current time. Um, 'seeding' changes how a random number is generated.... otherwise you would randomly generate the SAME NUMBER EACH TIME ITS RUN! :XD: So RGSS automatically seeding is a good thing.

Now, let's assume you're editing the Scene_Title to show three different title screens instead of just the one. Normally, you would have this generating your actual background:
Code:
    # Make title graphic
    @sprite = Sprite.new
    @sprite.bitmap = RPG::Cache.title($data_system.title_name)
You should have no problem replacing it with this:
Code:
    # Make title graphic
    @sprite = Sprite.new
    rand_screen = rand(3)
    case randscreen
      when 1; @sprite.bitmap = RPG::Cache.title("Title_Screen 1")
      when 2; @sprite.bitmap = RPG::Cache.title("Title_Screen 2")
      else ;  @sprite.bitmap = RPG::Cache.title("Title_Screen 3")
    end
Of course, you will need to edit the script as above to name them however you want in your Graphics\Titles folder.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Been watching videos about IRS phone scammers. Some really scummy people in the world.
Is the "2 status updates per 24h" still in effect?
My first attempt at Pixel Art :blink::) (I have no idea what I'm doing but I'm doing it)
Plugin instructions: *exists*
Plugin: What did he say? *error*
I feel like it's about time I share all the result of my experiment project here. But there's a lot of it.

Forum statistics

Threads
93,724
Messages
914,939
Members
123,330
Latest member
Rikuto
Top