Talk:Semi or Burst fire: Difference between revisions
(Selective fire) |
(TODO: Find out what it does.) |
||
Line 15: | Line 15: | ||
- Pendra | - Pendra | ||
== TODO: Find out what it does. == | |||
I'm pretty sure that SendPropInt() registers the passed variable for networking. Anytime it is changed on the server, the new value is sent to the client(s). Its not exactly client prediction, but I suppose it can serve the same purpose. |
Revision as of 11:02, 3 October 2006
Wouldn't bool be a more efficient data type here? --TomEdwards 13:51, 25 Jul 2006 (PDT)
Is this article finished? Doesn't seem like that... --dutchmega 13:57, 25 Jul 2006 (PDT)
Yeah, bool would be more efficient for semi fire only. The burst function needs the integer. Apart that, this is finished. It is not the most elegent way of doing it, but it works fine here. As I don't need to actually select the fire mode in my mod, I didn't work out that part. I just gave a hint. To make that work you would need to set up the bool m_bSemi and add that to the ItemPostFrame procedure
if ( pOwner->m_nButtons & IN_ATTACK2 ) { if (m_bSemi){m_bSemi=false;} else {m_bSemi=true;}}
Could someone figure out how to get CHLSelectFireMachineGun working properly, with the 3-round burst switchable and whatnot? maybe as a follow-up to this article?
Selective fire
You can find one solution for that here: http://hl2coding.com/forums/viewtopic.php?p=6568#6568
- Pendra
TODO: Find out what it does.
I'm pretty sure that SendPropInt() registers the passed variable for networking. Anytime it is changed on the server, the new value is sent to the client(s). Its not exactly client prediction, but I suppose it can serve the same purpose.