Character shake not screen [Solved]
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.
- XxrenxX
- Veteran
- Posts: 267
- Joined: Tue Oct 02, 2012 2:40 am
- Projects: Chasing
- Deviantart: bara-ettie
- Location: Canada
- Contact:
Character shake not screen [Solved]
Is there a simple code for this? I only want a certain character sprite to shake, as if being hit, not the screen or other characters. Thanks.
Last edited by XxrenxX on Sun Feb 17, 2013 4:45 pm, edited 1 time in total.
- Chrizine
- Regular
- Posts: 178
- Joined: Fri Nov 26, 2010 1:47 pm
- Projects: Perios - Chained Sorceress (WIP), Sword vs. Staff (WIP)
- Organization: Motdl Productions
- Location: Currently Switzerland
- Contact:
Re: Character shake not screen
That's exactly the problem I am facing at the moment, too... Let's hope for a reply, if i figure something out, I'll post it here. I tried around with vpunch, but it seems you can't apply it to single objects, it is always shaking the screen.
Take a look at Perios - Chained Sorceress!
And also on Sword vs. Staff, my short new project...
And, of course, our blog!
Honest Critique
And also on Sword vs. Staff, my short new project...
And, of course, our blog!
Honest Critique
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: Character shake not screen
It's not hard with ATL. It's simple or not is depends on you.
If you decide to learn ATL, it's easy. If not, it's hard.
If you decide to learn ATL, it's easy. If not, it's hard.
- Chrizine
- Regular
- Posts: 178
- Joined: Fri Nov 26, 2010 1:47 pm
- Projects: Perios - Chained Sorceress (WIP), Sword vs. Staff (WIP)
- Organization: Motdl Productions
- Location: Currently Switzerland
- Contact:
Re: Character shake not screen
I guess the code in this thread could be helpful: http://lemmasoft.renai.us/forums/viewto ... ransitions
Maybe if one added a layers argument (as seen here: http://www.renpy.org/doc/html/transitions.html), this would serve our purpose? The problem is, I don't know what to put as layers.
Maybe if one added a layers argument (as seen here: http://www.renpy.org/doc/html/transitions.html), this would serve our purpose? The problem is, I don't know what to put as layers.
Take a look at Perios - Chained Sorceress!
And also on Sword vs. Staff, my short new project...
And, of course, our blog!
Honest Critique
And also on Sword vs. Staff, my short new project...
And, of course, our blog!
Honest Critique
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: Character shake not screen
renpy.layer_at_list(at_list, layer='master') moves layers. I'm using it, but it's far from simple. If you want, I can post my codes but I don't know it's understandable easily. I think just use ATL on one sprite is easier than using MoveFunction.
- Chrizine
- Regular
- Posts: 178
- Joined: Fri Nov 26, 2010 1:47 pm
- Projects: Perios - Chained Sorceress (WIP), Sword vs. Staff (WIP)
- Organization: Motdl Productions
- Location: Currently Switzerland
- Contact:
Re: Character shake not screen
It's always worth a try. I'd like to see your code!
Take a look at Perios - Chained Sorceress!
And also on Sword vs. Staff, my short new project...
And, of course, our blog!
Honest Critique
And also on Sword vs. Staff, my short new project...
And, of course, our blog!
Honest Critique
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: Character shake not screen
define transform first,
to use in one character,
and layers,
But there are some difficulties (or bugs?) in layer.at_list, so you need some more codes to work it well.
Code: Select all
transform shake:
ease .06 yoffset 24
ease .06 yoffset -24
ease .05 yoffset 20
ease .05 yoffset -20
ease .04 yoffset 16
ease .04 yoffset -16
ease .03 yoffset 12
ease .03 yoffset -12
ease .02 yoffset 8
ease .02 yoffset -8
ease .01 yoffset 4
ease .01 yoffset -4
ease .01 yoffset 0
Code: Select all
show char at shake
Code: Select all
$renpy.layer.at_list(shake, "master")
- Chrizine
- Regular
- Posts: 178
- Joined: Fri Nov 26, 2010 1:47 pm
- Projects: Perios - Chained Sorceress (WIP), Sword vs. Staff (WIP)
- Organization: Motdl Productions
- Location: Currently Switzerland
- Contact:
Re: Character shake not screen
Thank you very much! This solved it for me, and since I only need to shake one character at a time, it seems I don't even have to bother about the layers.
Take a look at Perios - Chained Sorceress!
And also on Sword vs. Staff, my short new project...
And, of course, our blog!
Honest Critique
And also on Sword vs. Staff, my short new project...
And, of course, our blog!
Honest Critique
- XxrenxX
- Veteran
- Posts: 267
- Joined: Tue Oct 02, 2012 2:40 am
- Projects: Chasing
- Deviantart: bara-ettie
- Location: Canada
- Contact:
Re: Character shake not screen
I just need to tweak it a bit to make it how i want but it works exactly how I want so far. Thanks!
Re: Character shake not screen
nyaatrap wrote:define transform first,to use in one character,Code: Select all
transform shake: ease .06 yoffset 24 ease .06 yoffset -24 ease .05 yoffset 20 ease .05 yoffset -20 ease .04 yoffset 16 ease .04 yoffset -16 ease .03 yoffset 12 ease .03 yoffset -12 ease .02 yoffset 8 ease .02 yoffset -8 ease .01 yoffset 4 ease .01 yoffset -4 ease .01 yoffset 0
and layers,Code: Select all
show char at shake
But there are some difficulties (or bugs?) in layer.at_list, so you need some more codes to work it well.Code: Select all
$renpy.layer.at_list(shake, "master")
Thank you, this code is very helpful.
I've played some of your games, like "Astraea Rio" and "Avatar Akari", and I was wondering if you could provide the code you use to make a character dissolve and pan onto or off of the screen.
Any help you could provide would really be appreciated.
Keep up the good work ^_^
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: Character shake not screen [Solved]
If you downloaded them, then you can see the codes in their game folder. Though, I don't want to past those old codes because those transforms were written without arguments. I didn't know transforms can take arguments at that time. I'm start making new ones for the next game which uses transforms with arguments. They would be like:
Code: Select all
transform movein_from_right(xposition=0.5, zoomlevel=1.0):
alpha .0 align (.5,.5) xoffset 128 xpos xposition ypos .5 zoom zoomlevel
ease .5 alpha 1.0 xoffset 0
Code: Select all
show character1 at movein_from_right(.7,.65)
- saguaro
- Miko-Class Veteran
- Posts: 560
- Joined: Sun Feb 12, 2012 9:17 am
- Completed: Locked-In, Sunrise, The Censor
- Organization: Lucky Special Games
- itch: saguarofoo
- Location: USA
- Contact:
Re: Character shake not screen [Solved]
I didn't know transforms could take an argument. Thank you for that.
Re: Character shake not screen [Solved]
Thank you.nyaatrap wrote:If you downloaded them, then you can see the codes in their game folder. Though, I don't want to past those old codes because those transforms were written without arguments. I didn't know transforms can take arguments at that time. I'm start making new ones for the next game which uses transforms with arguments. They would be like:Code: Select all
transform movein_from_right(xposition=0.5, zoomlevel=1.0): alpha .0 align (.5,.5) xoffset 128 xpos xposition ypos .5 zoom zoomlevel ease .5 alpha 1.0 xoffset 0
Code: Select all
show character1 at movein_from_right(.7,.65)
I knew about being able to access the code in your game beforehand. The problem is that I'm still fairly new to coding so I couldn't understand most of it.
XP
Re: Character shake not screen [Solved]
I know this is solved, but I'm new and I want to know how to define a transformation? Like I tried searching it up, but i'm confused. how do I place this is my script?
define transform first,
Code:
transform shake:
ease .06 yoffset 24
ease .06 yoffset -24
ease .05 yoffset 20
ease .05 yoffset -20
ease .04 yoffset 16
ease .04 yoffset -16
ease .03 yoffset 12
ease .03 yoffset -12
ease .02 yoffset 8
ease .02 yoffset -8
ease .01 yoffset 4
ease .01 yoffset -4
ease .01 yoffset 0
to use in one character,
Code:
show char at shake
define transform first,
Code:
transform shake:
ease .06 yoffset 24
ease .06 yoffset -24
ease .05 yoffset 20
ease .05 yoffset -20
ease .04 yoffset 16
ease .04 yoffset -16
ease .03 yoffset 12
ease .03 yoffset -12
ease .02 yoffset 8
ease .02 yoffset -8
ease .01 yoffset 4
ease .01 yoffset -4
ease .01 yoffset 0
to use in one character,
Code:
show char at shake
- Donmai
- Eileen-Class Veteran
- Posts: 1958
- Joined: Sun Jun 10, 2012 1:45 am
- Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
- Projects: Slumberland
- Location: Brazil
- Contact:
Re: Character shake not screen [Solved]
You should read the quickstart, lowkey. And play through the tutorial game, and study the script of The Question. You can find the quickstart here: http://www.renpy.org/doc/html/quickstart.html
To better answer your question, you can put that transform definition anywhere. Most people put it at the start of the 'script.rpy' file. Or you can create a new 'transforms.rpy' file and put it there.
To use that transform on a sprite you just do as suggested, at the moment of showing that sprite.
Try this: run Ren'py and load 'The Question'. On the launcher screen, click on 'Navigate Script'. On the 'Category' list, make sure the files tab is selected. Click on the '+Add Script File' button. Type transforms.rpy and press the return key. A 'transforms.rpy' will be added to the current project. Highlight the text of the shake transform definition and paste it on the 'transforms.rpy' file. Make sure it looks like this:Save that file.
Now edit the 'script.rpy' file of The Question. Navigate to line 89. ChangetoSave the file.
Now play the game (choose 'ask her right away'). Keep playing. You will see that Sylvie will "tremble" with surprise when she hear the question.
To better answer your question, you can put that transform definition anywhere. Most people put it at the start of the 'script.rpy' file. Or you can create a new 'transforms.rpy' file and put it there.
To use that transform on a sprite you just do as suggested, at the moment of showing that sprite.
Try this: run Ren'py and load 'The Question'. On the launcher screen, click on 'Navigate Script'. On the 'Category' list, make sure the files tab is selected. Click on the '+Add Script File' button. Type transforms.rpy and press the return key. A 'transforms.rpy' will be added to the current project. Highlight the text of the shake transform definition and paste it on the 'transforms.rpy' file. Make sure it looks like this:
Code: Select all
transform shake:
ease .06 yoffset 24
ease .06 yoffset -24
ease .05 yoffset 20
ease .05 yoffset -20
ease .04 yoffset 16
ease .04 yoffset -16
ease .03 yoffset 12
ease .03 yoffset -12
ease .02 yoffset 8
ease .02 yoffset -8
ease .01 yoffset 4
ease .01 yoffset -4
ease .01 yoffset 0
Now edit the 'script.rpy' file of The Question. Navigate to line 89. Change
Code: Select all
show sylvie surprised
Code: Select all
show sylvie surprised at shake, center
Now play the game (choose 'ask her right away'). Keep playing. You will see that Sylvie will "tremble" with surprise when she hear the question.
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)
TOIRE NO HANAKO (A Story About Fear)
Who is online
Users browsing this forum: Ahrefs [Bot]