How to make an exclamation mark dance over someone's head?

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
zeroTheHero
Regular
Posts: 64
Joined: Mon May 07, 2018 10:49 am
Contact:

How to make an exclamation mark dance over someone's head?

#1 Post by zeroTheHero »

You've probably seen the exclamation mark or the sweat drop on a character's head, how do you code for it in ATL?
What I'm doing for the exclamation mark:

Code: Select all

transform shake:
    on show:
    	xalign 0.4 yalign 0.4
        linear 0.4 rotate -15
        linear 0.6 rotate 15
        linear 0.3 rotate -8
        linear 0.5 rotate 5
        linear 0.2 rotate 0
    
    on hide:
        fadeout(0.3)
...
label start:
	show e  onlayer screens
	show exclamation at truecenter onlayer screens with shake 
I get this error:
Exception: Parameter 'new_widget' is not known by ATL Transform.
Help? Also, any tips on making this ATL better? Is there some way I can anchor the top half so only the bottom half of the exclamation moves and shakes?
Thanks!

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: How to make an exclamation mark dance over someone's head?

#2 Post by Imperf3kt »

you have an extra space on the first line between e and onlayer. Not sure if this will matter

Code: Select all

    show e  onlayer screens
Are you using tabulation instead of four spaces?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

zeroTheHero
Regular
Posts: 64
Joined: Mon May 07, 2018 10:49 am
Contact:

Re: How to make an exclamation mark dance over someone's head?

#3 Post by zeroTheHero »

Imperf3kt wrote: Sun Feb 10, 2019 5:53 am you have an extra space on the first line between e and onlayer. Not sure if this will matter

Code: Select all

    show e  onlayer screens
Are you using tabulation instead of four spaces?
nope, my sublime text editor is set to spaces, and I don't think those spaces matter cuz the code runs when I remove the transform

zeroTheHero
Regular
Posts: 64
Joined: Mon May 07, 2018 10:49 am
Contact:

Re: How to make an exclamation mark dance over someone's head?

#4 Post by zeroTheHero »

I'm copying the entire error message here cuz it'd make more sense to you guys

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 149, in script
    show image1 at truecenter onlayer over_screens with shake
Exception: Parameter 'new_widget' is not known by ATL Transform.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 149, in script
    show image1 at truecenter onlayer over_screens with shake
  File "C:\Users\newmiracleeveryday\Desktop\renpy-6.99.14.3-sdk\renpy\ast.py", line 1337, in execute
    renpy.exports.with_statement(trans, paired)
  File "C:\Users\newmiracleeveryday\Desktop\renpy-6.99.14.3-sdk\renpy\exports.py", line 1452, in with_statement
    return renpy.game.interface.do_with(trans, paired, clear=clear)
  File "C:\Users\newmiracleeveryday\Desktop\renpy-6.99.14.3-sdk\renpy\display\core.py", line 2207, in do_with
    clear=clear)
  File "C:\Users\newmiracleeveryday\Desktop\renpy-6.99.14.3-sdk\renpy\display\core.py", line 2649, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\newmiracleeveryday\Desktop\renpy-6.99.14.3-sdk\renpy\display\core.py", line 2986, in interact_core
    new_widget=layers_root)
  File "C:\Users\newmiracleeveryday\Desktop\renpy-6.99.14.3-sdk\renpy\atl.py", line 433, in __call__
    raise Exception('Parameter %r is not known by ATL Transform.' % k)
Exception: Parameter 'new_widget' is not known by ATL Transform.

Windows-8-6.2.9200
Ren'Py 7.0.0.196
newproj 1.0
Sun Feb 10 19:50:07 2019

User avatar
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: How to make an exclamation mark dance over someone's head?

#5 Post by Donmai »

Try

Code: Select all

	show exclamation at truecenter onlayer screens at shake
You can only use "with" with ATL transform if it's an ATL transition, that's why it is looking for the old and new widget.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

strayerror
Regular
Posts: 159
Joined: Fri Jan 04, 2019 3:44 pm
Contact:

Re: How to make an exclamation mark dance over someone's head?

#6 Post by strayerror »

Following on from Donmai's comment: I believe you'll get a syntax error if you try to use the at keyword twice on the same line, so you just need to stack them:

Code: Select all

label start:
    show e onlayer screens
    show exclamation at truecenter, shake onlayer screens
Also, as an aside, the xalign 0.4 yalign 0.4 part of shake will completely negate the use of truecenter, so depending on your intent, it may turn out that you only need:

Code: Select all

    show exclamation at shake onlayer screens

User avatar
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: How to make an exclamation mark dance over someone's head?

#7 Post by Donmai »

Thanks, strayerror.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

zeroTheHero
Regular
Posts: 64
Joined: Mon May 07, 2018 10:49 am
Contact:

Re: How to make an exclamation mark dance over someone's head?

#8 Post by zeroTheHero »

Hey, I'm so sorry for not getting back sooner, life got in the way this past week :(

@ Donmai, @ strayerror, I haven't tested out your codes yet, but reading your answers have finally made things 'click'. Thanks for taking the time to answer! Really appreciate it ^_^
I have some free time, so will try your suggestions today! Thanks again!!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]