Jump to content

Photo

Hit With Projectile, Recover Alternate Item

projectile ammo script

  • Please log in to reply
No replies to this topic

#1
SurgicalScar

SurgicalScar

    Newbie

  • Members
  • Pip
  • 16 posts

Hey! Right, so I've been trying to figure my way around this new engine for a while now and I've started to run into a few issues. Currently, my problem is as follows:

 

1) A mod added to the Railway Rifle allows it to five spikes with a custom ammo type & projectile type (flechette bundles).

2) Given that the projectile is typed as an 'Arrow', it seems to have a random chance of adding duplicates of said ammo to the target's inventory (I could switch it to 'Missile', but this looks rather shoddy in-game).

3) Unfortunately, as this is called on each impacting projectile, this can lead to an NPC having more ammo on them than they were shot with.

 

Basically, what I'd like to do is:

 

A) Create a new Projectile base type with the properties of 'Arrow', but without the chance to duplicate itself.

 

or

 

B) Figure some way of scripting the projectiles to add standard Rail Spikes (my preference) whilst deleting any incidences of the custom ammo type.

 

Regarding B, I'd tried to get this to work by applying a dummy explosion to the custom projectiles, then adding an enchantment w/ effect to add and remove the relevant ammo types. However, this resulted in the projectiles having no impact data against static objects in-game, nor did the ammo add/remove itself.

 

The script I ran:

Scriptname ERRBurstAmmoScript extends activemagiceffect

Actor Property akTarget Auto
Ammo Property AmmoRRSpike Auto
Ammo Property ERRBurstAmmo Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)

akTarget.AddItem(AmmoRRSpike, 1, true)
akTarget.RemoveItem(ERRBurstAmmo, 5, true)

endevent

So, yeah. It's a massive fustercluck, but hopefully smarter people than I can work it out.

 







Also tagged with one or more of these keywords: projectile, ammo, script

IPB skins by Skinbox
Page loaded in: 0.986 seconds