Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Tue May 21, 2013 11:45 am

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Apr 04, 2012 8:39 am 
Newbie
User avatar

Joined: Sat Mar 24, 2012 1:38 am
Posts: 6
I have written a lot of the script and programmed a lot of my game.
In the game I am writing you need to unlock the good endings of every character to get the true end. How would I script it so that the true ending would unlock after all the endings are completed?
I have been looking it up and getting myself confused. I am still a bit of a newbie, but I do understand quite a lot. This is one of the last things I need to figure out.
Thanks to anyone that can help me. :)


Top
 Profile Send private message  
 
PostPosted: Wed Apr 04, 2012 10:15 am 
Regular

Joined: Tue Mar 22, 2011 2:36 pm
Posts: 72
Code:
init python:
    # Set the default value.
    if persistent.goodend_1 is None:
        persistent.goodend_1 = False

Label good_ending_1:
        "Good Ending 1"
        $ persistent.goodend_1 = True
        return

For example if you have 4 good ending:
Do the same thing with ending 2,3,4

The following should be place before the ending
Code:
if persistent.goodend_1 and persistent.goodend_2 and persistent.goodend_3 and persistent.goodend_4:
        $ persistent.true_end = True

if persistent.true_end:
   jump True_end
else:
   jump Normal_end

_________________
Image
.Traditional Chinese Site.
~Illustrator+Graphic/Web Designer~


Top
 Profile Send private message  
 
PostPosted: Wed Apr 04, 2012 10:36 am 
Newbie
User avatar

Joined: Sat Mar 24, 2012 1:38 am
Posts: 6
Thank you so much! I understand it now!


Top
 Profile Send private message  
 
PostPosted: Thu Apr 05, 2012 9:46 am 
Regular

Joined: Tue Apr 03, 2012 4:33 pm
Posts: 32
Does this mean you can prefix a variable name with "persistent." and the value of that variable will persist across multiple sessions?


Top
 Profile Send private message  
 
PostPosted: Thu Apr 05, 2012 10:58 am 
Lemma-Class Veteran

Joined: Tue Aug 01, 2006 12:39 pm
Posts: 4051
asciibard wrote:
Does this mean you can prefix a variable name with "persistent." and the value of that variable will persist across multiple sessions?

Yep, that's how it works.


Top
 Profile Send private message  
 
PostPosted: Thu Apr 05, 2012 3:57 pm 
Regular

Joined: Tue Apr 03, 2012 4:33 pm
Posts: 32
Thanks very much! This is a very important lesson!

DaFool is a misnomer!


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google [Bot]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group