Home   Help Search Login Register  

Author Topic: Visual effects for player?  (Read 2464 times)

0 Members and 1 Guest are viewing this topic.

Offline Suchy

  • Members
  • *
    • Synthetic Soundscapes
Visual effects for player?
« on: 31 Mar 2008, 13:37:05 »
Is there a way to make camera related effects for standard 1st person player view?
I want to make blurred vision effect when player is hurt. Any other ideas for distorted vision that would fit here?

Thanks in advance.

Offline Loyalguard

  • Former Staff
  • ****
Re: Visual effects for player?
« Reply #1 on: 31 Mar 2008, 14:13:18 »
The easiest way would be to use cutRsc to create a custom title that whites or blacks out the screen.  You could also use it to introfuce a "blur" effect custom texture possibly.

Offline Suchy

  • Members
  • *
    • Synthetic Soundscapes
Re: Visual effects for player?
« Reply #2 on: 31 Mar 2008, 14:22:58 »
I tried the white-out effect, but it's not really what I need. I wan't it to last longer, simulating that the player has problems focusing his eyes... Repeating white flashes kinda suck for this. How can it be done with a texture? I've found some info on making the vision change color, but blur? Also if it could be done the same way as with the camera, I could make the blur dynamic by randomly changing the parameters in a loop. Might look nice I guess, just no idea if it's even possible.
« Last Edit: 31 Mar 2008, 14:48:38 by Suchy »

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Visual effects for player?
« Reply #3 on: 01 Apr 2008, 02:58:43 »
You might try setvelocity on the player to jolt him a little.  This would simulate impact throwing off your aim.  You could get his current velocity and then tweak it a tad.
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Visual effects for player?
« Reply #4 on: 01 Apr 2008, 08:01:14 »
The blurred view -could- be simulated with camSetFocus, however I think that command only ever works on your own created cameras (unless you manage to find the default camera or something, i guess? :D) - and also it'd only work on computers with post processing set to high or very high. While we're on the topic of creating an external camera, you could use something like setVectorDirAndUp to make the camera shake in all three axises. Don't know if it'd be any use on just your normal average Joe (would probably look cr-a-hazy from an outside view :D).

Other than that I'm sure you've noticed the setAperture command which might be able to provide some more inspired "blinking" (everything getting a washed-out look à la Saving Private Ryan for instance) and from the sound side the fadeSound command (perhaps accompanied by some kind of heart-beat sound or a ringing in the ear etc). And finally, yes : making a custom resource that overlays your screen in intervals.

Good luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Suchy

  • Members
  • *
    • Synthetic Soundscapes
Re: Visual effects for player?
« Reply #5 on: 01 Apr 2008, 10:49:45 »
Thanks for suggestions :)
I did it with setAperture, but it still doesn't really fit as a long-term effect.
I thought about a few textures similiar to dirty glasses of binoculars (but less transparent) that would fade one to another in a loop.
Where can I find that binoculars texture as a reference? I've never done anything .paa related, so I have no idea which channel does what.
« Last Edit: 01 Apr 2008, 13:09:53 by Suchy »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Visual effects for player?
« Reply #6 on: 01 Apr 2008, 13:07:46 »
Eep. For the binocular-resource you'll have to get someone more texture savvy to help you. I just lately figured (finally) out how to get transparent backgrounds on my .paa's, so I probably won't be able to help you with anything more advanced (such as semi-transparency, which is what you want, yes?). With any luck there might be some tutorials floating around someplace, or if not, you might have to learn how to use your local image-editing software (such as Photoshop). I understand the .tga format (that at least Photoshop can use by default) is openable by texview, allowing you to convert it to .paa.

From the weapons.pbo I produced the following, called opt_default_ca.paa. Maybe you can use it as a starting point. :)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Suchy

  • Members
  • *
    • Synthetic Soundscapes
