This mechanic works fine, however since the screen is invoked with call it disappears when you start a dialogue. The way I found to deal with this was to call the same screen with show to use as background while the conversation is going and then go back to the screen with a call, however doing this means loosing the position of the player in the map, so I need a way to keep the coordinates of the player's location.
After reading through the documentation I thought of using two global variables and setting them to the x and yadjustment.value when initiating a conversation with an npc as this should set the coordinates of the player to the variables, that way I could then pass the variables as arguments to the screen and setting the xinitial yinitial to those values. This, however, doesn't seem to work unless the player press the wheel of the mouse to hide the screen, after which the coordinates of the moment when the player pressed the wheel are saved. Needless to say this isn't what I'm looking for, but I can't think of a way to make the system work the way I'd like to.
Does anyone know how could I fix this?
Here's the code:
(Calling the map)
Code: Select all
$ npc = ["images/npc/n5_dojima/n5_0_0_0.png", "images/npc/n8_nanako/n8_0_0_0.png"]
$ script = ["ns8_2_1", "ns8_2_2"]
$ x_pos = [1350, 1450]
$ y_pos = [3020, 2910]
$ scroll_x = 750
$ scroll_y = 2700
call screen f008_002(npc, script, x_pos, y_pos, scroll_x, scroll_y, True)
Code: Select all
screen f008_002(npc, script, x_pos, y_pos, scroll_x, scroll_y, can_interact):
zorder -100
default xadj = ui.adjustment(scroll_x)
default yadj = ui.adjustment(scroll_y)
viewport id "f008_002":
child_size(4999, 4320)
draggable can_interact
yinitial scroll_y
xinitial scroll_x
yadjustment yadj
xadjustment xadj
add "images/map/f008_002_inaba_south/f008_002.png"
for i in range(len(npc)):
imagebutton:
idle npc[i] at half_size
if can_interact:
action [SetVariable("scroll_y", yadj.value), SetVariable("scroll_x", xadj.value), Call(script[i])]
xpos x_pos[i]
ypos y_pos[i]
Code: Select all
label ns8_2_1:
show screen f008_002(npc, script, x_pos, y_pos, scroll_x, scroll_y, False)
show Dojima_1 at right
"Dojima" "How're you feeling?"
"Dojima" "Ready to get back in the car?"
menu:
"Dojima" "Ready to get back in the car?"
"I'm ready":
"Dojima" "All right, let's hit the road then."
hide Dojima_1
jump day_2011_4_11_2
"Not yet...":
"Dojima" "I see."
"Dojima" "Well, I'll be waiting here."
"Dojima" "You should take a walk around here."
"Dojima" "Hopefully it'll make you feel better."
hide Dojima_1
call screen f008_002(npc, script, x_pos, y_pos, scroll_x, scroll_y, True)