Question about point-and-click system for mystery VN
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.
Question about point-and-click system for mystery VN
Hi,
I was just wondering if it is possible to click on a background and get some important objects/evidences, as well as show them to another character and hear them say something about it? Yes, I'm talking about the Phoenix Wright style because I'm making a mystery visual novel.
I looked at the previous posts in the forum and found some similar questions, but none of them answered what I was looking for. I even checked Attorney D and the Phoenix goes to Renpy games just to see if they have the investigation part, but they only showed the court scenes. T_T
Your help would be really helpful, thank you~
I was just wondering if it is possible to click on a background and get some important objects/evidences, as well as show them to another character and hear them say something about it? Yes, I'm talking about the Phoenix Wright style because I'm making a mystery visual novel.
I looked at the previous posts in the forum and found some similar questions, but none of them answered what I was looking for. I even checked Attorney D and the Phoenix goes to Renpy games just to see if they have the investigation part, but they only showed the court scenes. T_T
Your help would be really helpful, thank you~
- The CRxTR
- Regular
- Posts: 56
- Joined: Sat Apr 18, 2009 4:55 am
- Projects: "Project Fareena"
- Organization: Cyclohexane Games
- Tumblr: crxtrdude
- Github: crxtrdude
- itch: crxtrdude
- Discord: CRxTRDude#9493
- Contact:
Re: Question about point-and-click system for mystery VN
Hello.
I hope it might be helpful...
I questioned in the forum about how to do image maps (very useful if you want custom interfaces w/o learning UI).
What you could do is using the combination of image maps and variables.
Firstly, you make a variable to the designated object.
Suppose if you have a ball object, you can state in the init in script.rpy:
init:
$ ball_pickup = 0
$ ball_given = ""
the ball_pickup variable is a boolean (true or false)
the ball_given variable is a stirng ("Dude" for eg surrounding in doublequotes is the string.)
You then do an img map with hotspots on the objects you wanted, for example you made a jpg on a background with a table and a ball.
You can then enable the pickup:
This signifies that you picked up the ball.
Finally, If you want to share to others the ball or giving it to others:
eg:
If you want to know how to do these image maps:
I hope it might be helpful...
I questioned in the forum about how to do image maps (very useful if you want custom interfaces w/o learning UI).
What you could do is using the combination of image maps and variables.
Firstly, you make a variable to the designated object.
Suppose if you have a ball object, you can state in the init in script.rpy:
init:
$ ball_pickup = 0
$ ball_given = ""
the ball_pickup variable is a boolean (true or false)
the ball_given variable is a stirng ("Dude" for eg surrounding in doublequotes is the string.)
You then do an img map with hotspots on the objects you wanted, for example you made a jpg on a background with a table and a ball.
You can then enable the pickup:
Code: Select all
$ ball_pickup = 1
Finally, If you want to share to others the ball or giving it to others:
eg:
Code: Select all
e "Hey, what do you have there?"
me "I have a ball, do you want to take it?"
if ball_pickup == 1:
$ ball_given = "e" # this can be the name of the character or the equivalent
else:
e "You don't have any ball"
Again hope this helps. ; )mugenjohncel wrote:You may also want to check this...
http://lemmasoft.renai.us/forums/viewto ... 168#p78168
"POOF" (Disappears)
CRxTR
-
- Miko-Class Veteran
- Posts: 701
- Joined: Sat May 26, 2007 3:41 pm
- Contact:
Re: Question about point-and-click system for mystery VN
If you're going to modify your variables later, it's better to initialize them under 'start', not 'init'. 'init' is for variables that stay constant throughout the game.The CRxTR wrote: Suppose if you have a ball object, you can state in the init in script.rpy:
init:
$ ball_pickup = 0
$ ball_given = ""
- The CRxTR
- Regular
- Posts: 56
- Joined: Sat Apr 18, 2009 4:55 am
- Projects: "Project Fareena"
- Organization: Cyclohexane Games
- Tumblr: crxtrdude
- Github: crxtrdude
- itch: crxtrdude
- Discord: CRxTRDude#9493
- Contact:
Re: Question about point-and-click system for mystery VN
Well, it's just like "Dim" in Visual BASIC (fro those who don't program, 'dim' declares the variable like 'python' or '$', you usually declare 'dim' in the 'General Declarations' section, in this case "init".)Wintermoon wrote: The CRxTR wrote:Suppose if you have a ball object, you can state in the init in script.rpy:
init:
$ ball_pickup = 0
$ ball_given = ""
If you're going to modify your variables later, it's better to initialize them under 'start', not 'init'. 'init' is for variables that stay constant throughout the game.
So that the variable can be used all over the game.
For example if the ball object is used on the whole game, it is nice to make a variable in a beginning of the program.
Sorry for the argument.
But the image map works on his situation right?
CRxTR
- killdream
- Veteran
- Posts: 325
- Joined: Wed Nov 05, 2008 1:05 pm
- Projects: EVūL (WIP), insilo (WIP), Cute Demon Crashers!
- Deviantart: robotlolita
- Github: robotlolita
- Location: World's End (aka Brazil)
- Contact:
Re: Question about point-and-click system for mystery VN
Hm, well... it's a no and sort-of-no. All variables you declare in Ren'Py will go on the global namespace by default and will be shared through all files, unless you declare it inside a function or class, it is. The init section has the purpose of initializing things before the game runs, and when the player loads the game Ren'Py will just apply the modifications to these variables as needed. And anyways, in Python whenever you assign a variable to a value it'll be defined for you (if it had not been defined yet).The CRxTR wrote:Well, it's just like "Dim" in Visual BASIC (fro those who don't program, 'dim' declares the variable like 'python' or '$', you usually declare 'dim' in the 'General Declarations' section, in this case "init".)Wintermoon wrote: The CRxTR wrote:Suppose if you have a ball object, you can state in the init in script.rpy:
init:
$ ball_pickup = 0
$ ball_given = ""
If you're going to modify your variables later, it's better to initialize them under 'start', not 'init'. 'init' is for variables that stay constant throughout the game.
So that the variable can be used all over the game.
For example if the ball object is used on the whole game, it is nice to make a variable in a beginning of the program.
You can declare variables in-game (the start or whatever label), but then you can't make sure that Ren'Py will set those variables before you request them, and your game can end up with a "Variable x is not defined.". And you'll most probably have problems with loading a game after modifying the script to use that variable before it's defined on the save file.
-
- Miko-Class Veteran
- Posts: 701
- Joined: Sat May 26, 2007 3:41 pm
- Contact:
Re: Question about point-and-click system for mystery VN
'init' isn't anything like a 'General Declarations' section. Variables assigned in 'init' are supposed to be constant, so Ren'Py won't try to save them when you save the game. This is good for characters, which Ren'Py can't save. It's bad for integers that you intend to change later.The CRxTR wrote:Well, it's just like "Dim" in Visual BASIC (fro those who don't program, 'dim' declares the variable like 'python' or '$', you usually declare 'dim' in the 'General Declarations' section, in this case "init".)
(IIRC Ren'Py does have a mechanism for detecting changes to variables assigned in 'init', but it's not perfect. It'll catch changes to integers, but not changes to the contents of lists, for example.)
The other problem is that 'init' is run exactly once when the program starts. So if you set the variable to 0 in 'init', play the game until you reach the point where the variable is set to 1, quit to the main menu, and start the game again, you will now be playing from the start with the variable set to 1. The only way Ren'Py can avoid this is by having two copies of the variable, one set in 'init' and the other set in the actual game. (I'm not sure if Ren'Py does this, but I doubt it.)
- killdream
- Veteran
- Posts: 325
- Joined: Wed Nov 05, 2008 1:05 pm
- Projects: EVūL (WIP), insilo (WIP), Cute Demon Crashers!
- Deviantart: robotlolita
- Github: robotlolita
- Location: World's End (aka Brazil)
- Contact:
Re: Question about point-and-click system for mystery VN
Well, it is for what it proposes to do. It'll catch and save all REFERENCE changes. For example, assigning an integer to a variable will cause a reference change.Wintermoon wrote:(IIRC Ren'Py does have a mechanism for detecting changes to variables assigned in 'init', but it's not perfect. It'll catch changes to integers, but not changes to the contents of lists, for example.)
Code: Select all
$ my_var = 0
Code: Select all
$ my_var = [] # this will be saved
$ my_var.append(1) # this will not be saved
For a list, something like:
Code: Select all
$ my_var = [] # this will be saved
$ my_var.append(1) # this will not be saved
$ my_var = my_var[:] # this will be saved
I'm not sure of that. I guess contexts exist so each time you start a new game a new variable context will be started with the values defined on init. But again, I'm not sure about this, but it does makes more sense this way.Wintermoon wrote:The other problem is that 'init' is run exactly once when the program starts. So if you set the variable to 0 in 'init', play the game until you reach the point where the variable is set to 1, quit to the main menu, and start the game again, you will now be playing from the start with the variable set to 1. The only way Ren'Py can avoid this is by having two copies of the variable, one set in 'init' and the other set in the actual game. (I'm not sure if Ren'Py does this, but I doubt it.)
-
- Miko-Class Veteran
- Posts: 701
- Joined: Sat May 26, 2007 3:41 pm
- Contact:
Re: Question about point-and-click system for mystery VN
The rules are clear and easy to remember when you know them, but it's still a hack. There's a right way and a wrong way to program, and initializing variables that you intend to modify later under 'init' is the wrong way, even if it works.killdream wrote:Well, it is for what it proposes to do. It'll catch and save all REFERENCE changes. For example, assigning an integer to a variable will cause a reference change.
Re: Question about point-and-click system for mystery VN
So, yeah, to get back on topic image maps are what you want to use.
http://www.renpy.org/wiki/renpy/doc/ref ... y.imagemap
http://www.renpy.org/wiki/renpy/doc/ref ... y.imagemap
- The CRxTR
- Regular
- Posts: 56
- Joined: Sat Apr 18, 2009 4:55 am
- Projects: "Project Fareena"
- Organization: Cyclohexane Games
- Tumblr: crxtrdude
- Github: crxtrdude
- itch: crxtrdude
- Discord: CRxTRDude#9493
- Contact:
Re: Question about point-and-click system for mystery VN
Thanks for the corrections guys.
Good thing this is only my hobby. I'm no expert at programming though.
These guys are right on one thing or another.
But still the decision is on you.
(I don't know what I'm saying I have fever....)
I hope that we helped one way or another.
Good thing this is only my hobby. I'm no expert at programming though.
These guys are right on one thing or another.
But still the decision is on you.
(I don't know what I'm saying I have fever....)
I hope that we helped one way or another.
CRxTR
- The CRxTR
- Regular
- Posts: 56
- Joined: Sat Apr 18, 2009 4:55 am
- Projects: "Project Fareena"
- Organization: Cyclohexane Games
- Tumblr: crxtrdude
- Github: crxtrdude
- itch: crxtrdude
- Discord: CRxTRDude#9493
- Contact:
Re: Question about point-and-click system for mystery VN
HELLOOO AGAIN
My fever subsided and I'm back with a question....
(This post is perfect for this cuz it's related here.)
I answered his question by saying...
and now I question a similar one too....
I'm making this game called "Romance on Sunset Boulevard" and I've been using the "init" block to initialize a variable to be used for the name of the protagonist (Using DynamicCharacter as the character protagonist).
Can I have other alternatives aside using the "init" block?
My fever subsided and I'm back with a question....
(This post is perfect for this cuz it's related here.)
I answered his question by saying...
and of course a lot of you guys questioned my reply.The CRxTR wrote: What you could do is using the combination of image maps and variables.
and now I question a similar one too....
I'm making this game called "Romance on Sunset Boulevard" and I've been using the "init" block to initialize a variable to be used for the name of the protagonist (Using DynamicCharacter as the character protagonist).
Code: Select all
init:
$ ego_name = ""
$ ego = DynamicCharacter('%(ego_name)s')
CRxTR
-
- Miko-Class Veteran
- Posts: 701
- Joined: Sat May 26, 2007 3:41 pm
- Contact:
Re: Question about point-and-click system for mystery VN
The CRxTR wrote:Can I have other alternatives aside using the "init" block?Code: Select all
init: $ ego_name = "" $ ego = DynamicCharacter('%(ego_name)s')
Code: Select all
init:
$ ego = DynamicCharacter('%(ego_name)s')
label start:
$ ego_name = ""
Note that you don't have to initialize ego_name before ego, so long as ego_name exists when you actually use ego.
- The CRxTR
- Regular
- Posts: 56
- Joined: Sat Apr 18, 2009 4:55 am
- Projects: "Project Fareena"
- Organization: Cyclohexane Games
- Tumblr: crxtrdude
- Github: crxtrdude
- itch: crxtrdude
- Discord: CRxTRDude#9493
- Contact:
Re: Question about point-and-click system for mystery VN
@ Wintermoon:
What do you mean;
What do you mean;
And thanks in advance.Wintermoon wrote:Better yet, wait until you have an actual value for ego_name before initializing it.
CRxTR
-
- Miko-Class Veteran
- Posts: 701
- Joined: Sat May 26, 2007 3:41 pm
- Contact:
Re: Question about point-and-click system for mystery VN
Presumably you have some place in your script where ego_name is assigned a real name instead of the empty string (""). Unless you want to use the ego character before that point, it's OK to skip the initialization to the empty string.
So if you have something like this:
It's OK to simplify to this:
So if you have something like this:
Code: Select all
init:
$ ego = DynamicCharacter('%(ego_name)s')
label start:
$ ego_name = ""
"Please enter your name"
$ ego_name = ui.input()
Code: Select all
init:
$ ego = DynamicCharacter('%(ego_name)s')
label start:
"Please enter your name"
$ ego_name = ui.input()
-
- Eileen-Class Veteran
- Posts: 1686
- Joined: Mon Sep 21, 2009 8:03 pm
- Projects: E-mail me if you wanna rock the planet
- Location: USA
- Contact:
Re: Question about point-and-click system for mystery VN
I have a conceptual question. In a regular VN, will the user be expecting suddenly imagemaps in the background? Should they be animated or otherwise have an eyecatch?
I mean, it should be obvious, right? If it's going to have a location menu like Divi Dead, and also a hunt-the-object to go with your mystery ... I've never tried the DSE yet, but I know what it's about in theory.
I mean, it should be obvious, right? If it's going to have a location menu like Divi Dead, and also a hunt-the-object to go with your mystery ... I've never tried the DSE yet, but I know what it's about in theory.
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com
https://cherylitou.wordpress.com
Who is online
Users browsing this forum: Ahrefs [Bot], Lacha