renpy.get_music is in the documentation.
As for calling a screen, you can't do it. If you look at the screen actions page:
http://www.renpy.org/doc/html/screen_actions.html
you'll notice there are six control actions: Hide, Jump, NullAction, Return, Show, and ShowTransient. There is no call.
Do you absolutely need to call the screen? Why? Here is a tester that show three different ways to get a screen from a screen.
The screens are also more advanced. Create a tester and put this code in it. Then study the code. See if any of this inspires you:
Code: Select all
screen mainBattle(char, enemy):
frame align (0.12, 0.12):
vbox xalign 0.05:
text "Battle!"
text "-----"
text "YOU: [char.hp]/[char.maxHP] HP"
text "ENEMY: [enemy.hp]/[enemy.maxHP] HP"
textbutton "Fight in new context" action ui.callsinnewcontext("choosetest", char)
textbutton "Fight ShowTransient" action ShowTransient("choose_trans", char=char)
textbutton "Fight Show" action Show("choose_show", char=char)
textbutton "End Fight" action [SetVariable("tempSkill", None), Hide("mainBattle")]
if tempSkill:
text "Result: [tempSkill.name]"
screen choose_new(char):
frame:
align(0.5,0.5)
vbox:
text "Choose your action!"
text "-----"
for i in char.skills:
textbutton "[i.name]" action [SetVariable("tempSkill", i), Return()]
screen choose_trans(char):
modal True
frame:
align(0.5,0.5)
vbox:
text "Choose your action!"
text "-----"
for i in char.skills:
textbutton "[i.name]" action [SetVariable("tempSkill", i), Return()]
screen choose_show(char):
modal True #This is only needed for the various show versions, not needed for the call version
frame:
align(0.5,0.5)
vbox:
text "Choose your action!"
text "-----"
for i in char.skills:
textbutton "[i.name]" action SetVariable("tempSkill", i)
textbutton "Close Screen" action Hide("choose_show")
init python:
class Char():
def __init__(self, name, hp, mhp, skills):
self.name = name
self.hp = hp
self.maxHP = mhp
self.skills = skills
class Skill():
def __init__(self, name, number):
self.name = name
self.number = number
label choosetest(char):
call screen choose_new(char)
return
default fight = Skill("Fight", 12)
default defend = Skill("Defend", 14)
default talk = Skill("Talk", 16)
default hero = Char("Hero", 10, 10, [fight, defend, talk])
default villain = Char("Villain", 12, 12, [fight, defend, talk])
default tempSkill = None
# The game starts here.
label start:
scene black
"This tester looks at three different ways of accessing a screen from a screen."
show screen mainBattle(hero, villain)
"Here is a Battle screen. There are three buttons here. First try 'Fight from new context.'
When you click it, you will be brought to a new screen and everything else disappears. Click on
one of the choices on that second screen. When you click one of those buttons, you will come back
to where you were before (Basically that click doesn't count as an interaction in the main game's
context, because you are in a new temporary context). But note, This text will still be here.
After you've done that, click anywhere to advance the text."
"Note one more thing about calling in new context: with that command you can only call a label not a screen,
so you have to have a label that calls your screen. It is a bit convoluted, but gets the job done. Click onward."
"Now click on Fight with ShowTransient. Because the screen is modal you can't click on anything else
while that screen is up. Try clicking outside of the new screen. Also note that unlike call in new context
everything else doesn't disappear (because you are not in a new context). Also note this text stays. Click a button."
"Notice that clicking a button using ShowTransient causes the screen to disappear (because that is what ShowTransient does)
and advances the text as well--because the buttons on this screen include the Return() action, which is an interaction.
Okay click somewhere to advance the text."
"Now here is one more option for a screen from a screen. That is just the regular Show. Click on that button. Because
the screen is modal, you can't advance the game by clicking anywhere else, go ahead and try. Now try clicking the buttons.
On this screen I got rid of the Return() action in the buttons, so you can click on them but it doesn't advance anything.
Click close screen to close the screen. It also doesn't have a Return() action so it won't advance the game. So after
you do that, click to move on."
"That is the end of this tester. Click end fight."
"Tester Over."
return
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