Alundaio Posted June 2, 2009 Share Posted June 2, 2009 The code I wrote should work perfectly fine if you can get the correct reference to the equipped weapon. Try using the slot for the right hand. Maybe when the weapon is "Put away" but still equipped is considered the weapon slot. But when you pull out the weapon it's in the hands. TG is right about the isWeaponOut. It will be alot more realiable and will check everytime the player changes weapons. Link to comment Share on other sites More sharing options...
Khet Posted June 2, 2009 Author Share Posted June 2, 2009 Alright, switching 5 to 4 (to check right hand) here's what happens. Chinese Assault Rifle - FOPRPistol AND FOPRMelee10mm Pistol - FOPRMeleechinese Pistol - FOPRMeleeBrass Knuckles - FOPRMelee (At least one of them works!) Can't test rifle since I don't have one with my character. Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 I think Player.GetEquippedObject 5 is right. The problem lies with the WeaponType function. Maybe it's not the right syntax. Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 SCN FOPRProfessionScript ref equippedWeapon Short equipType Begin GameMode ;------------------------------------- set equippedWeapon to Player.GetEquippedObject 5 ;------------------------------------- If (Player.IsWeaponOut) If (equippedWeapon.GetEquipType 3 || equippedWeapon.GetEquipType 4) Player.AddPerk FOPRPistol ElseIf (equippedWeapon.GetEquipType 0 || equippedWeapon.GetEquipType 1 || equippedWeapon.GetEquipType 2) Player.AddPerk FOPRMelee ElseIf (equippedWeapon.GetEquipType 5 || equippedWeapon.GetEquipType 7) Player.AddPerk FOPRRifle ElseIf (equippedWeapon.GetEquipType 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 They all come back as FOPRMelee now. Tried both 4 and 5 for the GetEquippedObject. Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 I don't know man. I can't even get stuff that's in the GECK wiki site to work. Till this day I can't get GetCauseofDeath function to work properly. Not even using the Ceiling and Floor functions from FOSE give an accurate number. I personally think GECK is crap and the syntax for the functions is horrible. I'd rather code in assembly or Qbasic for christ sake. It takes hours to make a simple menu work. I took freaking Object Oriented C++ programming class in College for godsakes! No wonder it took Bethseda so long to make Fallout 3. If you go through the editor there really isn't that much damn content to the game. AHHHHHH. Link to comment Share on other sites More sharing options...
Khet Posted June 2, 2009 Author Share Posted June 2, 2009 I guess I'll just keep plugging away at it and see if I do something magical. Only thing I can think is that the EquipType is always returning a 0-2 for Melee. Probably a 0. I'm gonna reduce them all down to just a single number for each category later and see what happens. Link to comment Share on other sites More sharing options...
TGBlank Posted June 2, 2009 Share Posted June 2, 2009 tsk tsk. This is what happens when i trust the person i'm helping did his homework... Children, GetEquipType returns the equipment type, that is:Equip Type Equipment Slot IDs 0: head 1: hair 2: upper body 3: left hand 4: right hand 5: weapon 6: pip boy 7: backpack 8: necklace 9: headband 10: hat 11: eyeglasses 12: nosering 13: earrings 14: mask 15: choker 16: mouth object 17: body addon 1 18: body addon 2 19: body addon 3 You actually want this: GetWeaponType Alias: GetWeapTypeParameters:1 item:InventoryObject Return Type: WeaponType:IntegerOpcode: 0x1409 (5129)Condition Function: NoIntroduced In: 1 Calling Convention: EDescription: returns the weapon type Which returns this: Weapon Type 0: HandToHandMelee 1: OneHandMelee 2: TwoHandMelee 3: OneHandPistol 4: OneHandPistolEnergy 5: TwoHandRifle 6: TwoHandAutomatic 7: TwoHandRifleEnergy 8: TwoHandHandle 9: TwoHandLauncher10: OneHandGrenade11: OneHandMine12: OneHandLunchboxMine It is used like this: GetWeaponType weaponbaseid Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 I could have swore GetWeaponType was in his earlier code... What's even sadder is I was looking at the syntax for GetWeaponType the whole time and didn't catch the GetEquipType. What a bunch of jackasses. lol. Link to comment Share on other sites More sharing options...
Khet Posted June 2, 2009 Author Share Posted June 2, 2009 Actually, it's still returning as the FOPRMelee.... Unless there's something I've forgotten, heh. My brain's mush right now so I wouldn't be surprised. I've even tried removing the EquippedWeapon from set equipType to equippedWeapon.GetWeaponType with the same results. SCN FOPRProfessionScript ref EquippedWeapon Short equipType Begin GameMode set equippedWeapon to Player.GetEquippedObject 5 set equipType to equippedWeapon.GetWeaponType If (Player.IsWeaponOut) If (EquipType == 3 || EquipType == 4) Player.AddPerk FOPRPistol ElseIf (EquipType == 0 || EquipType == 1 || EquipType == 2) Player.AddPerk FOPRMelee ElseIf (EquipType == 5 || EquipType == 7) Player.AddPerk FOPRRifle ElseIf (EquipType == 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...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.