TML233 / UndertaleEngine

An UNDERTALE fangame engine.
MIT License
105 stars 76 forks source link

shaker #148

Closed EMpustSamE closed 1 month ago

EMpustSamE commented 1 month ago

i tried to use shaker for my logo room but whatever i do it doesn't work what should i do

SheepYhangCN commented 1 month ago

Can you show your code here?

EMpustSamE commented 1 month ago

here's my code: sh=instance_create_depth(0,0,0,shaker); sh.target=id; sh.var_name="logo_x"; sh.shake_distance=100; sh.shake_speed=100; sh.shake_decrease=0; sh._shake_time=1080;

SheepYhangCN commented 1 month ago

shake_speed might be too high, try to change it to about 5-10?

EMpustSamE commented 1 month ago

emm...it still doens't work the "logo_x" variable is for draw event does that matter?

EMpustSamE commented 1 month ago

gosh i found the problem i changed "shake_time" to 0 and it worked but here's another problem why the "shake_time" works as "delay"?

SheepYhangCN commented 1 month ago

welp, variables begin with _ shouldn't be used manually Since shaker was not made by me and I didn't check its code, I don't know how it actually work

EMpustSamE commented 1 month ago

i know and i set it to 1080 for the music but it works after 1080 frames can you tell me why?

SheepYhangCN commented 1 month ago

shaker should keep working until instance_destroy since shake_decrease was set to 0 If shake_decrease is not 0, then it will destroy itself when distance decreased to 0 The _shake_time should be actually delay

EMpustSamE commented 1 month ago

god it works thanks a lot

SheepYhangCN commented 1 month ago

If no further problems, I'm gonna close this issue Re-open is welcome any time.