Re: Visual effects for player?
« Reply #7 on: 01 Apr 2008, 13:10:24 »
Thanks a lot, I'll check it when I get back from work. I have this nice Kegetys' Photoshop plugin to read/write .paa files, just gotta figure out that transparency stuff.
Another question: how can I call cutRsc/setAperture for a specific player only?
« Last Edit: 01 Apr 2008, 13:15:51 by Suchy »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Visual effects for player?
« Reply #8 on: 01 Apr 2008, 13:35:25 »
I'll go out on a limb and say that both setAperture and cutRsc are entirely local, meaning only the player you want to have it will have it. But that's MP-editing already, and belongs in another forum ;)

Also : I've got Kegetys' .paa plugin too, but it doesn't really do anything for me. It was part of the frustration in getting .paa's to work properly : it didn't show transparency as it should've. I suggest downloading TexView 2 and using that to convert .tga files to .paa instead of trying to directly edit and save as .paa. :)

Good luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Suchy

  • Members
  • *
    • Synthetic Soundscapes
Re: Visual effects for player?
« Reply #9 on: 03 Apr 2008, 20:29:20 »
Okies, so I made the texture to test transparency, but now a n00b question comes :)
I'm packing the .paa file into a pbo, but what do I write in the config.cpp file to make it work from cutRsc?

EDIT:
Nevermind, I found how to do it with description.ext
« Last Edit: 03 Apr 2008, 21:27:13 by Suchy »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Visual effects for player?
« Reply #10 on: 03 Apr 2008, 21:31:00 »
I'm no good with resources either, but when I created my own "mute icon" in Piper Warrior Tour Guide, I used something like this:

Code: [Select]
class RscTitles
{


class YourResource
{
    idd = -1;
    movingEnable = false;
    duration = 10000;
    fadein = 0;
    fadeout = 0;
    name = "Visual 1";
    controls[] =   {your_resource};
class your_resource
{
x = 0.80;
y = 0.20;
w = 0.07;
h = 0.07;
type = 0;
idc = -1;
style = 48;
colorBackground[] = {0, 0, 0, 0};
colorText[] = {1, 1, 1, 1};
font = BitStream;
sizeEx = 0;
lineSpacing = 0;
access = ReadAndWrite;
text = "visual1.paa";
};
};
};


Not tested, but it should work. Note you need to mess around with stuff like x, y and w/h. Then again, if you make the W and H something like 3 and 1, they -should- cover the whole screen no sweat, even widescreens. Maybe. :) Ask one of the rsc-experts instead!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Suchy

  • Members
  • *
    • Synthetic Soundscapes
Re: Visual effects for player?
« Reply #11 on: 03 Apr 2008, 22:10:06 »
I did it this way
Code: [Select]
class RscPicture
{
   type =0;
   idc = -1;
   style =48;
   colorBackground[] = {0, 0, 0, 0};
   colorText[] = {1, 1, 1, 1};
   font = "Zeppelin32";
   size = 0;
};
 
class RscTitles
{
   class DamageVisual1
     {
      name = "visual1";
      duration = 1;
      idd = -1;
      movingEnable = 0;
      controls[]={visual1};
           
      class visual1: RscPicture
      {
sizeEx=1;
         text="visual1.paa";
         x=-0.25; y=0; w=1.5; h=1;
      };
   };
};
Had to use w=1.5 and x=-0.25 to fit on wide screen.

Offline Captain

  • Members
  • *
Re: Visual effects for player?
« Reply #12 on: 04 Apr 2008, 14:18:04 »
Can we get a screen shot of the damage/blur effect you're making?

Offline Suchy

  • Members
  • *
    • Synthetic Soundscapes
Re: Visual effects for player?
« Reply #13 on: 04 Apr 2008, 16:18:42 »
Sure, when I'll make it look correct. Currently I'm experimenting with transparency and stuff and seems I'm on the right way.

Edit:
The transparency is actually very easy. In RGB chanel you draw whatever you want and set transparency in Alpha channel using grayscale colors. The brighter the color is in Alpha channel, the less transparent is the image in this place. And completely black color in alpha makes it fully transparent. Here's a screenshot and example tga file. Now gotta work on a propper damage visual.

« Last Edit: 20 Aug 2009, 19:11:37 by hoz »