Point n click-ness?
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.
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.
-
- Newbie
- Posts: 4
- Joined: Mon Sep 07, 2009 6:05 pm
- Contact:
Point n click-ness?
Okay, so basically, in the VN I'm working on, I'm trying to implement some Phoenix Wright-esque bits, in which you can pick up items, and then use them later on or have them be plot-points, etc.
Now, first off, is it possible to have an inventory system? I.e. you'd click a button and you'd have a little inventory screen pop up, and you could click on items you had and either show them to someone or just look at them. i.e. something like
Item: Post-it notes.
on_examine: Well it's my stack of post it notes.
on_show: (Othercharacter) Why are you showing me post-it notes? >_>
I'm not going to ask for the comprehensive code guide to doing this (yet) since I've picked up a couple of bits here and there from other posts and will attempt to do it myself, just to be able to know that this kind of thing is possible before I start.
Secondly, how would one go about having a point-n-click adventure element to the game? Or rather, how would one make hotspots on the screen so that you'd click them and either trigger an event? Would you map co-ordinates?
I'm guessing clicking to go to different places is straightforward but this is possible too, right?
sorry for 1000 questions, I tried to search for this but it was all "point" and "click" are too common words you can't search for them" and using the googlesearch trick didn't work too well either.
thanks in advance~
Now, first off, is it possible to have an inventory system? I.e. you'd click a button and you'd have a little inventory screen pop up, and you could click on items you had and either show them to someone or just look at them. i.e. something like
Item: Post-it notes.
on_examine: Well it's my stack of post it notes.
on_show: (Othercharacter) Why are you showing me post-it notes? >_>
I'm not going to ask for the comprehensive code guide to doing this (yet) since I've picked up a couple of bits here and there from other posts and will attempt to do it myself, just to be able to know that this kind of thing is possible before I start.
Secondly, how would one go about having a point-n-click adventure element to the game? Or rather, how would one make hotspots on the screen so that you'd click them and either trigger an event? Would you map co-ordinates?
I'm guessing clicking to go to different places is straightforward but this is possible too, right?
sorry for 1000 questions, I tried to search for this but it was all "point" and "click" are too common words you can't search for them" and using the googlesearch trick didn't work too well either.
thanks in advance~
-
- Miko-Class Veteran
- Posts: 636
- Joined: Thu May 14, 2009 8:15 pm
- Projects: Castle of Arhannia
- Contact:
Re: Point n click-ness?
yes, all of that is both possible, and has been done. try downloading the renpy games "attorney d" and "game" (the one by that alex guy that didn't bother naming it). both have the unarchived files that you can use as examples.
- mugenjohncel
- Hentai Poofter
- Posts: 2121
- Joined: Sat Feb 04, 2006 11:13 pm
- Organization: Studio Mugenjohncel
- Location: Philippines
- Contact:
Re: Point n click-ness?
Underworld King Star wrote:How would one make hotspots on the screen so that you'd click them and either trigger an event? Would you map co-ordinates?
The easiest way to achieve this is by using Renpy Image-Maps...Underworld King Star wrote:I'm guessing clicking to go to different places is straightforward but this is possible too, right?
http://www.renpy.org/wiki/renpy/doc/ref ... y.imagemap
"POOF" (I go now... Time do do some catching up!)
-
- Newbie
- Posts: 4
- Joined: Mon Sep 07, 2009 6:05 pm
- Contact:
Re: Point n click-ness?
unless I'm an idiot and can't read, one has to use like, x and y co-ordinates, right? How exactly do you go about sorta, knowing where they are?mugenjohncel wrote:The easiest way to achieve this is by using Renpy Image-Maps...
http://www.renpy.org/wiki/renpy/doc/ref ... y.imagemap
"POOF" (I go now... Time do do some catching up!)
I just see myself using trial and error to move this image all over the base thing to try and get it into place.
Re: Point n click-ness?
If we assume your game is 800x600 or whatever rectangular window size, the upper left angle of it is position x=0 and y=0 while the lower right angle of your rectangle window is x=800 and y=600. The center of your windows is supposed to point at coordinate x=400 and y=300 (half the course)
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: Point n click-ness?
I'm going to tell you what I told someone else.Underworld King Star wrote: unless I'm an idiot and can't read, one has to use like, x and y co-ordinates, right? How exactly do you go about sorta, knowing where they are?
The easiest way to find the coordinates for a hotspot is by using one of the many image-mapper programs out there. A lot of them are free, too.
- mugenjohncel
- Hentai Poofter
- Posts: 2121
- Joined: Sat Feb 04, 2006 11:13 pm
- Organization: Studio Mugenjohncel
- Location: Philippines
- Contact:
Re: Point n click-ness?
OK here's how it works... Let's say your Vn has a screen size of 800px by 600px
See the code below?...
Let's focus on this particular line...
The first set of number "51" means the hotspot is 51 pixels from the left side of the screen.
The next number "54" means the hotspot is 54 pixels from the top side of the screen.
The next number "214" means the hotspot is 214 pixels from the left side of the screen.
The last number "390" means the hotspot is 390 pixels from the top side of the screen.
The area enclosed by these coordinates will be your hotspot (see image below)
I also attached a sample game so you could study it in greater detail...
Hope this helps...
"POOF" (Disappears)
See the code below?...
Code: Select all
label start:
scene phone_a
$ result = renpy.imagemap ("phone_a.png", "phone_b.png",
[
(51, 54, 214, 390, "phone_a"),
(321, 54, 478, 390, "phone_b"),
(595, 54, 735, 390, "phone_c"),
(249, 506, 552, 533, "nope"),
], focus="imagemap")
if result == "phone_a":
jump phone_a
elif result == "phone_b":
jump phone_b
elif result == "phone_c":
jump phone_c
elif result == "nope":
jump nope
return
Code: Select all
(51, 54, 214, 390, "phone_a")
The next number "54" means the hotspot is 54 pixels from the top side of the screen.
The next number "214" means the hotspot is 214 pixels from the left side of the screen.
The last number "390" means the hotspot is 390 pixels from the top side of the screen.
The area enclosed by these coordinates will be your hotspot (see image below)
I also attached a sample game so you could study it in greater detail...
Hope this helps...
"POOF" (Disappears)
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot]