Forum

frag flash

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

frag flash

Postby the bamph » Sun Apr 16, 2006 10:46 am

hello everyone, i've just started modifying my quake and reapers and

i was wondering if it's possible to make the screen flash green (or any color) for a fraction of a second when you frag in multiplayer (like the quick yellow flash that appears when you get an item/weapon/backpack)

i'd like to use this with the Reaperbots

it's not that important, but i think it'd be cool to have
the bamph
 
Posts: 10
Joined: Sun Apr 16, 2006 10:05 am

Postby RenegadeC » Sun Apr 16, 2006 2:40 pm

Create a view weapon of one solid color, and have it flash on screen for a second; I did this for my TAoV mod when you do a large damaging attack .. here's some code from my mod!


.float screenflash_finished;
.float screenflash_mode;

framerate = cvar("host_framerate");

//
// screen flashing seizure effect
//

if (self.screenflash_finished > time && framerate == 0)
{
if (self.screenflash_mode == FALSE)
{
self.weaponmodel = "progs/scrflash.mdl";
self.screenflash_mode = TRUE;
}
else
{
self.weaponmodel = string_null;
self.screenflash_mode = FALSE;
}
}
else if (self.screenflash_mode == TRUE || framerate != 0)
{
self.weaponmodel = string_null;
self.screenflash_mode = FALSE;
}

Now simply set: self.screenflash_finished = time + #; on the player and your screen should flash! Anyway, you may have to modify that code a tad, but this should give you an idea!
User avatar
RenegadeC
 
Posts: 391
Joined: Fri Oct 15, 2004 10:19 pm
Location: The freezing hell; Canada

Postby the bamph » Sun Apr 16, 2006 5:39 pm

hey

i have a few noob questions if you don't mind...

how can i make/where can i get a scrflash.mdl?
where do i have to insert this code? in the weapons.qc file?
the bamph
 
Posts: 10
Joined: Sun Apr 16, 2006 10:05 am

Postby Dr. Shadowborg » Sun Apr 16, 2006 6:06 pm

Alright that does it, I'm gonna make a proper tutorial regarding PROPER screenflashes using v_cshift.

EDIT: Code finished and tested. Now to write the tutorial and put it up :D I've also tested it with savegames, and it works fine, so it's all cool.
Last edited by Dr. Shadowborg on Sun Apr 16, 2006 8:24 pm, edited 1 time in total.
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Postby Error » Sun Apr 16, 2006 7:45 pm

woah, people still use Reaperbots?

FrikBotX rB all the way. Give it a go. :twisted:
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby Dr. Shadowborg » Sun Apr 16, 2006 9:06 pm

"Damn, I'm good!"

http://www.inside3d.com/showtutorial.php?id=151

That will give you everything you need. :wink:
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Postby RenegadeC » Mon Apr 17, 2006 10:17 pm

Dr. Shadowborg wrote:"Damn, I'm good!"

http://www.inside3d.com/showtutorial.php?id=151

That will give you everything you need. :wink:


Good job! I generally stay away from stuffcmd myself however yours is friendlier and does the job fine. Congrats!

I'm not newbie friendly, I like to just post code and then have people figure what to do from there .. with QuakeC it's not hard.
User avatar
RenegadeC
 
Posts: 391
Joined: Fri Oct 15, 2004 10:19 pm
Location: The freezing hell; Canada

Postby Sajt » Mon Apr 17, 2006 10:30 pm

That might blow up if you're doing multiplayer though... (not sure to what extent though)

I know that if you tried that in QW it would probably blow up :)
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Dr. Shadowborg » Tue Apr 18, 2006 4:34 pm

Sajt wrote:That might blow up if you're doing multiplayer though... (not sure to what extent though)

I know that if you tried that in QW it would probably blow up :)


Dunno. I don't really have the resources to test that kind of stuff, and besides, he never said it had to work with QW. Hell, I'm not even sure reaperbots will even work with QW.

Though... Anybody using stock QW these days probably deserves whatever happens when using this, as it quite obviously was intended for use with NQ engines. (Insert all legal crap pertaining to holding author harmless from all damages that result from using said stuff)
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Postby the bamph » Tue Apr 18, 2006 6:28 pm

Dr. Shadowborg wrote:"Damn, I'm good!"

http://www.inside3d.com/showtutorial.php?id=151

That will give you everything you need. :wink:


doesn't work with the reapers (yet)

i'll get back to you after i try some more things with it

thanks for replying everyone!
the bamph
 
Posts: 10
Joined: Sun Apr 16, 2006 10:05 am

Postby the bamph » Wed May 24, 2006 6:58 am

ok, i tried Dr. Shadowborg's tutorial a few times and no matter what i changed, i still got this error message:

Image

[noob]what can i do to fix this?[/noob]
the bamph
 
Posts: 10
Joined: Sun Apr 16, 2006 10:05 am

Postby FrikaC » Wed May 24, 2006 8:17 am

1. Stop using ProQCC

2. If problem persists (doubtful) modify the line if (head.takedamage && head.classname == "player") to if (head.takedamage && (head.classname == "player"))
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby Lardarse » Wed May 24, 2006 8:42 am

[noob]what can i do to fix this?[/noob]

Most normal QuakeC compilers will only let you pass 8 variables to a function. The Palfrom function has 9, and so the last one isn't processed properly. That might explain why it came up with a weird line number...

But I'll echo what Frik said: Stop using ProQCC. The 2 main compilers used around here both overcome many of ProQCC's weaknesses...
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Postby the bamph » Wed May 24, 2006 1:02 pm

FrikaC wrote:1. Stop using ProQCC


yeah, that was the problem... i was using ProQCC cause it never gave me errors before, so i thought it was fairly good.

i compiled the code fine with FTEQCC though

i'm also getting FrikBotX and the FrikBot for Painkeep

thanks for the replies everyone! :)
the bamph
 
Posts: 10
Joined: Sun Apr 16, 2006 10:05 am

Postby Dr. Shadowborg » Wed May 24, 2006 2:35 pm

Holy shiess, somebody still uses that outdated piece of crap that goes by the name of ProQcc?!

Well, anyway, I'm glad everything worked out, and that you're now using a proper compiler. =D
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: Bing [Bot] and 1 guest