Is it correct to use DSE for affection points?
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.
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.
Is it correct to use DSE for affection points?
I'm trying to make a normal visual novel, not a Dating Sim.
Anyway, it's like this. When MC (main character) talks to someone, you can sometimes make choices about what to talk about or who to talk with. I want each and every choice to affect how much affection points those people have for MC.
BTW, affection points is a system I have where the person with the most affection points will end up with MC. But I'm not sure I can use DSE... It's got a lot of these... stuff that I can't understand.
I haven't studied python extensively yet (my only experience is with renpy), so please explain in a manner I can understand and ask question about. ^^
Anyway, it's like this. When MC (main character) talks to someone, you can sometimes make choices about what to talk about or who to talk with. I want each and every choice to affect how much affection points those people have for MC.
BTW, affection points is a system I have where the person with the most affection points will end up with MC. But I'm not sure I can use DSE... It's got a lot of these... stuff that I can't understand.
I haven't studied python extensively yet (my only experience is with renpy), so please explain in a manner I can understand and ask question about. ^^
I don't have any kind words to spare to someone who already has all the reason in the world to feel good about himself.
http://roankun.wordpress.com/
http://roankun.wordpress.com/
- Chansel
- Veteran
- Posts: 249
- Joined: Sat May 01, 2010 6:11 pm
- Projects: School's Out! -- A GxB or GxG VN/Dating Sim
- Location: The Netherlands, Noord-Brabant
- Contact:
Re: Is it correct to use DSE for affection points?
Well, perhaps it's easier to just use a variable for something like that.
Here's a small example:
So, basically you create a variable in your init block and set it to whatever you want the player to start with. Then, during your game, you can increase and decrease that value whenever you like.
Small hint though, make the variable's name shorter
Since you're probably going to use it quite often.
Hope this helps
Here's a small example:
Code: Select all
init:
$ characterA_affection = 0 #This sets the affection points for Character A to a default of 0
label start:
"You just picked an option which increases your affection points with Character A!"
$ characterA_affection += 5 # This adds 5 points to character A's affection
"You picked the wrong option!"
$ characterA_affection -= 5 # This subtracts 5 points from character A's affection
Small hint though, make the variable's name shorter
Hope this helps
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: Is it correct to use DSE for affection points?
PYTHONPYTHONGPYTNDSEPYTHONDSEDSEPOINTSPYTHON.
Oh, I'm sorry. You don't know Python? Let me try a different way to explain it then ...
All you need to do is record points in a variable. Initialize all your variables in an init block, like this:
When you do something that the K character likes, say:
And if they don't like it:
Where 1 can be any number of points. At the end, you would just compare the points for all characters, and whoever has the most, wins! I mean, you go out with them.
This will only be a problem if you need there to be a maximum and minimum amount of points for the characters. Otherwise, go crazy, kid!
p.s.: "-=" and "+=" are the short way to say "the same variable plus/minus whatever is after this" (meaning "k_love += 1" is "k_love = k_love+ 1").
Edit: CHANSEL! THUNDER STEALER! >=[
Just kidding.
Oh, I'm sorry. You don't know Python? Let me try a different way to explain it then ...
All you need to do is record points in a variable. Initialize all your variables in an init block, like this:
Code: Select all
init:
k_love = 0
l_love = 0Code: Select all
$ k_love += 1Code: Select all
$ k_love -= 1This will only be a problem if you need there to be a maximum and minimum amount of points for the characters. Otherwise, go crazy, kid!
p.s.: "-=" and "+=" are the short way to say "the same variable plus/minus whatever is after this" (meaning "k_love += 1" is "k_love = k_love+ 1").
Edit: CHANSEL! THUNDER STEALER! >=[
Just kidding.
- Chansel
- Veteran
- Posts: 249
- Joined: Sat May 01, 2010 6:11 pm
- Projects: School's Out! -- A GxB or GxG VN/Dating Sim
- Location: The Netherlands, Noord-Brabant
- Contact:
Re: Is it correct to use DSE for affection points?
Haha, lolz XD I posted, what, 2 seconds before you.
Mwahahaa
Your explanation is better though...
Mwahahaa
Your explanation is better though...
- Taroku
- Regular
- Posts: 74
- Joined: Tue Mar 17, 2009 5:22 pm
- Projects: Eh? Get off my back!
- Location: Denmark
- Contact:
Re: Is it correct to use DSE for affection points?
If I understand your question right, all you need are some simple variables:
...Something like that. I recommend you practice this, as it can help you tremendously in the future. 
Before post Edit: Whaaaa?! You guys beat me to it!
After post Edit: Though you should definitely do what they said, and write it in 'init' first.
Code: Select all
Label meeting:
g "Hello."
menu:
"Say 'Hello'":
girl_1 += 5
g "Wanna walk together?"
"Say nothing":
girl_1 -= 1
g "You could at least say hello..."
if girl_1 >= 5:
g "How about we visit a café?"
[Your code]
else:
g "You're such a pain..."
[Your code]
Before post Edit: Whaaaa?! You guys beat me to it!
After post Edit: Though you should definitely do what they said, and write it in 'init' first.
-
number473
- Regular
- Posts: 195
- Joined: Tue Dec 15, 2009 4:20 am
- Projects: The Duke's Daughter
- Location: Cape Town
- Contact:
Re: Is it correct to use DSE for affection points?
T^TAleema wrote:Where 1 can be any number of points.
The code is, of course, correct, but the explanation above makes Mathematics cry ;_;
Mental weather report: Cloudy with a possibility of brain storms.
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: Is it correct to use DSE for affection points?
T^T Random troll posts make me cry.number473 wrote: T^T
The code is, of course, correct, but the explanation above makes Mathematics cry ;_;
-
number473
- Regular
- Posts: 195
- Joined: Tue Dec 15, 2009 4:20 am
- Projects: The Duke's Daughter
- Location: Cape Town
- Contact:
Re: Is it correct to use DSE for affection points?
Yeah, I know it was irrelavant, but you'd answered the question already so I didn't have anything useful to add.
Mental weather report: Cloudy with a possibility of brain storms.
Re: Is it correct to use DSE for affection points?
Um, if you initialise it in the init block, it'll reset it to that value every time you run the programme, won't it? Which would be a bad thing. Instead, initialise it after the start label. Like:
Code: Select all
label start:
$ Alovepoints = 0
$ Blovepoints = 0
e "Hello! You've started a new game!"
Re: Is it correct to use DSE for affection points?
I don't think it's quite so simple. IIRC, any variable which is assigned to directly after the start of the game will be saved, so:Showsni wrote:Um, if you initialise it in the init block, it'll reset it to that value every time you run the programme, won't it?
Code: Select all
init:
loveLovePoints = 0
start:
loveLovePoints = 5
"Dialogue"
The problem comes when assigning to attributes of classes, in particular, because you're not actually assigning to the variable itself, and the variable has the same literal data - the same reference to the same class instance - at the time of save as it does in the init block. So you have trouble with things like lists:
Code: Select all
init:
loveList = ['kittens', 'apples']
start:
$ loveList.append('shirley')
"Dialogue"
Of course, just because you can probably get away with assigning to your points variables in the init block and modifying them in script doesn't mean you necessarily should - ultimately you're right, it's safest to set up all your game-state stuff just after the 'start' label, just to be on the safe side!
Server error: user 'Jake' not found
- Sheru-chan
- Regular
- Posts: 89
- Joined: Sun Jun 13, 2010 1:23 am
- Location: Cavite, Philippines
- Contact:
Re: Is it correct to use DSE for affection points?
Ermm... I'm just curious...
If, i need to branch the story by whom the OC has more affection, how can i do it? (I'm still reading the tut but maybe asking here is more easier) I just hope it would be explained in a manner for the noobs....
If, i need to branch the story by whom the OC has more affection, how can i do it? (I'm still reading the tut but maybe asking here is more easier) I just hope it would be explained in a manner for the noobs....
Currently working on:
Lock On! ~Sins and Atonement~ in hiatus
GXB game.
---------------------------------------
Imouto Complex is active.
Lock On! ~Sins and Atonement~ in hiatus
GXB game.
---------------------------------------
Imouto Complex is active.
Re: Is it correct to use DSE for affection points?
Something like
Code: Select all
if apoints > bpoints:
jump apath
Re: Is it correct to use DSE for affection points?
Oh, okay. Thanks for all the help, and sorry for the late reply. ^^
Hmmm... Just one more thing. I have to make a status page (which accessible from the game at all times) and that's where you can see their affection points. However, I don't want it to be numbers like
agirl = 5
I actually also want to include images (the girl's faces) instead of names, and hearts (instead of numbers.) The hearts will change in color and size depending on the number of affection points... How can I do this?
P.S. How do I make the status page and how do I make it accessible from the game? Should I use call or jump or something else?
P.P.S. Regarding what Jake brought up... Does that mean if you save the game and then load it, you won't have the same number of affection points you saved with?
Hmmm... Just one more thing. I have to make a status page (which accessible from the game at all times) and that's where you can see their affection points. However, I don't want it to be numbers like
agirl = 5
I actually also want to include images (the girl's faces) instead of names, and hearts (instead of numbers.) The hearts will change in color and size depending on the number of affection points... How can I do this?
P.S. How do I make the status page and how do I make it accessible from the game? Should I use call or jump or something else?
P.P.S. Regarding what Jake brought up... Does that mean if you save the game and then load it, you won't have the same number of affection points you saved with?
I don't have any kind words to spare to someone who already has all the reason in the world to feel good about himself.
http://roankun.wordpress.com/
http://roankun.wordpress.com/
Re: Is it correct to use DSE for affection points?
It means that if you don't set the affection points in an init block, and instead set them to the default values after the start: label, you don't have anything to worry about.roankun wrote: P.P.S. Regarding what Jake brought up... Does that mean if you save the game and then load it, you won't have the same number of affection points you saved with?
There are some conditions under which you can have your points reset when you save and then load, but they all revolve around initially setting up the points in an init: block.
Server error: user 'Jake' not found
- BlueRoseMaidenAras
- Regular
- Posts: 56
- Joined: Wed Feb 03, 2010 10:04 pm
- Location: ~Somewhere Around the World~
- Contact:
Re: Is it correct to use DSE for affection points?
I understand some things... So you DON'T need to download anything? Or anything like that...? Is it already in the renpy engine?
please join! <3
http://erigot-academy.deviantart.com/
Arasettie+ Jaden= Jadettie
Arasettie + Atticus= Attisettie
Arasettie+ Christopher= Chrisettie
Arasettie+ Gale= Galettie
Christopher+ Elaine= Christaine
Atticus+ Vanessa= Attissa
Emile+ Arasettie= Emisettie
Christopher+ Ariana= Christiana
Atticus+ Eris= Attis
Jaden+ Valentia= Jalentia
Gale+ Nami= Gami
Gale+ Iruzu= Garuzu
http://erigot-academy.deviantart.com/
Arasettie+ Jaden= Jadettie
Arasettie + Atticus= Attisettie
Arasettie+ Christopher= Chrisettie
Arasettie+ Gale= Galettie
Christopher+ Elaine= Christaine
Atticus+ Vanessa= Attissa
Emile+ Arasettie= Emisettie
Christopher+ Ariana= Christiana
Atticus+ Eris= Attis
Jaden+ Valentia= Jalentia
Gale+ Nami= Gami
Gale+ Iruzu= Garuzu
Who is online
Users browsing this forum: No registered users




