Imagemap Questions

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
Minuteman
Regular
Posts: 40
Joined: Sat Feb 24, 2018 2:02 pm
Location: On duty
Contact:

Imagemap Questions

#1 Post 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.
of the people for the people

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Imagemap Questions

#2 Post 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.

EveningDove
Newbie
Posts: 5
Joined: Thu Jun 07, 2018 2:20 pm
Contact:

Re: Imagemap Questions

#3 Post 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

rames44
Veteran
Posts: 233
Joined: Sun May 29, 2016 4:38 pm
Contact:

Re: Imagemap Questions

#4 Post 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.

User avatar
Minuteman
Regular
Posts: 40
Joined: Sat Feb 24, 2018 2:02 pm
Location: On duty
Contact:

Re: Imagemap Questions

#5 Post by Minuteman »

Sorry for late reply, looks like this works better with 'if' and 'not' statement.
Thanks everyone for help.
of the people for the people

Post Reply

Who is online

Users browsing this forum: No registered users