Author Topic: Blackout Script  (Read 6192 times)

0 Members and 1 Guest are viewing this topic.

Offline Avkon

  • Soldier
  • **
  • Posts: 136
  • Ah, whatever.
Blackout Script
« on: July 25, 2007, 05:54:46 am »
This is a really, really, really small script, and it's effect is to cause a 'blackout' for any specified player.

Here's the code:

Code: [Select]
if (StrPos('/blackout', Text) > 0) then begin
  DrawText(ID,'||',90,RGB(0,0,0),40,-2500,-500);
end;

Stick this into the OnCommand procedure, and anyone who types '/blackout' will be blinded temporarily, i.e. his/her screen goes black for sometime.
Of course, no one is going to type it themselves, but you can use this as some kind of 'skill' gained by a player, or the like usually found in RPG-modded servers.

Also, to create a blindflash instead of a blackout, edit:

Code: [Select]
RGB(0,0,0)
To:

Code: [Select]
RGB(255,255,255)
That's it! You can also change the RGB colors to anything you want.

To change the amount of time the player is blinded, edit:

Code: [Select]
90
To anything you want.
I've found 90, 125, and 165 work the best for me - they're long enough to have an effect, and short enough not to be annoying.

Enjoy! :)

Offline Flacid Assassin

  • Camper
  • ***
  • Posts: 450
  • Gorby The Grunt
Re: Blackout Script
« Reply #1 on: July 25, 2007, 06:03:16 am »
thats pretty cool, put in server and tell people to do it they will freak out haha

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: Blackout Script
« Reply #2 on: July 25, 2007, 08:46:27 am »
Doesn't it get messed up with different screen modes?!
Few things:
1) If a cap/kill message occurs while you're supposed to be blinded, the "black out" goes away.  Therefore make it be so that you create many short blackouts.
2) For an even better effect make the procedure be called like this:
BlackOut(color: Single; blacktime, fadetime: Byte);  //example:  Blackout($C0FF00FF, 3, 4);

Then read the transparency (using bitwise AND or subtracting its mod of a number) and decrease it linearly to 0 over the specified time.  This will create a fading blackout that's stays 75% (C0 = 75%) purple for the first 3 seconds and then it'll fade to visible again over the next 4 seconds.

If you want a blackout that's black for the first 5 seconds and then fades away slowly you would use:
BlackOut($FF000000, 5, 7);  // (I think FF = not transparent though it might be 00)
This creates a black screen for 5 seconds and then fades constantly over the next 7.

Also I think you should use #219 instead of || since #219 is a solid, full-sized block-character.
Can't think of anything original to put here...

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Blackout Script
« Reply #3 on: July 25, 2007, 10:52:26 am »
My font is set to Arial and this seems to not work with that font. :(
i changed the '||' to Chr(219) and that doesn't work for Arial neither.

So I guess this is meant for people with default font? :)

Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Personal
Re: Blackout Script
« Reply #4 on: July 25, 2007, 11:00:41 am »
Yes, doesnt work with other fonts.
Co-Founder / CTO @ Macellan
Founder Turkish Soldat Community

Offline Avkon

  • Soldier
  • **
  • Posts: 136
  • Ah, whatever.
Re: Blackout Script
« Reply #5 on: July 27, 2007, 03:42:08 pm »
Hmm.. xyzstand, those are some really food ideas, but I'm not going to be doing any more scripting till my vacation's over, but thanks anyway, I'll see if I can get the time to do it.

Offline Master Chief43

  • Soldier
  • **
  • Posts: 224
  • When life gives you lemons, eat them :D
Re: Blackout Script
« Reply #6 on: July 27, 2007, 06:56:17 pm »
Hm... When the screen goes from blackout to normal, does it fade away of just goes back to normal in a flash?
In-Game Name: "Master Chief43"
Favorite Map: ctf_Ash
Favorite Mods: Special Operation 2.0, Original Soldier 1.9
Favorite Guns: [MP5][AK74][socom][Barret]

Offline Avkon

  • Soldier
  • **
  • Posts: 136
  • Ah, whatever.
Re: Blackout Script
« Reply #7 on: July 28, 2007, 12:10:05 am »
It fades away, but goes out in a flash if there's another DrawText event like how xyzstand said.

Offline Master Chief43

  • Soldier
  • **
  • Posts: 224
  • When life gives you lemons, eat them :D
Re: Blackout Script
« Reply #8 on: July 28, 2007, 12:23:56 am »
uh... Can you put this into PlayerDamage so every time someone gets hurt, screen will turn red? Also, can you make it transparent so you can still see alittle?
In-Game Name: "Master Chief43"
Favorite Map: ctf_Ash
Favorite Mods: Special Operation 2.0, Original Soldier 1.9
Favorite Guns: [MP5][AK74][socom][Barret]

Offline Avkon

  • Soldier
  • **
  • Posts: 136
  • Ah, whatever.
Re: Blackout Script
« Reply #9 on: July 28, 2007, 02:48:18 am »
Uhh... read my last post. :p

Offline Dizzy So 1337

  • Soldier
  • **
  • Posts: 246
Re: Blackout Script
« Reply #10 on: August 02, 2007, 12:54:32 am »
... once someone figures out how to make working flashbangs with this puppy, the CS crowd is gonna go nuts :)
xfire - todhostetler
"There's nothing I wouldn't do to win. But I never hurt anyone except to stick a dogskull on a stake."

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Blackout Script
« Reply #11 on: August 02, 2007, 07:05:38 pm »
... once someone figures out how to make working flashbangs with this puppy, the CS crowd is gonna go nuts :)
would be perfect with RayCast to check if the flash's blind hits the person! Should be a way to get a grenade's X,Y... :( like when it explodes, would be cool.

Offline Tosty

  • Soldier
  • **
  • Posts: 172
  • Ultimate TW Medic
    • Just Click it
Re: Blackout Script
« Reply #12 on: August 03, 2007, 02:06:32 am »
Could someone make this so that it happens on another persons screen then post it here??



Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Blackout Script
« Reply #13 on: August 04, 2007, 06:13:14 am »
Thats a cool script