Can someone write/give me a gauss event? Created 8 years ago2016-05-02 11:03:47 UTC by EsprimoP EsprimoP

Created 8 years ago2016-05-02 11:03:47 UTC by EsprimoP EsprimoP

Posted 8 years ago2016-05-02 11:03:47 UTC Post #330020
I'm making a new laser gun. I made every part of the weapon except the laser.. it shoots bullets currently. gauss.cpp firing function is too confusing. It first checks whether the player clicked left mouse button or right mouse button, then the spin event. Is there already a code with that maybe? Or do you know the main function that plays a sprite like a line(laser) from the gun?
EsprimoP EsprimoPwEight
Posted 8 years ago2016-05-02 11:52:13 UTC Post #330021
Most of the Gauss code that play the sound, show the sprites and so forth are in the Gauss's events. If you disable client side prediction by removing the "CLIENT_WEAPONS" define in both client and server projects properties, you can see that the Gauss will only play the draw, idle animations and the zap sounds.

So all you have to do is look at the Gauss's events to see how it's done.
Posted 8 years ago2016-05-02 13:41:00 UTC Post #330022
Made the laser, but it points at the center of the map wherever I aim at. Is there no API or anything? Right now I'm totally confused because the gauss in unique and has lots of abilities in one event function.
EsprimoP EsprimoPwEight
Posted 8 years ago2016-05-02 21:15:21 UTC Post #330027
You should be able to retrieve the player's angles client side and trace a line to get the "destination".
Posted 8 years ago2016-05-03 02:27:05 UTC Post #330029
Is your laser weapon a single shot weapon like the TFC Railgun,
or a continuous fire weapon like the Egon Gun?
Posted 8 years ago2016-05-03 09:27:46 UTC Post #330030
@Shepard Heh if the variables and function calls were a little more descriptive, I could've found it instantly. I did try something like VectorMA( tr.endpos, 8.0, forward, vecSrc );, End Position maybe? It didn't do anything.

@Spanner Yes It's a single shot weapon just like primary gauss. I DID put a secondary fire but using secondary ammunition. It's the same as the primary fire, single shot.

The only difference is different type of ammo and laser color.
EsprimoP EsprimoPwEight
Posted 8 years ago2016-05-04 06:05:22 UTC Post #330033
If your mod is a singleplayer mod, you can get away with making
the effects server side, no client side effects whatsoever.
It's not recommended, but you can just do this server side.

If you're doing multiplayer, then you will have to do client side
prediction + effects and stuff.
Posted 8 years ago2016-05-04 14:53:44 UTC Post #330037
I made a quick event code, I'm not at home right now so I can't test if it works or if it will even compile : http://pastebin.com/FwMXd6QC.
Posted 8 years ago2016-05-07 14:58:57 UTC Post #330070
[b]
if ( tr.allsolid )
break;
->
if ( !tr.allsolid )
{
// blah
}
and
if ( pEntity == NULL )
break;
->
if ( pEntity != NULL )
{
//blah
}
[/b]

I don't know if you put break; on purpose but It shouldn't be placed anywhere except do, while, for and switch.
Okay, I got the laser working, but at random time it shoots two lasers simultaneously and doesn't do any damage to the target?
EsprimoP EsprimoPwEight
Posted 8 years ago2016-05-07 15:55:29 UTC Post #330071
wouldnt gluon gun be more suitable as a 'lazer' weapon?
Posted 8 years ago2016-05-07 16:31:51 UTC Post #330072
Read the replies above please. It's a single shot weapon. And I'm no expert in HLSDK.
EsprimoP EsprimoPwEight
You must be logged in to post a response.