Is it possible to stick two words together?
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.
-
TheChatotMaestro
- Regular
- Posts: 91
- Joined: Mon Jul 31, 2017 8:33 am
- Deviantart: LedianWithACamera
- Contact:
Is it possible to stick two words together?
I remember a function of renpy where it would take two words, like, defined in variables or something, and stick them together to make one word. Say you had a variable that was set to "song" and a variable that was set to "bird", it would put them together and come out with "songbird". I haven't been able to find it in any documentation, and I can't for the life of me remember what on earth it was called (or if it even actually exists), so googling doesn't do me much good. Does anyone know?
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: Is it possible to stick two words together?
Depends what you're using it for.
If you just want a player to name themselves, I guess this could work:
I left out the character naming bit
If you just want a player to name themselves, I guess this could work:
Code: Select all
default song = "player"
default bird = "one"
label start:
e "Hello, [song][bird]."Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Re: Is it possible to stick two words together?
You can do it easily in Python:
var1 and var2 need to be strings, of course.
Code: Select all
$ new_var = var1 + var2-
TheChatotMaestro
- Regular
- Posts: 91
- Joined: Mon Jul 31, 2017 8:33 am
- Deviantart: LedianWithACamera
- Contact:
Re: Is it possible to stick two words together?
Thank you! Do you think this code would work?
(Message is defined earlier when you use an item, and convo is defined when you go into the character interaction. When you use an item, it shows a screen that jumps to here, and puts the two together to make something like the label 'debuginteractionplaceholderitem' and then jump there, to show the character's proper reaction.)
Code: Select all
label checkprofilecalc:
$ jumpconvo = convo + message
jump [jumpconvo]
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: Is it possible to stick two words together?
Since they need to be strings, I would assume it should be:
Code: Select all
label checkprofilecalc:
$ jumpconvo = "convo" + "message"
jump [jumpconvo]
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Is it possible to stick two words together?
I think you should also be able to use the expression keyword.
So:
So:
Code: Select all
label checkprofilecalc:
jump expression convo+message
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
Who is online
Users browsing this forum: Google [Bot]
