Flashbang/stun grenades?
Flashbang/stun grenades?
I found a tutorial for screen flashes and was wondering what it would take to make a "flashbang" grenade with this.
After googling it, I found a tutorial to make flashbangs, but for Quake 2. Is there anyway to incorporate this into Quake 1 or would i need or would i need to start from scratch?
I'm very new to Quake coding (so don't comment on my signature) so any help is appreciated.
The screen flash tutorial:
http://inside3d.com/showtutorial.php?id=151
The Quake II tutorial:
http://webadvisor.aupr.edu/noc/Othertut ... es%20.html
After googling it, I found a tutorial to make flashbangs, but for Quake 2. Is there anyway to incorporate this into Quake 1 or would i need or would i need to start from scratch?
I'm very new to Quake coding (so don't comment on my signature) so any help is appreciated.
The screen flash tutorial:
http://inside3d.com/showtutorial.php?id=151
The Quake II tutorial:
http://webadvisor.aupr.edu/noc/Othertut ... es%20.html
<html><body bgcolor="black"><h1 style="color:white">THIS IS MY SIG</h1></body></html>
Artifact-RJS mod has Flash grenades.
As far as I know, they work by playing with the gamma or the content blends of anyone judged to have been looking at flash grenade when it went off.
http://www.argon.org/artifact-rjs/
Yeah this probably isn't much help considering you likely don't have enough experience to pull the feature out of the source: http://www.argon.org/artifact-rjs/archi ... .2-src.zip
Still, making such an attempt is a good start to modding.
Look at things such as W_FireGrenade, GrenadeExplode, T_RadiusLight, etc.
As far as I know, they work by playing with the gamma or the content blends of anyone judged to have been looking at flash grenade when it went off.
http://www.argon.org/artifact-rjs/
Yeah this probably isn't much help considering you likely don't have enough experience to pull the feature out of the source: http://www.argon.org/artifact-rjs/archi ... .2-src.zip
Still, making such an attempt is a good start to modding.
Look at things such as W_FireGrenade, GrenadeExplode, T_RadiusLight, etc.
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-
OneManClan
- Posts: 247
- Joined: Sat Feb 28, 2009 2:38 pm
- Contact:
This sounds intriguing, though as a newb, I'm not sure how to implement it:Junrall wrote:Nice! Simple and easy to do.Error wrote:for my flashbang, I was thinking of using a white model, attached to the player's viewport (viewmodelforclient) and alpha it until it's invisible...
1. make a new .mdl which is just a flat white surface?
2. position it in front of the 'victims' face/eyes?
3. make it follow the victim so its always in front of their face?
4. use viewmodelforclient to make sure no-one else sees it?
5. "alpha it until it's invisible... " not sure how to do this, is there any example code of 'fading something in/out', using 'alpha channel' values (which I assume are a similar concept to the 'alpha values' in photoshop)
More info please
thanks,
OneManClan
1) makes sense, but i would use a different mesh.OneManClan wrote: 1. make a new .mdl which is just a flat white surface?
2. position it in front of the 'victims' face/eyes?
3. make it follow the victim so its always in front of their face?
4. use viewmodelforclient to make sure no-one else sees it?
5. "alpha it until it's invisible... " not sure how to do this, is there any example code of 'fading something in/out', using 'alpha channel' values (which I assume are a similar concept to the 'alpha values' in photoshop)
OneManClan
2) i would do it as the weaponmodel. (self.weaponmodel =...)
3) weaponmodel solves that
4) weaponmodel does that
5) not possible in vanilla Quake to change the alpha of an mdl texture, i didnt saw this in any other engine before - i would simply disable the flashmodelhack.
But doing this feature with a model is a bad option, it can be simply deactivated by replacing it with another viewmodel, even worser in multiplayer, its simply dirty.
-
Mexicouger
- Posts: 514
- Joined: Sat May 01, 2010 10:12 pm
- Contact:
I don't like that method at all. Why not just take an image, overlay it on the screen, and then just set its alpha lower and lower as time goes on, until it disapears. That requires some engine coding, but can be done fairly easilyRanger366 wrote:1) makes sense, but i would use a different mesh.OneManClan wrote: 1. make a new .mdl which is just a flat white surface?
2. position it in front of the 'victims' face/eyes?
3. make it follow the victim so its always in front of their face?
4. use viewmodelforclient to make sure no-one else sees it?
5. "alpha it until it's invisible... " not sure how to do this, is there any example code of 'fading something in/out', using 'alpha channel' values (which I assume are a similar concept to the 'alpha values' in photoshop)
OneManClan
2) i would do it as the weaponmodel. (self.weaponmodel =...)
3) weaponmodel solves that
4) weaponmodel does that
5) not possible in vanilla Quake to change the alpha of an mdl texture, i didnt saw this in any other engine before - i would simply disable the flashmodelhack.
But doing this feature with a model is a bad option, it can be simply deactivated by replacing it with another viewmodel, even worser in multiplayer, its simply dirty.
Indeed, im not very familar with displaying images at Engine coding (i just worked with view.cpp, sbar.cpp for the HUD postioning)Mexicouger wrote:That requires some engine coding, but can be done fairly easily
but i thought that (because this here is the QuakeC section) it should be done over a QC only way. Which is a bad idea because QC is >serverside< code.
My mod is using dark places only in mind. Viewmodelforclient is useful as you can still have a weapon model. Anyone hit will spawn the model attached to the players view which will gradually disappear using model alpha. Using csqc would make it nicer but I try to not use csqc as I'm not that comfortable with it yet. My solution is simple, effective, and requires a whole lot less coding than the csqc/engine alternative.
Re: Flashbang/stun grenades?
Nixtwiz wrote:I found a tutorial for screen flashes and was wondering what it would take to make a "flashbang" grenade with this.
After googling it, I found a tutorial to make flashbangs, but for Quake 2. Is there anyway to incorporate this into Quake 1 or would i need or would i need to start from scratch?
I'm very new to Quake coding (so don't comment on my signature) so any help is appreciated.
The screen flash tutorial:
http://inside3d.com/showtutorial.php?id=151
The Quake II tutorial:
http://webadvisor.aupr.edu/noc/Othertut ... es%20.html
if you use the code for that tutorial, you should open weapons.qc
find the code
void() GrenadeExplode =
{
T_RadiusDamage (self, self.owner, 120, world);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_EXPLOSION);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
BecomeExplosion ();
};
and change with
void() GrenadeExplode =
{
BecomeExplosion ();
Palfrom(700, 350, self.origin, world, 250, 250, 250, 1, FALSE);
sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 0.3, ATTN_NORM);
};
grettings
hi, I am nahuel, I love quake and qc.
I recommend then have the flash-grenade as a secondary fire of the grenade launcher (if you do not want to create a new item).Nixtwiz wrote:If i replaced the code it would get rid of the normal grenade too. I need to have both an explosive grenade and a flashbang grenade.
It is easy to do with this tutorial
http://www.inside3d.com/showtutorial.php?id=19
so you can have the two grenade explosions
hi, I am nahuel, I love quake and qc.