Need help with scripting (advanced)

Trying to get a multifunctional sticky launcher script to work, however TF2 is being an asshole.

By Cryzbl 4 years ago

So I wanted a multifunctional sticky launcher script. Holding down mouse1 results in charging a sticky, quickly releasing and pressing mouse1 would autofire stickies.

This is what I have:

// Bind agnostic :) bind mouse1 "+primfire"

// This enables stickyfiring when I equip the weapon alias stickyfire "alias +primfire +stickyfire; alias -primfire -stickyfire; +reload" // Fire either normal (sfar) or rapid (+rapidfire) alias +stickyfire "sfar" // When you press mouse1 again within 20 frames, rapid sticky will start, otherwise change back to normal fire. alias -stickyfire "-attack; -rapidfire; alias +stickyfire +rapidfire; wait 20; alias +stickyfire sfar" // Standard autoreload alias sfar "-reload; +attack"

// Standard auto fire script alias +rapidfire "-reload; alias rfrepeat rfloop; rfloop" alias -rapidfire "alias rfrepeat +reload" alias rfrepeat "+attack; wait 15; -attack; wait 5; rfrepeat"

The autofiring works perfect however when I want to launch a single sticky or charge one, it gets 'stuck' on charging (I let go of mouse1 but it keeps charging instead of launching the sticky). The only way to unstuck it is to make it rapidfire the stickylauncher by doubleclicking.

After about 4 hours of testing I give up... Does anyone see any errors that might cause this?

EDIT: Added comments and made thread title and description better

7 posts 796 views
  • You must be a member

Replies

  • Cryzbl's Levels
    • P1: Beggar
      Points: 817
    • E1: Helper
      EF: 2
    • C1: Member
    • A5: Veteran
      Account Age: 5 years
    Posted 4 years ago

    Bump, anyone?

    User Title
    Scripting TF2. And L4D :D
  • Sturmeh's Levels
    • P1: Beggar
      Points: 706
    • C1: Member
    • A5: Veteran
      Account Age: 5 years
    Posted 4 years ago

    Why don't you just try using this one... http://www.fpsbanana.com/scripting/3292

    Is there a difference? ( apart from how you wish to trigger the shot? )

    Oh dear, i've made quite a mes
  • Cryzbl's Levels
    • P1: Beggar
      Points: 817
    • E1: Helper
      EF: 2
    • C1: Member
    • A5: Veteran
      Account Age: 5 years
    Posted 4 years ago
    Posted by Sturmeh Why don't you just try using this one... http://www.fpsbanana.com/scripting/3292 Is there a difference? ( apart from how you wish to trigger the shot? )

    Yes, my philosophy is to only add things with scripts. Holding down primary fire charges a sticky and will stay so. If you charge a sticky you usually aren't clicking very fast so I can sneak in rapid sticky fire.

    But for some reason when you click shortly it doesn't recognize -attack (even if I manually type it in the console, need to hold down +attack for minimum 1 second for it to recognize -attack). So I believe tf2 is bugged...

    User Title
    Scripting TF2. And L4D :D
  • dzaztr's Levels
    • P2: Drudge
      Points: 1,964
    • E1: Helper
      EF: 4
    • C1: Member
    • A6: Elder
      Account Age: 7 years
    Posted 4 years ago

    Or...... it's set up to avoid sneaky little scripts like this.

    User Title
    Back but not with a vengeance
  • Cryzbl's Levels
    • P1: Beggar
      Points: 817
    • E1: Helper
      EF: 2
    • C1: Member
    • A5: Veteran
      Account Age: 5 years
    Posted 4 years ago
    Posted by Sturmeh Why don't you just try using this one... http://www.fpsbanana.com/scripting/3292 Is there a difference? ( apart from how you wish to trigger the shot? )
    Posted by dzaztr Or...... it's set up to avoid sneaky little scripts like this.

    Then we'll just have to get it to work one way or another. :p

    User Title
    Scripting TF2. And L4D :D
  • Cryzbl's Levels
    • P1: Beggar
      Points: 817
    • E1: Helper
      EF: 2
    • C1: Member
    • A5: Veteran
      Account Age: 5 years
    Posted 4 years ago
    Posted by Sturmeh Why don't you just try using this one... http://www.fpsbanana.com/scripting/3292 Is there a difference? ( apart from how you wish to trigger the shot? )

    Ah dammit, didn't realize my reply somehow got lost while attempting to multiquote...

    Anyway, after analysing your script, of course the way the shot is triggered is all that is different. However your method of buffering the sticky picked my attention, apparently if you hold down reload then -attack won't be recognized. This has the additional feature of not automatically shooting the shot after it's fully buffered.

    This behaviour is what makes my script not usable, perhaps I'm reloading without knowing somewhere...

    Anyway thanks for your help :)

    User Title
    Scripting TF2. And L4D :D
  • Sturmeh's Levels
    • P1: Beggar
      Points: 706
    • C1: Member
    • A5: Veteran
      Account Age: 5 years
    Posted 4 years ago

    Yes that is most likely.

    With my script you can press T to fully load a sticky, and the next time you fire a sticky, it will be the fully loaded one. ( Instead of buffering directly prior to the shot. )

    Oh dear, i've made quite a mes
  • You must be a member