sniper scope on shift?

Discussion in 'Scripting' started by DON, Aug 30, 2005.

  1. DON Private

    Contributions:
    9
    hello m8es

    im working on my mod now and its almost done, all i need to know is it possible to put the secondary attack of snipers on the walk function (shift button) and add bash as a secondary?

    if this is possible could some1 do that for me??

    file is in attachments

    thanks in advance!
  2. sorridstroker Armed Forces Veteran

    Contributions:
    233
    Specialties:
    Scripting
    PREMIUM
    I Donated
    you could posibly do bash when walk button is pressed.

    but scope is hard coded (I think) to be secondary.
  3. @(...:.:...)@ Hal

    Contributions:
    325
    Specialties:
    Scripting, Textures, Programming
    Processing:
    Graphics:
    PREMIUM
    I Donated
    You can use zoom and zoomoff I think. I did a client side script for more acurate sniper rifles a while ago which is in the new files section somewhere which uses zoom and zoomoff if I remember right. :)

    For some reason zoom doesnt always work, and sometimes you get "command zoom not avalable from the console" :S

    I cant remember if you can create + and - aliases in moh, but if you can, perhaps this would work:

    alias "+walkzoom" "+speed;zoom"
    alias "-walkzoom" "-speed;zoomoff"

    Then bind your walk key to +walkzoom. You can have walk as toggalable instead of holding down the key, which makes things a bit more tricky also :p

    Toggle run uses

    toggle cl_run

    You would have to re script the toggle, which wouldent be to hard.



    alias "walk_on" "+speed;zoom;changebind1" //might be +zoom, I can't remember

    alias "walk_off" "-speed;zoomoff;changebind2" //if not, try -zoom

    alias "changebind1" "bind x walk_off"
    alias "changebind2" "bind x walk_on"

    bind x walk_on

    :)

    Edit - I just noticed you want bash as secondary attack to.

    I think it should be possible by editing state files and tik's. It might bash and zoom at the same time though :S You could proberbly get round it with a small hack, eg from state files, when you attack secondary, (bash) turn off zoom (zoomoff or savezoom 0 I htink you can do).

    Make sure you have bash and zoom parts in the tik. Then just setup the sniper in state files to do a bash animation. I would give it a go, but I don't have time at the moment. :( Sorry. :shake:
    1 people like this.
  4. imtheheadhunter people = stupid

    Contributions:
    256
    Specialties:
    Mapper, Scripting, Textures
    Processing:
    Graphics:
    PREMIUM
    I Donated
    might not be true or not, but a friend of mine once sayd he was on a MOH server(not shure if it was AA,SH, or BT though) and he sayd that you could zoom in like normal, but if you pressed another key you could bash.

    agen i have no idea if thats actuly true, as he often did like to tell storys. :winkers:
  5. DON Private

    Contributions:
    9
    ok thanks!

    i hope some1 can do this, i dont know anything about the mike state files.
  6. Lamron Staff Sergeant

    Contributions:
    129
    PREMIUM
    I Donated
    It could be done (server side), but you'd be better off leaving the secondary fire controlling the zoom. If there is a zoom number in the .tik files, the game engine will automatically zoom with secondary fire. Scripting around that would be buggy.

    What you CAN do is switch the primary fire between firing the gun and bashing. You'd have to set up the condition in the state files, so that one would be directed to the rifle bash state, and the other go to the normal fire state. For example: walking + fire = bash, running + fire = shoot.
  7. DON Private

    Contributions:
    9
    so would it be possible to add bash to shift?? but he still walks than, right? or can the walk be removed and only add bash to shift?

    thanks!
  8. Lamron Staff Sergeant

    Contributions:
    129
    PREMIUM
    I Donated
    You can't detect the actual pressing of the walk/run key, you can only tell if a player is currently walking or running (in the state files). So you wouldn't be able to make another key become a bash key.
  9. DON Private

    Contributions:
    9
    well i mean, when you add bash to the 'walk state' is there a possiblity of removing the slow walk speed and add the sound of the footsteps?

    thanks!
  10. @(...:.:...)@ Hal

    Contributions:
    325
    Specialties:
    Scripting, Textures, Programming
    Processing:
    Graphics:
    PREMIUM
    I Donated
    How about having use as a toggle between bash/scope? There is a state for use in miketorso, but I don't think it works. It is proberbly not linked to from any other states. If you fired that state up, you could perhaps do it relitivley eaysily. :)

    If you did that, it would be best to change between scope/bash by pressing the secondary fire key when you are holidng use. You could start a script from state use when a player presses use. Loop it while he is holding use down, and during that time, check if he presses secondary fire, and if so swap to bash etc.

    It would have to be client side if you wanted to give the snipers bash without client animation bugs. Changing animations server side is not pretty. :sick:
  11. DW(KONA) Private

    Contributions:
    3
    walk zoom sounds great

    if nothing else just a serverside mod that auto zooms the player a specified degree while walking would be great.. and a bit more realistic......or is that impossible..
    [HI]DW

Share This Page