Alundaio Posted June 2, 2009 Share Posted June 2, 2009 No problem. Glad to help. I enjoy your mod very much btw. Link to comment Share on other sites More sharing options...
Khet Posted June 2, 2009 Author Share Posted June 2, 2009 Actually, after some initial testing, found a problem. Now, the combat check is working great. However, I adding perks (unhidden for testing purposes) to the player based on what weapon they have equipped. What's happening however, is that ALL of the perks are being added, EXCEPT for the one corresponding to the proper weapon. I've been testing with a Chinese Assault Rifle, and the AutoDamage perk isn't added, but the rest are. I dunno if it's just because FOSE is different and I've never worked with these before, or if it's because there's something I'm missing. Edit: I take back what I said. I just checked again, initiating combat with a pistol this time. The Pistol, melee and Rifle perks are added, but not the Auto. scn FOPRProfessionScript ref equippedWeapon ref equipType Begin GameMode set equippedWeapon to Player.GetEquippedObject 5 set equipType to GetEquipType equippedWeapon ;Check if player has a pistol equipped If EquipType == 3 || 4 && Player.IsInCombat == 1 Player.AddPerk FOPRWeapExp Player.AddPerk FOPRPistolDamage Else Player.RemovePerk FOPRWeapExp Player.RemovePerk FOPRPistolDamage EndIf ;Check if player has a melee weapon equipped (all types) If EquipType == 0 || 1 || 2 && Player.IsInCombat == 1 Player.AddPerk FOPRWeapExp Player.AddPerk FOPRMeleeDamage Else Player.RemovePerk FOPRWeapExp Player.RemovePerk FOPRMeleeDamage EndIf ;Check if player has a 2hand rifle or energy rifle equipped If EquipType == 5 || 7 && Player.IsInCombat Player.AddPerk FOPRWeapExp Player.AddPerk FOPRRifleDamage Else Player.RemovePerk FOPRWeapExp Player.RemovePerk FOPRRifleDamage EndIf ;Check if player has a 2hand automatic equipped If EquipType == 6 && Player.IsInCombat == 1 Player.AddPerk FOPRWeapExp Player.AddPerk FOPRAutoDamage Else Player.RemovePerk FOPRWeapExp Player.RemovePerk FOPRAutoDamage EndIf End This is what I'm basing the EquipType numbers off of the FOSE website. 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 Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 Might want to add a checker to see if the Player.HasPerk before you add it. Because it's going to add it a billion times. Also probably should make them ElseIf statements. Link to comment Share on other sites More sharing options...
Khet Posted June 2, 2009 Author Share Posted June 2, 2009 Yeah, I just slapped everything together just to see if I could get it running. I just can't figure out why they're adding the wrong perks, unless I've set something up wrong. Like I said, I've never used FOSE commands until now. Edit: I did end up switching them to ElseIf commands, and now only the pistol is being added. I then switched the pistol with melee and only the melee was added. Only thing I can think of is my references aren't coming back properly. Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 You may need GetBaseObject. set equippedWeapon to Player.GetEquippedObject 5set equippedWeapon to GetBaseObject equippedWeaponset equipType to GetEquipType equippedWeapon Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 This would be a fantastic way to add back in the Classic Fallout Traits. This would be a perfect way to do the One Handed Trait. Bright Idea you have. Link to comment Share on other sites More sharing options...
Khet Posted June 2, 2009 Author Share Posted June 2, 2009 Heh, thanks. It's actually going to be an optional compliment to my Alternate Start mod. It brings back some of the feel from previous Fallouts though the main idea came from an old RPG called Arcanum (basically you chose histories that affected your starting characters) I'll make those changes and see what happens. Edit: GetBaseObject is returning a Syntax error. Reference function "GetBaseObject" requires explicit reference in quest script. Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 Are you putting this in a Quest Script? I would recomend putting it as an Objectscript on a non-playable piece of armor and add it to the player. Tokens are alot easier to work with. Link to comment Share on other sites More sharing options...
Khet Posted June 2, 2009 Author Share Posted June 2, 2009 I thought object scripts only worked if the item was equipped? Or am I wrong about this. Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 Here's what you do: 1) Create a piece of armor and put the script you want to run. (add TOKEN to the end of the name so you know what it is) 2) Uncheck Playable and check Quest item3) add it to the player Now you can do what ever in the GameMode block or whatever block you plan on. The script will run as long as that TOKEN is in the player's inventory. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.