Jump to content

Instance Data Scripting help


RedxYeti

Recommended Posts

im trying to set every weapon thats equipped by the player to use the mini nuke.

 

Import InstanceData

Formlist Property FatmanProjectile Auto

Event OnItemEquipped(Form akBaseObject, ObjectReference akReference)
	if akBaseObject as Weapon
		InstanceData:Owner thisInstance = Game.GetPlayer().GetInstanceOwner(35)
		InstanceData:Owner thatInstance = Game.GetPlayer().GetInstanceOwner(34)
		SetProjectileOverride(thatInstance, FatmanProjectile)
		SetProjectileOverride(thisInstance, FatmanProjectile)
	EndIf
EndEvent

this is what i have right now and it compiles fine and as far as i know should work, but the 10mm pistol still just shoots its normal projectile. (i only did 34 and 35 to see if i was using the wrong hand)

do i need to do something else to weapons before calling the SetProjectileOverride?

Link to comment
Share on other sites

Try slot 41, that's the equipped weapon's slot.

Function SetEquippedWeaponAmmo(Actor akActor, Ammo newAmmo)
	Weapon akWeapon = akActor.GetEquippedWeapon()
	If akWeapon
		InstanceData:Owner akOwner = akActor.GetInstanceOwner(41)  ; 41 is the weapon equip slot
		InstanceData.SetAmmo(akOwner, newAmmo)		; maybe it's SetProjectileOverride
	EndIf
EndFunction

 

Link to comment
Share on other sites

  • 2 weeks later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...