Announcement

Collapse
No announcement yet.

Rapid button sensitive weapon mod in QuakeC

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rapid button sensitive weapon mod in QuakeC

    Hello all,

    I think I need some help relaying some info to my programmer for my mod. he says he's having trouble doing a specific thing with the weapons, and I'd like to know if anyone has any ideas.

    The main idea is that the weapons in this mod are much like old school weapons like in Contra and Megaman, where the weapons can be fired very rapidly, but only have a 2-5 projectile limit in a set amount of distance (simulating screen distance)

    The amount of blasts in that set distance is not a problem, weapons work good shooting 3 projectile bursts a set distance away, but the problem the programmer is having is working with the +attack, it always shoots repeating (and way too fast when close to a wall)

    Another issue is that he mentions that frame Macros can never be interrupted, making it impossible to shoot and interrupt an animation sequence, I don't know how this works but I have seen some cases where this is possible, so I'm not sure what the problem really is.

    What I'd like is that the weapon only shoots once per button press _only_ up to 3 times per "screen". The programmer says making a new impulse may be messy, and I would hate to break the ability to change the +attack button in the menu that way too.

    I would like to know if anyone has any ideas, I myself am no expert in QuakeC, but know some lingo here and there, I'd be able to relay the information easy and let you guys know what he thinks.

    This seems to be the only thing holding back this mod, which is going to be very button reflex based, and more controller/gamepad based, and it would be a shame to leave such a crucial mechanic.

    later I want to incorporate "charge" shots when the button is held down as an alternate fire, but this is important first

    Thank you all!
    Last edited by MaxLuna; 03-22-2011, 10:16 PM.

  • #2
    Serious QuakeC coding efforts should request help at forums.inside3d.com where the QuakeC coders hang out.

    Inside3d Forums :: Index

    I mean sometimes, you can get answers here, but Inside3D has a ton of QuakeC knowledgeable people and is simply the best resource for Quake modding. Func_Msgboard: Latest News can also be helpful (central site of Quake map development).
    Quakeone.com - Being exactly one-half good and one-half evil has advantages. When a portal opens to the antimatter universe, my opposite is just me with a goatee.

    So while you guys all have to fight your anti-matter counterparts, me and my evil twin will be drinking a beer laughing at you guys ...

    Comment


    • #3
      First of all, limiting per screen is difficult to do (although not impossible). Easier is limit the total number that can exist. This is how I would do it:

      Create a new field called .projectiles (This assumes there is only one weapon with this limit. The same principle can be used for multiple weapons, with different limits)
      Before the weapon fires, if (self.projectiles >= limit) then don't fire; else fire the weapon as normal. In the function that controls how the weapon fires, increase self.projectiles for each one fired (in both these cases, self is the player).
      Set the projectile's think function (one is needed to make sure that shots that will never hit anything time out after a while; 5 seconds is reasonable) to a special function that decreases self.owner.projectiles by 1 (self is the projectile here, so you need to use self.owner to alter the number of the player that fired it) before doing remove(self). In the touch function, instead of calling remove(self) or SUB_Remove, call the function that decreases self.owner.projectiles.

      If you want to try to do it per screen, then it involves a findradius() call before firing, centered on the player. Easiest is to set a specific classname on the projectile (can be as simple as "playershot"). Then, for each entitiy found, check for the classname being correct && its owner being the player. If so, then increase a counter. When the entities have all been gone through (or if the limit is reached earlier, stop doing this and just fail), if the limit hasn't been reached, then shoot as normal. If doing this, then you don't need the .projectiles field or the wrapper function before the entity is removed.

      And it's incorrect that frame macros cannot be interrupted. You can just set the .think function to a different animation. But that's not the cleanest way to do it. I see though how you are arriving at this stopping point. You're basing this weapon off of the nailgun, aren't you. In W_Attack(), try doing what the shotgun does instead, but with a low refire rate.
      16:03:04 <gb> when I put in a sng, I think I might need nails
      16:03:30 <gb> the fact that only playtesting tells me that probably means that my mind is a sieve

      Comment


      • #4
        Thanks Lardarse for the reply, I will forward the information to my programmer and see what he thinks, I'll also go ahead and go on Inside3d to see what people think too.

        Thanks a lot

        Comment

        Working...
        X