Jump to content

Have a new mod idea


Khet

Recommended Posts

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

  • Replies 50
  • Created
  • Last Reply

Alright, switching 5 to 4 (to check right hand) here's what happens.

 

Chinese Assault Rifle - FOPRPistol AND FOPRMelee

10mm Pistol - FOPRMelee

chinese Pistol - FOPRMelee

Brass 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

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

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

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

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: GetWeapType

Parameters:1

item:InventoryObject

Return Type: WeaponType:Integer

Opcode: 0x1409 (5129)

Condition Function: No

Introduced In: 1

Calling Convention: E

Description: 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: TwoHandLauncher

10: OneHandGrenade

11: OneHandMine

12: OneHandLunchboxMine

 

It is used like this:

 

GetWeaponType weaponbaseid

Link to comment
Share on other sites

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

Archived

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

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...