Author Topic: Damageless (both player, vehicle and brick) camera-shaking explosions  (Read 1453 times)

I'm in need of some event-spawned explosions for my Star Trek ship project. Basically like the Test explosions but that don't do brick or player or vehicle damage, and also come in a variety of different camera shaking intensities and effect radiuses. It would be an invisible explosion; its purpose though would be to shake the player's camera to help simulate the ship getting hit.

Is this possible? I feel it is and if so I imagine it wouldn't be too hard to script.

If anyone's up to the challenge, I need them in 8x, 16x, 32x and 64x stud explosion ranges for the camera shaking, and I want the camera shaking to not be too intense at the center of each. Is this doable?

Weapons with camera shake recoil do this.

There's an event for camera shake called quake or something like that. It lets you spawn a projectile called a quake.
It does everything you described.

those are interesting, but they won't work for what I need. I need harmless invisible camera shaking explosions triggerable by events.

I meant to say event_impulse.

its literally what you just said. you make an event for it, set it to spawn the explosion, and you have a camera shake like that. The size of the explosion is controllable.

edit: just use it already. it satisfies your needs

again that isn't what i need. i need one where both the range and the intensity of the explosion are configurable independently. with this one its just one slider and it has a very short range.

again that isn't what i need. i need one where both the range and the intensity of the explosion are configurable independently. with this one its just one slider and it has a very short range.
you cant do this; this data is encoded into the datablock itself. the closest you can get to it is having multiple explosion datablocks of varying intensity, so you can modify the size on that

you cant do this; this data is encoded into the datablock itself. the closest you can get to it is having multiple explosion datablocks of varying intensity, so you can modify the size on that
That would work well.

This is what you need. Though, I think it will only spawn 'explosions' from bricks.

This is what you need. Though, I think it will only spawn 'explosions' from bricks.
That was the same thing Subject linked earlier and it's not what I need. It doesnt have a large radius available.


boo on Conan for making it sound impossible to use

You can't have a slider to adjust it in-game, but you can adjust it until it's what you want, and very easily change it yourself

take that explosion_impulse, unzip it and put it in your add-ons

now all you have to do is adjust the explosion datablock's values until it does what you want


So, load up the game, and you use console to type things like impulseExplosion.camShakeRadius = 50;
you keep changing the values mentioned in the script until it's doing what you want it to do.

When you're done messing around with it, if you've lost track of what you've done so far, you can type impulseExplosion.dump();, scroll up until you see "Member Fields" and the console will show you all the values it currently has. (It will show you a lot of default values which you don't need to write in; just look for the values that you've changed)

Copy all the values you've changed back into the datablock file, and save it.



if you haven't read it already, the script is super readable:

Code: [Select]
datablock ExplosionData(impulseExplosion)
{
   //explosionShape = "";

   explosionScale = "1 1 1";
  
   // does the camera shake
   shakeCamera = true;
  
   // how often does the camera shake
   camShakeFreq = "1.0 1.0 1.0";
  
   // how hard does the camera shake
   camShakeAmp = "0.4 0.4 0.4";
  
   // how long does it last in bed
   camShakeDuration = 0.5;
  
   // how far does the shake go
   camShakeRadius = 20.0;

   // make it so it doesn't forget brothers up when used
   damageRadius = 0;
   radiusDamage = 0;

// don't send people flying and stuff that's annoying
   impulseRadius = 0;
   impulseForce = 0;
};

// make a projectile because you can't spawn an explosion on it's own
datablock ProjectileData(impulseProjectile)
{
   explosion = impulseExplosion;
   uiName = "Impulse";
};

Increase camShakeRadius to make it reach farther
camShakeDuration to make it last longer
camShakeFreq to make it shakier

If you want to make more datablocks, just copy the whole thing, paste it below in the same file, rename the datablock names and uiName to something else, and add the values you want.

It's super simple entry-level stuff. Just gotta know it's possible.

Code: [Select]
datablock ExplosionData(largeImpulseExplosion : impulseExplosion)  //this copies every attribute of impulseExplosion unless they're redefined below
{
   camShakeRadius = 1000.0; //more or less shakes everyone who is in visible range of the brick it spawns from
   camShakeFreq = "10 10 10"; //make the shake shakier
   camShakeDuration = 5; //shake it up for a whole five seconds
};

datablock ProjectileData(largeImpulseProjectile)
{
   explosion = largeImpulseExplosion;
   uiName = "Impulse - large";
};
« Last Edit: April 18, 2016, 07:22:34 PM by Teneksi »

thing is, he wants a damage slider so he can use different-sized effects depending on what happens in the RP/game.

yes, he can tweak the value ingame, and transmit datablocks, but that would break up gameflow and interrupt chat with "Transmitting Datablocks..."

He's trying to make a Star Trek Enterprise bridge simulator, not tweak explosion impulse values.

Planr, if you want help designing the datablocks to be exactly what you want, either get magus to PM me when you come online or add me on steam (Conan Buchanan), or join my server whenever its up.

He's trying to make a Star Trek Enterprise bridge simulator, not tweak explosion impulse values.
He needs "camera-shaking explosions" which are tailored to his needs. So, he needs to know how to tailor such explosions to his needs, not be told that his initial idea won't work.

Basically I just need a mod with multiple such impulse explosions in different radius ranges and intensities. So say a 64stud radius explosion with low camera shaking intensity, one with higher intensity, then a 32x radius one, etc etc.

The important explosion size radius I need though is a 256stud radius one, as my ship is quite large and I want the explosion to be equally felt regardless of where you are on the ship.