Which do I use for a 'point-and-click' scene?: Custom Screen or Imagemap?

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
starling_harley
Newbie
Posts: 6
Joined: Wed Sep 21, 2022 8:25 pm
Projects: The Diamandian Guard
Deviantart: m5w
Location: yeehawland
Discord: starlitseas#2253
Contact:

Which do I use for a 'point-and-click' scene?: Custom Screen or Imagemap?

#1 Post by starling_harley »

Hullo! I'm currently at an impasse on what to use and how exactly to use it for making a 'point and click' scene in my game with buttons that play animation, to put it simply. I want there to be multiple of these kinds of scenes, but it just depends on if I can get past this first one. (´・ω・`)

So, the idea is that the character (in this specific case, a young lady named Melanie) is sitting in front of the player, and you can click the curtain next to her to open and close it. Ergo, when you click on the curtain area, this is what I want to happen.

Image

I've already read this tutorial to try to map out a button, but what I don't get is where to put this code or if I'm even approaching it correctly. Do I make it a custom screen in it's own .rpy file? Or do I try to define a new imagemap within the script itself as I go whenever I want a scene like this to happen?

My code for this section in script.rpy currently looks like this:

Code: Select all

    ##CLICKABLECARRIAGE START##
    scene movingcarriagebg:
        carriagesway
    
    show closedcurtains    
    show carriageclickablemelanie smiletalk
    with fade
    mel "I'm so happy we get to live here now!"
    
    show carriageclickablemelanie smile
    tips "Sometimes there are clickables within special environments like this."
    tips "You can click on objects in the background and even whomever you're talking to for special interactions!"
    tips "Try clicking on the curtain."

    imagemap:
        idle "curtain1_idle.png"
        hover "curtain1_hover.png"
        ground "curtain1_ground.png"
        
        hotspot (156, 20, 252, 680) action Show('movingcurtains')
And the error I'm presently getting with that is:

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.

File "game/script.rpy", line 270: expected statement.
    imagemap:
            ^

Ren'Py Version: Ren'Py 7.4.0.892
Wed Sep 21 20:00:55 2022
I'm so confused right now. I've been watching YouTube videos, scouring the forums and Ren'py documentation, etc to try to figure this out, but to no avail. x_x" Any help/code correction on this would be super helpful! Thank you!

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Which do I use for a 'point-and-click' scene?: Custom Screen or Imagemap?

#2 Post by Imperf3kt »

An image map must be used as part of a screen.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
starling_harley
Newbie
Posts: 6
Joined: Wed Sep 21, 2022 8:25 pm
Projects: The Diamandian Guard
Deviantart: m5w
Location: yeehawland
Discord: starlitseas#2253
Contact:

Re: Which do I use for a 'point-and-click' scene?: Custom Screen or Imagemap?

#3 Post by starling_harley »

Ah! I see. :o So I'd make something like customscreen.rpy and make the imagemap there first? And then I'd call it in the main script?

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Which do I use for a 'point-and-click' scene?: Custom Screen or Imagemap?

#4 Post by Imperf3kt »

Yes that should work.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Andredron