Changing the intro animation

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
gaoldart
Regular
Posts: 36
Joined: Wed Jul 06, 2011 11:23 am
Projects: Tony T (Writer, programmer)
Location: Under your chair >8D
Contact:

Changing the intro animation

#1 Post by gaoldart »

My idea is to change what the main character (Which appears on the main menu) says as soon as the game starts, so, when you open the game for the second time what he says is something different. I know i have to use persistent data but... i still have no idea exactly how... any ideas?
Bashing my head against the computer desk while programming since march 2011, and so far no brain damashii nanananananananana katamari damashii

Soraminako
Veteran
Posts: 277
Joined: Sun Sep 04, 2011 1:36 am
Projects: A thingie without a title. With messy code.
Contact:

Re: Changing the intro animation

#2 Post by Soraminako »

I'm using custom menus (and some pretty old code ^^; ), so mine would look a bit different from how you have it, but basically this is what I have:

You need to have a certain persistent set up at the point of the game after which you want it to change the next time the person loads the game, for example pasting in your code a line like this:

Code: Select all

    $ persistent.ending = "Ending 1"
(It has to be somewhere in the code just after the thing/event which you want to be what causes the menu to change.)

Then, in your main menu, you put something to have the two different possibilities based on whether the player has gone past that event or not:

Code: Select all

  
    if persistent.ending == "Ending 1":
        jump main_menu_afterending1
    else:
        jump main_menu_default           

In my case, I have several custom menus for another reason, but you could put something else in that line other than a jump, like a different image showing up if they've completed ending1, or something like that.
(I drew my avatar especially to express the scary feeling I get from the code as I type it... XD)

gaoldart
Regular
Posts: 36
Joined: Wed Jul 06, 2011 11:23 am
Projects: Tony T (Writer, programmer)
Location: Under your chair >8D
Contact:

Re: Changing the intro animation

#3 Post by gaoldart »

Yeah, that works... well... perfectly, i forgot about that code hehe... thanks Soraminako
Bashing my head against the computer desk while programming since march 2011, and so far no brain damashii nanananananananana katamari damashii

Post Reply

Who is online

Users browsing this forum: Black Spriggan, Google [Bot], Ocelot, snotwurm