Jump to content

Have a new mod idea


Khet

Recommended Posts

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

  • Replies 50
  • Created
  • Last Reply

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

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

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...