Alundaio Posted June 2, 2009 Share Posted June 2, 2009 You are missing the baseid after GetWeaponType. No worries though pal. I'm tired as hell cuz I'm going through an insomia spell. Takes awhile to think clearly. basically you are calling the function of object (reference.GetWeaponType) . That means you need to pass it a value to get a return value. so weaponequipped.GetWeaponType 3 will give you a return of true if the player has a one hand pistol. Link to comment Share on other sites More sharing options...
Khet Posted June 2, 2009 Author Share Posted June 2, 2009 Wait, so I'd have to move the GetWeaponType down to each category, instead of having it taken care of by the short? Because if I'm understanding this correctly now, if I set it up like this Set EqupType to equippedweapon.getweapontype 5 Then it will ALWAYS return a 5? Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 basically you do not need EquipType variable. just do If(equippedweapon.getweapontype 5) That will return true. It works just like the IsLimbGone function http://geck.bethsoft.com/index.php/IsLimbGone *EDIT* I told you this earlier but we some how ended up using the wrong function. I think that was my fault though. Link to comment Share on other sites More sharing options...
Khet Posted June 2, 2009 Author Share Posted June 2, 2009 Yea... I must just be an idiot. Still coming up as the melee. I really need some sleep, maybe then I'd actually be able to think for myself. SCN FOPRProfessionScript ref EquippedWeapon Short equipType Begin GameMode set equippedWeapon to Player.GetEquippedObject 5 If (Player.IsWeaponOut) If (equippedWeapon.GetWeaponType == 3 || equippedWeapon.GetWeaponType == 4) Player.AddPerk FOPRPistol ElseIf (equippedWeapon.GetWeaponType == 0 || equippedWeapon.GetWeaponType == 1 || equippedWeapon.GetWeaponType == 2) Player.AddPerk FOPRMelee ElseIf (equippedWeapon.GetWeaponType == 5 || equippedWeapon.GetWeaponType == 7) Player.AddPerk FOPRRifle ElseIf (equippedWeapon.GetWeaponType == 6) Player.AddPerk FOPRAuto EndIf Else Player.RemovePerk FOPRPistol Player.RemovePerk FOPRMelee Player.RemovePerk FOPRRifle Player.RemovePerk FOPRAuto EndIf End Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 Lol...no. You have it backwards, buddy. SCN FOPRProfessionScript ref EquippedWeapon Short equipType Begin GameMode set EquippedWeapon to Player.GetEquippedObject 5 If (Player.IsWeaponOut) If (GetWeaponType EquippedWeapon == 3 || GetWeaponType EquippedWeapon == 4) Player.AddPerk FOPRPistol ElseIf (GetWeaponType EquippedWeapon == 0 || GetWeaponType EquippedWeapon == 1 || GetWeaponType EquippedWeapon == 2) Player.AddPerk FOPRMelee ElseIf (GetWeaponType EquippedWeapon == 5 || GetWeaponType EquippedWeapon == 7) Player.AddPerk FOPRRifle ElseIf (GetWeaponType EquippedWeapon == 6) Player.AddPerk FOPRAuto EndIf Else Player.RemovePerk FOPRPistol Player.RemovePerk FOPRMelee Player.RemovePerk FOPRRifle Player.RemovePerk FOPRAuto EndIf End Link to comment Share on other sites More sharing options...
Khet Posted June 2, 2009 Author Share Posted June 2, 2009 Alright... I'm getting some sleep for at least half an hour. For one, I don't notice any difference between yours and my script. Secondly... heh, still didn't work. Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 The edited code should work perfectly I just tested it. With my pistol equipped it adds the pistol perk. The problem is FOSE listed both syntaxes as examples. If you don't get it to work it's just you...lol. *edit* Throw out that EquipType var and put "set EquippedWeapon to Player.GetEquippedObject 5" under "If (Player.IsWeaponOut)" So it doesn't set every frame. After that the code should be good enough for what you plan on using it for. Link to comment Share on other sites More sharing options...
Khet Posted June 2, 2009 Author Share Posted June 2, 2009 Hah, no idea how I messed up a copy/paste job but it actually worked this time. Thanks for the help mate! Now I can actually work on the REST of the mod lol Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 THANK GOD!!! It only took a few hours to get 22 lines of code to work as intended. We're moving faster than Bethesda's coders! Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 Hope you don't mind if I use part of this idea to recreate the old Fallout Traits. This would be perfect for One Hander. There was no easy way to check for one handed weapon before FOSE. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.