Jump to content

Anyone know how this script might be written - Fire Weapon = Spawn Something


Recommended Posts

Hi there,

 

I was looking at the bloatfly syringe script and trying to figure out how I would change it to 100% spawn bloatfly on fire.

Anyone have any ideas? Any suggestions would be greatly appropriated! Many thanks. :) :)

 

Scriptname damageBloatflyLarvaPoisonSCRIPT extends ActiveMagicEffect
;the bloatfly we're spawning
OBJECTREFERENCE PROPERTY bloatfly AUTO
;the explosino to play when it comes out
EXPLOSION PROPERTY flyExplosion AUTO
ACTOR victim
EVENT OnEffectStart(Actor akTarget, Actor akCaster)
;save off the victim
victim = akTarget
ENDEVENT
EVENT OnDying(Actor akKiller)
;play the explosion, spawn the fly
victim.placeAtMe(flyExplosion)
victim.Dismember("Torso", TRUE, TRUE)
ENDEVENT
Link to comment
Share on other sites

The script spawns a bloatfly OnDying. The effect lasts 30 seconds so if you kill the npc before the effect is worn off , it will spawn a bloatfly. I`m not sure what you want to achieve. If you want it to spawn a bloatfly as soon as you hit an npc with the syringe , you move the spawning part to the EffectStart :

 Scriptname damageBloatflyLarvaPoisonSCRIPT extends ActiveMagicEffect

EVENT OnEffectStart(Actor akTarget, Actor akCaster)
akTarget.placeAtMe(flyExplosion)
akTarget.Dismember("Torso", TRUE, TRUE)
ENDEVENT

Just don`t change the exsting script, better create your own effect with a new script.

Edited by kitcat81
Link to comment
Share on other sites

The script spawns a bloatfly OnDying. The effect lasts 30 seconds so if you kill the npc before the effect is worn off , it will spawn a bloatfly. I`m not sure what you want to achieve. If you want it to spawn a bloatfly as soon as you hit an npc with the syringe , you move the spawning part to the EffectStart :

 Scriptname damageBloatflyLarvaPoisonSCRIPT extends ActiveMagicEffect

EVENT OnEffectStart(Actor akTarget, Actor akCaster)
akTarget.placeAtMe(flyExplosion)
akTarget.Dismember("Torso", TRUE, TRUE)
ENDEVENT

Just don`t change the exsting script, better create your own effect with a new script.

 

Heya, thanks for that :P I'll give it a go. I just wanted to spawn an animal when the gun is fired, was trying to use the bloatfly script as a base for that. xD

 

Scripts are like a foreign language to me at the moment.. Once again, thanks a lot! :)

Link to comment
Share on other sites

You could add a custom projectile with an explosion that will spawn the bloat fly, like how the synth relay grenades work, but this will spawn a bloat fly every time you hit something with the weapon, not just when you kill something.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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