Ren'Py crashes when using [Animated Cursor]

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
[Admin-C]
Newbie
Posts: 12
Joined: Sat Nov 04, 2017 2:07 pm
Completed: [Confidential]
Projects: [Confidential]
Organization: Black Sakura Studio
IRC Nick: C
Skype: Admin-C.
Location: Philippines
Contact:

Ren'Py crashes when using [Animated Cursor]

#1 Post by [Admin-C] »

Hello everyone,

This will be my first post and also my first topic.

Now for the issue that I encountered, I keep experiencing some crash issues on launching the game every time I use the .ani cursor that I created. There are no error messages but the project just won't let me go into the testing phase of the game. If I try to click the "Launch Project", it will only open up a black screen for a split second and will disappear like it tried to open and close automatically. I tried to change the animated cursor into the same customized cursor but without animation (.cur) and it worked. My problem is, how am I supposed to retain the project running without crashing by using the animated cursor that I implemented into the game?

This is the code with the animated cursor.

Code: Select all

init python:
    config.mouse = { 'default' : [ ('KCTknifecursor.ani', 0, 0)]}
    gui.init(1280, 720)
This is the code without the animated cursor.

Code: Select all

init python:
    config.mouse = { 'default' : [ ('cursor/cursor (1).cur', 0, 0)]}
    gui.init(1280, 720)
PS: I haven't placed the animated cursor in the cursor folder that's why the codes are a little different.

Any help would be very much appreciated.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Ren'Py crashes when using [Animated Cursor]

#2 Post by Remix »

If you have the actual frames of the cursor you could try to see if the standard cursor animation works... (not too sure which formats are supported, so put pings in the example)

Code: Select all

define config.mouse = { 'default' : [ ('KCTknifecursor.frame1.png', 0, 0), ('KCTknifecursor.frame2.png', 0, 0), ('KCTknifecursor.frame3.png', 0, 0) ] }
init python:
    gui.init(1280, 720)
Though I cannot say for sure, it might be that Ren'py does not like the .ani format
Frameworks & Scriptlets:

User avatar
[Admin-C]
Newbie
Posts: 12
Joined: Sat Nov 04, 2017 2:07 pm
Completed: [Confidential]
Projects: [Confidential]
Organization: Black Sakura Studio
IRC Nick: C
Skype: Admin-C.
Location: Philippines
Contact:

Re: Ren'Py crashes when using [Animated Cursor]

#3 Post by [Admin-C] »

Remix wrote: Fri Nov 10, 2017 8:25 am If you have the actual frames of the cursor you could try to see if the standard cursor animation works... (not too sure which formats are supported, so put pings in the example)

Code: Select all

define config.mouse = { 'default' : [ ('KCTknifecursor.frame1.png', 0, 0), ('KCTknifecursor.frame2.png', 0, 0), ('KCTknifecursor.frame3.png', 0, 0) ] }
init python:
    gui.init(1280, 720)
Though I cannot say for sure, it might be that Ren'py does not like the .ani format
Hello Remix,

I am pleased to let you know that your advise works!

Image

After clipping the frames of my animated cursor and following the additional lines of codes that you recommended as an example, I can finally able to launch the project without crashing and the mouse is animating as it is (by frames). My next problem though is that the animation per frames is so fast that the cursor keeps animating every 0.5 seconds which is not a good sight. Do you have any advice on how to slow the transition of each frame?

This is the animation speed of the cursor that I am seeing:
Image

This is the animation speed that I want to happen:
Image

I hope you can help me out on this one. Thank you in advance!

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Ren'Py crashes when using [Animated Cursor]

#4 Post by Remix »

The backbone of cursor animation basically runs at 20Hz, so a 1 second animation cycle should contain 20 images.

I do not know if there is a way to set a duration value to particular frames, so all I can advise it to repeat the frame(s) in the define

[ ('KCTknifecursor.frame1.png', 0, 0),
('KCTknifecursor.frame1.png', 0, 0),
('KCTknifecursor.frame1.png', 0, 0),
('KCTknifecursor.frame1.png', 0, 0),
('KCTknifecursor.frame2.png', 0, 0),
('KCTknifecursor.frame2.png', 0, 0),
('KCTknifecursor.frame2.png', 0, 0),
('KCTknifecursor.frame2.png', 0, 0),
('KCTknifecursor.frame3.png', 0, 0),
('KCTknifecursor.frame3.png', 0, 0),
('KCTknifecursor.frame3.png', 0, 0),
('KCTknifecursor.frame3.png', 0, 0) ] # etc

You might get away with list comprehension to make it shorter code wise...
[ ('KCTknifecursor.frame1.png', 0, 0) for k in range(5) ] + [ ('KCTknifecursor.frame2.png', 0, 0) for k in range(5) ] # etc
Frameworks & Scriptlets:

User avatar
[Admin-C]
Newbie
Posts: 12
Joined: Sat Nov 04, 2017 2:07 pm
Completed: [Confidential]
Projects: [Confidential]
Organization: Black Sakura Studio
IRC Nick: C
Skype: Admin-C.
Location: Philippines
Contact:

Re: Ren'Py crashes when using [Animated Cursor]

#5 Post by [Admin-C] »

Remix wrote: Fri Nov 10, 2017 11:28 am The backbone of cursor animation basically runs at 20Hz, so a 1 second animation cycle should contain 20 images.

I do not know if there is a way to set a duration value to particular frames, so all I can advise it to repeat the frame(s) in the define

[ ('KCTknifecursor.frame1.png', 0, 0),
('KCTknifecursor.frame1.png', 0, 0),
('KCTknifecursor.frame1.png', 0, 0),
('KCTknifecursor.frame1.png', 0, 0),
('KCTknifecursor.frame2.png', 0, 0),
('KCTknifecursor.frame2.png', 0, 0),
('KCTknifecursor.frame2.png', 0, 0),
('KCTknifecursor.frame2.png', 0, 0),
('KCTknifecursor.frame3.png', 0, 0),
('KCTknifecursor.frame3.png', 0, 0),
('KCTknifecursor.frame3.png', 0, 0),
('KCTknifecursor.frame3.png', 0, 0) ] # etc

You might get away with list comprehension to make it shorter code wise...
[ ('KCTknifecursor.frame1.png', 0, 0) for k in range(5) ] + [ ('KCTknifecursor.frame2.png', 0, 0) for k in range(5) ] # etc
Greetings Remix,

Absolutely amazing!

I applied your methods to my script and the cursor is now animating at its own phase just like what I have imagined. So far, no issues with the codings.

I'll be sharing my script on this topic should people encountered the same problem as I did.

Code: Select all

init python:
    config.mouse = { 'default' : [ ('cursor/KCTknifecursor.png', 0, 0) for k in range(5) ] + [('cursor/KCTknifecursor2.png', 0, 0) for k in range(5) ] + [('cursor/KCTknifecursor3.png', 0, 0)for k in range(5) ] + [('cursor/KCTknifecursor4.png', 0, 0) for k in range(5) ] + [('cursor/KCTknifecursor5.png', 0, 0) for k in range(5) ] + [('cursor/KCTknifecursor6.png', 0, 0) for k in range(5) ] + [('cursor/KCTknifecursor7.png', 0, 0) ]}
    gui.init(1280, 720)
I guess this is everything I needed for this topic. Once again, thank you for your big help!

Regards,

Post Reply

Who is online

Users browsing this forum: piinkpuddiin