Jump to content

Should I be using leveled lists?


Jojash

Recommended Posts

So, recently I've been trying to make a script that will increase the player's skills with a weapon, if they're using that type of weapon. So, for example, if they're using a 10mm pistol, it'll increase their "guns" skill. I assumed that I should use leveled lists, here's what I've got so far.

 

 

 

        If Player.GetEquipped AesirCollectionsGunsList
            Player.ModAV Guns 5
            Set GunCounter to 1
            ShowMessage ACCombatManagerMessage01
        ElseIf Player.GetEquipped AesirCollectionsBigGunsList
            Player.ModAV Guns 5
            Player.ModAV BigGuns 5
            Set BigGunCounter to 1
            ShowMessage ACCombatManagerMessage01
        ElseIf Player.GetEquipped AesirCollectionsExplosivesList
            Player.ModAV Explosives 5
            Player.ModAV MeleeWeapons 5
            Set ThrowWeaponsCounter to 1
            ShowMessage ACCombatManagerMessage03
        Elseif Player.GetEquipped AesirCollectionsMeleeList
            Player.ModAV MeleeWeapons 5
            Player.ModAV MeleeDamage 5
            Set MeleeCounter to 1
            ShowMessage ACCombatManagerMessage05
        Elseif Player.GetEquipped AesirCollectionsUnarmedList
            Player.ModAV Unarmed 5
            Player.ModAV UnarmedDamage 5
            Set UnarmedCounter to 1
            ShowMessage ACCombatManagerMessage07
        Elseif Player.GetEquipped AesirCollectionsEnergyWeaponsList
            Player.ModAV EnergyWeapons 5
            Set EnergyWeaponsCounter to 1
            ShowMessage ACCombatManagerMessage09
        Endif

        If Player.GetEquipped AesirCollectionsGunsList != 1 && GunCounter == 1
            Player.ModAV Guns -5
            Set GunCounter to 0
            ShowMessage ACCombatManagerMessage02
        ElseIf Player.GetEquipped AesirCollectionsBigGunsList != 1 && BigGunCounter == 1
            Player.ModAV Guns -5
            Player.ModAV BigGuns -5
            Set BigGunCounter to 0
            ShowMessage ACCombatManagerMessage02
        ElseIf Player.GetEquipped AesirCollectionsExplosivesList != 1 && ThrowWeaponsCounter == 1
            Player.ModAV Explosives -5
            Player.ModAV MeleeWeapons -5
            Set ThrowWeaponsCounter to 0
            ShowMessage ACCombatManagerMessage04
        Elseif Player.GetEquipped AesirCollectionsMeleeList != 1 && MeleeCounter == 1
            Player.ModAV MeleeWeapons -5
            Player.ModAV MeleeDamage -5
            Set MeleeCounter to 0
            ShowMessage ACCombatManagerMessage06
        Elseif Player.GetEquipped AesirCollectionsUnarmedList && UnarmedCounter == 1
            Player.ModAV Unarmed -5
            Player.ModAV UnarmedDamage -5
            Set UnarmedCounter to 0
                ShowMessage ACCombatManagerMessage08
        Elseif Player.GetEquipped AesirCollectionsEnergyWeaponsList && EnergyWeaponsCounter == 1
            Player.ModAV EnergyWeapons -5
            Set EnergyWeaponsCounter to 0
            ShowMessage ACCombatManagerMessage10
        Endif

 

 

 

 

In "AesirCollectionsGunList", I've put every gun that requires the "guns" skill to use, and I've done the same with the other lists and skills. Currently this script seems to do nothing, so I assume the problem lies with my lists. The only other function that I can think of using would be the "GetIsUsedItemEquipType" function, but I fear that would only work when the gun was fired, rather than drawn. Any help would be greatly appreciated!

Edited by Jojash
Link to comment
Share on other sites

I don't think that would work, as it seems to detect whatever skill is required for whatever weapon you specify. So, theoretically, I could specify the list as the weapon I want to check the skill of, however, I'm reasonably certain that it won't detect whether it's equipped or not. I have actually tried to do it that way, and unfortunately that doesn't seem to work. Thank you for your reply though! :smile: Would you have any other suggestions?

 

The Only way I can see of getting it to work with that would be to use some sort of function that detects what weapon the user has equipped, however I'm not aware of any such function. GetEquipped won't work because it checks to see if the user has a specific item equipped.

 

Possibly a way of getting it to work with a list would be to use, "IsWeaponInlist". I'll have to move everything into a from list, though... I'll give that a whirl.

Edited by Jojash
Link to comment
Share on other sites

You use it by getting the currently equipped weapon, setting it to a reference variable, and then running the skill type function on that.

 

set rWeap to player.GetEquippedObject 5
set iSkl to GetWeaponSkill rWeap
 
if (iSkl == 41)        ; Guns
    ; do stuff
elseif (iSkl == 34)    ; Energy Weapons
    ; do other stuff
endif
Link to comment
Share on other sites

Thank you both so much! That works perfectly! The form lists worked too, but as you pointed out earlier, Nonplusultra, it wouldn't have worked with either DLC items or modded items. :D

Link to comment
Share on other sites

  • Recently Browsing   0 members

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