Talk:Semi or Burst fire: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
Is this article finished? Doesn't seem like that... --[[User:Dutchmega|dutchmega]] 13:57, 25 Jul 2006 (PDT)
Is this article finished? Doesn't seem like that... --[[User:Dutchmega|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.
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;}}

Revision as of 16:03, 25 July 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;}}