Aller au contenu

EffectScreenShake


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
Guest_dewkl_*

Guest_dewkl_*
  • Guests
I was looking for a screen shake effect and I found this function. It takes an integer as parameter. I've tried values 0, 1 and 2 but none works.

It doesn't seem to have a wiki page either. I've checked DA Lexicon and toolset tooltip as well.

Broken?

Modifié par dewkl, 20 avril 2010 - 07:29 .


#2
Sunjammer

Sunjammer
  • Members
  • 925 messages
Shakes are defined in screenshake.xls and the following constants are declared in combat_h (so you can include that if you want some readability):
const int SCREEN_SHAKE_TYPE_DEFAULT = 1;
const int SCREEN_SHAKE_TYPE_CRITICAL_HIT = 2;
const int SCREEN_SHAKE_TYPE_OGRE_STOMP = 3;
const int SCREEN_SHAKE_TYPE_BROODMOTHER_SCREEM = 7;
const int SCREEN_SHAKE_TYPE_WILD_SYLVAN = 8;

However you could create your own as it is just a EffectScreenShake (row 6 in effects.xls) effect:
effect eEffect = Effect(6);
eEffect = SetEffectFloat(eEffect, 0, 200);   // frequency_x
eEffect = SetEffectFloat(eEffect, 1, 100);   // frequency_y
eEffect = SetEffectFloat(eEffect, 2, 0.1);   // amplitude_x 
eEffect = SetEffectFloat(eEffect, 3, 0.2);   // amplitude_y

You should be able to use it like so:
effect eShake = EffectScreenShake( SCREEN_SHAKE_TYPE_CRITICAL_HIT); 
Engine_ApplyEffectOnObject(EFFECT_DURATION_TYPE_TEMPORARY, eShake ,oTarget, 1.0, oSource);

Modifié par Sunjammer, 20 avril 2010 - 10:17 .


#3
Guest_dewkl_*

Guest_dewkl_*
  • Guests
Fantastic! Thanks a lot. In case others are interested, here's the difference between those listed;
Default: Horizontal shaking
Critical hit: Shaking (horizontal & vertical)
Ogre stomp: Vertical shaking
Broodmother: Camera bobbing
Wild Sylvan: Circling camera.

If you have a short duration the shake will be more intense (and slower if you have a longer duration).

Modifié par dewkl, 21 avril 2010 - 04:45 .


#4
Guest_dewkl_*

Guest_dewkl_*
  • Guests
Are there more screen effects like these? Not screen shake, but setting a color filter or something? Is the blurry effect in the fade an effect, or a level configuration?

Edit: I found the functions: EffectHeartbeat, Effects_HandleApplyEffectHeartbeat, Effects_HandleRemoveEffectHeartbeat, EndHeartbeat, InitHeartbeat. Trying to make these work, not sure what they are used for yet.

Modifié par dewkl, 23 avril 2010 - 03:35 .


#5
Sunjammer

Sunjammer
  • Members
  • 925 messages
The screen effects you mentioned are FrameBuffer effects. There are a few of them that you can use through scripting (and more available through cutscenes). I'm currently putting together a library and some information on them. There are a couple of examples in the SinglePlayer resources that you could use mean time.

Modifié par Sunjammer, 24 avril 2010 - 02:57 .


#6
Guest_dewkl_*

Guest_dewkl_*
  • Guests
Please tell when you've completed that library. Where should I look for these examples in the singleplayer resource?

I'm using this for a sequence where the player passes out/"dies" to some infection. It would be nice if there was a fade to black-feature to imitate the character nearly passing out. Perhaps blurring the player's vision, if that exists. Color correction?

Modifié par dewkl, 01 mai 2010 - 04:45 .


#7
II-Siamak-II

II-Siamak-II
  • Members
  • 7 messages
 Can someone please tell me where I can find the file to disable the screen shake effect please?