Jojash Posted March 2, 2013 Share Posted March 2, 2013 (edited) 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 March 2, 2013 by Jojash Link to comment Share on other sites More sharing options...
nonplusultra Posted March 2, 2013 Share Posted March 2, 2013 http://geck.bethsoft.com/index.php/GetWeaponSkill You can use getweaponskill, I have no more time, so I can't check the parameters for you, but you should find 'em by google. So if the current weapon is an energy weapon you can increase the energyweapons skill, this will also work for weapons from other mods. Link to comment Share on other sites More sharing options...
Jojash Posted March 2, 2013 Author Share Posted March 2, 2013 (edited) 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 March 2, 2013 by Jojash Link to comment Share on other sites More sharing options...
Gribbleshnibit8 Posted March 3, 2013 Share Posted March 3, 2013 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 More sharing options...
nonplusultra Posted March 4, 2013 Share Posted March 4, 2013 yes this is it, thank you for helping him, couldn`t get on earlier, if this script was helpful, please post the result to help other users later. Link to comment Share on other sites More sharing options...
Jojash Posted March 5, 2013 Author Share Posted March 5, 2013 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 More sharing options...
luthienanarion Posted March 7, 2013 Share Posted March 7, 2013 Run a script on startup that adds DLC/mod items to the form lists, and it will work with them as well. You can use BuildRef to reference specific forms by ID in other plugins. Link to comment Share on other sites More sharing options...
Recommended Posts