Here's what I want to do:
Create a shop screen using an imagemap, where the hotspots act as the buying options. A tooltip appears when you hover over the items, and then a new one appears if you choose to buy it. When you buy the item it will set a variable to True, as well as subtract a sum of money.
Here's the issue:
I have no idea, what Screen Action I should be using within the hotspot when it is True so that it:
1) Subtracts a certain amount of money AND
2) Sets a variable to False AND
3) Lets a new tooltip appear.
Here is my current code for the whole screen. Note that the first hotspot is different, as I was changing that up a bunch to try and figure it out first, before I applied it to the next hotspots (basically, I want all the hotspots to have the same actions, but I've only adjusted the first one for now):
Code: Select all
screen bookstore_screen:
zorder 55
default tt = Tooltip("")
imagemap:
ground "shop/bookstore_ground.png"
idle "shop/bookstore_idle.png"
hover "shop/bookstore_hover.png"
#tact
if not tactbook_bought:
hotspot(292,122,144,126) action [If(money >= 45, true = tt.Action("Thank you for your purchase!"), false = tt.Action("I don't have enough money for that"))]hover_sound "Sounds/glass_button.mp3" activate_sound "Sounds/triangle.mp3" hovered tt.Action("Long sentence.... (+15 Tact)")
#charisma
if not charismabook_bought:
hotspot(466,123,144,126) action Show("charismabook_screen") hover_sound "Sounds/glass_button.mp3" activate_sound "Sounds/triangle.mp3"hovered tt.Action("Long sentence.... (+15 Charisma)")
#fashion
if not fashionbook_bought:
hotspot(641,123,144,126) action Show("fashionbook_screen") hover_sound "Sounds/glass_button.mp3" activate_sound "Sounds/triangle.mp3"hovered tt.Action("Long sentence.... (+15 Fashion Sense)")
#wit
if not witbook_bought:
hotspot(813,123,144,126) action Show("witbook_screen") hover_sound "Sounds/glass_button.mp3" activate_sound "Sounds/triangle.mp3"hovered tt.Action("Long sentence.... (+15 Wit)")
#fitness
if not fitnessbook_bought:
hotspot(989,123,144,126) action Show("fitnessbook_screen") hover_sound "Sounds/glass_button.mp3" activate_sound "Sounds/triangle.mp3"hovered tt.Action("Long sentence.... (+15 Fitness)")
#henry +20
if not henrybook_bought:
hotspot(381,279,144,126) action Show("henrybook_screen") hover_sound "Sounds/glass_button.mp3" activate_sound "Sounds/triangle.mp3"hovered tt.Action("Long sentence.... .")
#frank +20
if not frankbook_bought:
hotspot(555,278,144,126) action Show("frankbook_screen") hover_sound "Sounds/glass_button.mp3" activate_sound "Sounds/triangle.mp3"hovered tt.Action("Long sentence.... ")
#joe +20
if not joebook_bought:
hotspot(728,279,144,126) action Show("joebook_screen") hover_sound "Sounds/glass_button.mp3" activate_sound "Sounds/triangle.mp3"hovered tt.Action("Long sentence.... ")
if not nedbook_bought:
hotspot (903,283,144,126) action Show("nedbook_screen") hover_sound "Sounds/glass_button.mp3" activate_sound "Sounds/triangle.mp3"hovered tt.Action("Long sentence.... ")
#Done
hotspot (11,123,222,55) action Return() hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"
frame:
xmaximum 747
vbox:
xpos 295
ypos 558
text tt.value size 20 font "Font/Contra.ttf" color "#682a14" outlines [ (1, "#efcba5", 1, 1) ]
frame:
xpos 50
ypos 27
has vbox
text ("$ %d" %money)
Code: Select all
if not tactbook_bought:
hotspot(292,122,144,126) action [If(money >= 45, true = tt.Action("Thank you for your purchase!"), false = tt.Action("I don't have enough money for that"))]hover_sound "Sounds/glass_button.mp3" activate_sound "Sounds/triangle.mp3" hovered tt.Action("Long sentence... (+15 Tact)")
Code: Select all
tt.Action("Thank you for your purchase!")
make
Code: Select all
$ tactbook_bought = True
Code: Select all
$ money -= 45