Page 1 of 1

Imagemap Questions

Posted: Thu Jul 12, 2018 11:05 am
by Minuteman
Hi.
I want to make interactive room, with items and stuff interact with.
This is possible to use Imagemap not only for "Jump" statement, but to show text? or use for item pickup?
Here is my example what I want to do:

1 - 'If I click at imagemap - I get message about this item and then get back to screen'
2 - 'If I click at imagemap - item will be in my inventory' (imagemap disappear)

This looks pretty simple, but I can't get over it, sorry for dumb question....

Thanks in advance.

Re: Imagemap Questions

Posted: Thu Jul 12, 2018 2:40 pm
by Per K Grok
Minuteman wrote: Thu Jul 12, 2018 11:05 am Hi.
I want to make interactive room, with items and stuff interact with.
This is possible to use Imagemap not only for "Jump" statement, but to show text? or use for item pickup?
Here is my example what I want to do:

1 - 'If I click at imagemap - I get message about this item and then get back to screen'
2 - 'If I click at imagemap - item will be in my inventory' (imagemap disappear)

This looks pretty simple, but I can't get over it, sorry for dumb question....

Thanks in advance.
There are a number of different actions that you can initiate from a screen, not just Jump.

https://www.renpy.org/doc/html/screen_actions.html

But you can use jump to do all kind of things with.

lets say that you in your code has a part that shows the room and the screen.

Code: Select all

label room:
      show screen hotspots
      $ renpy.pause (hard=True) 
You have some clickable items in the screen. One of them have the action Jump ("funStuff") this will send you to the label funStuff in the script

Code: Select all

label funStuff:
	--- do some fun stuff ---
	jump room
The code will send you back to room after it has done whatever it should do and you can continue to click on different clickable items. At least one of them need to go to a piece of code that does not jump back to room, so the game can continue beyond this point.

Re: Imagemap Questions

Posted: Thu Jul 12, 2018 4:01 pm
by EveningDove
In addition to what Per K Grok said, you can also make hotspots trigger multiple actions by putting them in braces.

For example:

Code: Select all

      hotspot (x,y, length, height) clicked [SetVariable("hello", True), Jump("desitnationLabel")]
Will make a hotspot that sets the variable hello to True, then jump to desitnationLabel

Re: Imagemap Questions

Posted: Fri Jul 13, 2018 11:48 am
by rames44
Instead of “show screen and then hard pause”, why not just “call screen?” Still waits for user interaction, and you can still jump out of it to wherever you want.

Re: Imagemap Questions

Posted: Sat Jul 28, 2018 11:47 am
by Minuteman
Sorry for late reply, looks like this works better with 'if' and 'not' statement.
Thanks everyone for help.