How can I start an animation in Renpy with mouse click? An example code please?

estatistics

New Member
Mar 7, 2019
9
2
Hello there,

I am a newbie to Ren Py, I am trying to learn Ren py in order to built a game.

My questions:
a) How can I start an animation in Renpy with mouse click? An example code please?
b) How can I move a character with mouse around the screen ?
c) Can I set easily a "color path" like that in Adventure Game Studio ?
 

f95zoneuser463

Member
Game Developer
Aug 14, 2017
219
1,021
Assuming my guess is correct, that you are trying to create a point-and-click game, you will have a VERY hard time to do this in Ren'Py. Possible? Yes. Easy? No! In this case you'd probably be better off using a dedicated engine for a point-and-click game.
If my guess is wrong ignore me. ;)
 

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,272
22,422
Hello there,

I am a newbie to Ren Py, I am trying to learn Ren py in order to built a game.

My questions:
a) How can I start an animation in Renpy with mouse click? An example code please?
b) How can I move a character with mouse around the screen ?
c) Can I set easily a "color path" like that in Adventure Game Studio ?
Look for "imagemap", "imagebutton" and "ATL". There are a lot tutorials for it.
An animation does not autostart unless you code it that way, so you have to click something first anyway. If you want it to start with a click on a specific point, look for the first two things I mentioned ;)
 
  • Like
Reactions: estatistics

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,286
My questions:
Well, the problem is that each one of them have way to many interpretations. As it, the answers you can get can also be totally useless to you.
Practically speaking, it you can't describe better what you want, it's logical that you have difficulty to find a way to do it. The first and most important thing when you want to code something is to firstly know exactly what you want to achieve. Then you also have a good idea of what features/commands you'll need and so where you have to search.

Anyway, here's a try. But without full example, I'll not pass a full day explaining every single possibilities without even knowing if one of them correspond to what you where looking for.


a) How can I start an animation in Renpy with mouse click? An example code please?
"I have a VN style story and at one time, the scene is a dynamic one, but I want that it's the player that will start it.". The answer is either in a with a simple "start" the animation choice, in the basic dialog feature, with a "click when ready". Or in a with ; its action being a simple screen action.

"I have a VN style story where the scenes are static by default, but sometimes, the player can click on the background to make them dynamic while the dialog continue to play." Here again the answer in on a screen. Instead of ing a displayable or a , you show a screen that while either have a transparent that take all the screen, or a regular , that can be a simple . Add an in them and use the button to switch between each branch of the structure ; one being the static image, the other the dynamic one.

"I have some items in the background that can be animated if the player turn them on, among them there's a TV". Here, the answer is or .

@f95zoneuser463 talking about Point'n'Click add this possibility, "I have parts of the screen that will act as button, and I want them to be animated when the mouse is over them". The answer is or the hovered property of .

In addition to that, you'll need the (ATL) or the of Ren'py to make the dynamic part.


b) How can I move a character with mouse around the screen ?
Do you want to move it as in "I'll drag it from this position, then drop it in that one" ? Then look at the (almost undocumented) screen statement, or directly at the .

Or do you want it to move according to the move of the mouse ? Then, it's not totally impossible, but just forget about it.

Or do you want it to move over a map, going here or there when you click here or there ? Then you need a transparent that take all the clickable part of the screen, and that will have a custom action retrieving the mouse position and using it to accordingly change the position of the character. Easier to do than to say.


c) Can I set easily a "color path" like that in Adventure Game Studio ?
What do you mean by "color path" ?
 

estatistics

New Member
Mar 7, 2019
9
2
First of all,

Thank you very much for your answers.
I am totally newbie to Renpy.
I think i didnt explain very well my inquiries.
Sorry for my bad English.

I want to build a path, and upon that path, the "hero" can be moved, therefore, he/she will not "transpass" walls" or other "not-walking" areas.
"color path ---> I mean Walkable areas that are accessible by "drawing" a special colour on the image e.g. between trees that "shows" the possible walking area by e.g. the character.
However, these "paths" may are not only "squares" but "zig zag" e.g. moving between trees, or moving between other characters in street.

I will be interest also, by clicking with mouse, the hero to move from "A" to "B", lineary. However, dialogs must also be present e.g. the character is in a street and moving around can click to people to talk to.

I found that:
( a) I find that incredible platform - adventure - action game (!!!). - I tried to use its .

I think that I must tweak the "areas".

I have no other question currently.
I will may try these tips.

Thanks again guys.
Maybe I will need U again! :)
 
  • Like
Reactions: poplong