Jump to content

GECK Script to Recognize Controller Input


GrayWolf04

Recommended Posts

Is there a way to use scripts to make a weapon fire three-round bursts while using an Xbox 360 controller? Xpadder does not work, and I got the idea from a script in a mod that checks the animation state of the currently equiped gun to know when to play a certain sound effect. My idea was to have a similar script that checks for the firing animation and stops the gun after it has fired three rounds, or cycled through the animation three times. This would force the player to release the trigger on the controller and then pull it again. Below is a copy of the script. The author of this script as far as I know is Thogun, and his mod that contains this script, Apocalypse Armory, can be found here: <A class=bbc_url title="External link" href="http://fallout3.nexu....com/mods/14773" rel="nofollow external"><FONT color=#0000ff>http://fallout3.nexu....com/mods/14773</FONT></A>.<BR><BR><BR>
<BR><BR><BR>SCN M1GarandReloadScript<BR>;formerly BTCReloadM1Script<BR><BR>short pingCounter<BR><BR>begin gamemode<BR><BR>if getcontainer == player<BR>     if player.GetEquipped WeapM1Garand<BR>          if player.GetAnimAction == 9<BR>               if pingCounter == 0<BR>                    PlaySound WPNaaM1GarandPing<BR>                    set pingCounter to 1<BR>               endif<BR>          else<BR>                set pingCounter to 0<BR>          endif<BR>     endif<BR>endif<BR><BR>end<BR><BR>

<BR><BR><BR><BR><BR>EDIT: I found this code on another thread (<A class=bbc_url title="" href="http://forums.nexusmods.com/index.php?/topic/393065-real-quick-question-about-a-lock-and-unlock-script/">http://forums.nexusm...-unlock-script/</A>). This is a lot closer to what I was trying to do. Does anyone know how I would go about tweaking this to play/start the firing animation, and if by doing so, will it actually cause the gun to fire? The gun in question would be listed in the GECK as a semi-automatic rifle.<BR><BR><BR>

<BR><BR>scn MyWeaponUnlockScript<BR><BR>short iAmEquipped<BR>short iWeaponAnim<BR>short iObjectType<BR>ref rBaseObjectREF<BR>ref rTargetREF<BR><BR>BEGIN ONEquip Player<BR><BR>        set iAmEquipped to 1<BR>         <BR>END<BR><BR>BEGIN ONUnequip<BR><BR>        set iAmEquipped to 0<BR><BR>END<BR><BR>BEGIN ONDrop<BR><BR>        set iAmEquipped to 0<BR>         <BR>END<BR><BR>BEGIN GameMode<BR><BR>        if (iAmEquipped == 0)<BR>                return<BR>        endif<BR>         <BR>        set iWeaponAnim to Player.GetAnimAction<BR>        if ((iWeaponAnim > 1) && (iWeaponAnim < 7))             ; weapon animation captures that a shot was fired<BR>                set rTargetREF to GetCrosshairREF                       ;Must be within activation distance of locked object<BR>                if (rTargetREF)<BR>                        set rBaseObjectREF to rTargetREF.GetBaseObject<BR>                        set iObjectType to GetObjectType rBaseObjectREF<BR>                        if ((iObjectType == 23) || (iObjectType == 27) || (iObjectType == 28)) ;Terminal, Container, Door<BR>                                If (rTargetREF.GetLocked)<BR>                                        rTargetREF.Unlock<BR>                                        rTargetREF.PlaySound UILockpickingUnlock<BR>                                else<BR>                                        return<BR>                                endif<BR>                        endif<BR>                endif<BR>        endif<BR>         <BR>END<BR>

<BR><BR>

Edited by GrayWolf04
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...