Screen shake on critical hits

Share your scripts and packages with other Mudlet users.
Post Reply
User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Screen shake on critical hits

Post by Vadi »

This package will do a "camera shake"-like effect when you get a critical hit! Sample video here.

Credit for screen shaking to tsuujin, I just added the triggers for it and packaged.
Attachments
crit-effects-IRE.xml
(5.29 KiB) Downloaded 684 times

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Screen shake on critical hits

Post by tsuujin »

Might want to update the video so it doesn't feature the old, non-border-accounting code.

Also, what were those couple of lines you added below variable declaration?

kaeus
Posts: 50
Joined: Thu Dec 31, 2009 4:33 pm

Re: Screen shake on critical hits

Post by kaeus »

tsuujin wrote:Might want to update the video so it doesn't feature the old, non-border-accounting code.

Also, what were those couple of lines you added below variable declaration?
Does this one account for current borders? It seemed to reset to no borders on mine.

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Screen shake on critical hits

Post by tsuujin »

you'll have to set the bTop, bBottom and bLeft variables to your current borders layout. It uses those variables to calibrate where the shaking should be focused, and to reset to the proper border at the end of the shaking.

I'm going to put a feature request in for a getBorder<side> function to alleviate this.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Screen shake on critical hits

Post by Vadi »

I'd appreciate it if you explained the theory behind this thing... did you come up with the algorithm or is it from somewhere?

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Screen shake on critical hits

Post by tsuujin »

This spot is better spent on saying:

Make sure if you use this code, you set the bTop, bBottom and bLeft variables in the function to your own values.

They should be the number of pixels from the top, bottom and left that your main text display actually starts, for example if you have graphics on the left, top or bottom of the screen that push your display out of the way.
Last edited by tsuujin on Sun Aug 22, 2010 6:30 am, edited 1 time in total.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Screen shake on critical hits

Post by Vadi »

Ah I see.

I was just curious as to how it worked heh.

Post Reply