Gaming Underground Network

Come for the Mods, Stay for the Community!
 
HomePortalLatest imagesInterviewsRegisterLog in
Search
 
 

Display results as :
 

 


Rechercher Advanced Search
Info Panel
______________
MOD MASTER THREADS:
FALLOUT
THE ELDER SCROLLS

______________


______________


GUNinsider
Fallout Miami: Mika999
Stay Connected

GUNetwork
Keywords
Drag marvel Reforged body outlawer ghoul FCOM riot machine Doom boom boomers khan hunk dead drags boba money NPCs race Ryse armor fett resident powder jedi
Latest topics
» XHX Discord server.
Help to understand a Script. Emptyby phantom9708 Today at 12:54 am

» Hello there!
Help to understand a Script. Emptyby Sword_Singer Yesterday at 1:18 am

» Dragbody npc overhaul issue
Help to understand a Script. Emptyby ATAMAHbI4 Wed Jan 25, 2023 10:18 pm

» dragbody NPC Overhaul including Goodsprings
Help to understand a Script. Emptyby ATAMAHbI4 Wed Jan 25, 2023 10:15 pm

» Help with dragbody mods
Help to understand a Script. Emptyby ATAMAHbI4 Wed Jan 25, 2023 10:05 pm

» Help with ENB
Help to understand a Script. Emptyby Acies Mon Jan 23, 2023 3:23 pm

» Hello there
Help to understand a Script. Emptyby Guest Mon Jan 23, 2023 12:18 am

» 20th Century Weapons
Help to understand a Script. Emptyby NamAn Sat Jan 21, 2023 10:29 am

» Free: Haven Park
Help to understand a Script. Emptyby Wertologist Fri Jan 20, 2023 4:46 pm

» Question about we are legion
Help to understand a Script. Emptyby ateios Sun Jan 01, 2023 11:04 pm

» Hey folks
Help to understand a Script. Emptyby TheYoinkee Sat Dec 31, 2022 4:32 pm

» Weird graphical artifacts in specific worldspace (video
Help to understand a Script. Emptyby anstand Fri Dec 30, 2022 6:13 pm

» (Fo4) fo76 Steel Dawn Weapons and Armor ports
Help to understand a Script. Emptyby l_Diego_l Thu Dec 29, 2022 8:54 am

» What your favorite type of weapon says about you
Help to understand a Script. Emptyby gavin gold Wed Dec 21, 2022 12:40 am

» Question for Fallout 76 Players
Help to understand a Script. Emptyby Fallout1984 Mon Dec 19, 2022 10:51 pm

» compatible body mods for dragbody overhaul
Help to understand a Script. Emptyby ateios Thu Dec 15, 2022 8:29 pm

» Apologies for lurking
Help to understand a Script. Emptyby Alexander Brossart Thu Dec 15, 2022 2:36 am

» (FNV) stutter every second
Help to understand a Script. Emptyby Tandrum Tue Dec 13, 2022 9:40 am

» [WIP] FO4 Mass effect Location bug Help
Help to understand a Script. Emptyby Wolfgang_Straus Sun Dec 11, 2022 2:22 pm

» Looking to commission an animator
Help to understand a Script. Emptyby nicksiegel.loft Sat Dec 10, 2022 11:32 pm

January 2023
MonTueWedThuFriSatSun
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
CalendarCalendar
_
January 2023
MonTueWedThuFriSatSun
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
CalendarCalendar

Share
 

 Help to understand a Script.

View previous topic View next topic Go down 
AuthorMessage
missaka

missaka

Posts : 11
Join date : 2015-06-04

Help to understand a Script. Empty
PostSubject: Help to understand a Script.   Help to understand a Script. EmptySat Sep 12, 2015 10:50 pm

Hello guys, im trying to understand some pieces of a script and i would like some help...

Code:
short modIndex
short scopeMod
short modEffect
short weapFlags
ref currWeapon
         
;get the player weapon
set currWeapon to player.GetEquippedObject 5

;scope flag set?
if GetWeaponHasScope currWeapon

   
   ; check the possible modifications to see if it can have a scope mod attached to it
   set scopeMod to 0
   set modIndex to 1

   Label 10
   set modEffect to GetWeaponItemModEffect modIndex currWeapon
   if modEffect == 14
      set scopeMod to modIndex
   else
      set modIndex to modIndex + 1
      if modIndex < 4
         GoTo 10   
      endif
   endif

   if scopeMod
      ; scope comes from a mod.. see if player has that mod attached
      set weapFlags to Player.GetEquippedWeaponModFlags      
      if LogicalAnd  weapFlags scopeMod

         ; has scope mod attached

      else

         ; no scope mod attached

      endif
   else

      ; weapon has scope built into it

   endif
else

   ; scope not available for this weapon

endif

In this part:

Code:
set modEffect to GetWeaponItemModEffect modIndex currWeapon
   if modEffect == 14
      set scopeMod to modIndex
   else
      set modIndex to modIndex + 1
      if modIndex < 4
         GoTo 10   
      endif
   endif

Lets say that the slot index 3 it's for the scope. It will loop until modIndex reach 3, then

Code:
if modEffect == 14

will be true and, in the line

Code:
set scopeMod to modIndex

, scopeMod will assume the same value of modIndex, which means 3. CORRECT?

This part below doesn't make sense to me. If what? If scopeMod is different from zero?

Code:
if scopeMod

At last, what this piece do?

Code:
set weapFlags to Player.GetEquippedWeaponModFlags      
      if LogicalAnd  weapFlags scopeMod

I know that the function GetEquippedWeaponFlags returns the value 1,2 or 4 (or a combination of then: 2,5,6 or 7). Assuming that there are three mods into the weapon, the
function will return the value 7.

This part
Code:
if LogicalAnd weapFlags scopeMod
will check if both are different from zero or what?
Back to top Go down
 

Help to understand a Script.

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» [FNV] Need Help With A Script
» Blender Nif Script help
» Changing PC Skeleton/Animations on the fly via script
» Issue with recompiling a script (for TTW)
» Weather script for Fallout 3

Permissions in this forum:You cannot reply to topics in this forum
Gaming Underground Network :: Fallout :: Troubleshooting-