Jump to content

For Dummies: How to use PlaceAtNode?


Recommended Posts

I'm currently working on weapon mod parts that turn an ordinary gun into an exploding trap gun. The idea is that, if someone pulls the trigger on it, it blows up in their face and destroys the weapon. That sounded pretty simple at first.

 

Now I've hit a roadblock. I'm trying to use PlaceAtNode to center the explosion on the user's hand, but I can't get it to work no matter what I do. It just does nothing. No explosion, no damage - nothing.

 

Here's my code. It's probably not pretty, but it's simple.

 

 

Scriptname Cyclone:RemoveEquippedWeapon extends activemagiceffect



Projectile[] Property paExplosion Auto Const



ActorValue Property CYCAVCurseStrength Auto Const



Actor rUser



Event OnEffectStart(Actor akTarget, Actor akCaster)



    rUser = akCaster

    RegisterForAnimationEvent(akCaster, "WeaponFire")



EndEvent



Event OnAnimationEvent(ObjectReference akSource, string asEventName)

    if (akSource == rUser)

        if (asEventName == "WeaponFire")

            Int iBoom = ((rUser.GetValue(CYCAVCurseStrength) - 1) / 3) as int

            if (iBoom > 3)

                iBoom == 3

            elseif (iBoom < 0)

                iBoom == 0

            endif

            akSource.PlaceAtNode("RArm_Hand", paExplosion[iBoom])

            rUser.RemoveItem(rUser.GetEquippedWeapon(), 1, true)

        endif

    endif

EndEvent

 

 

 

Where am I going wrong?

Link to comment
Share on other sites

I think a week's long enough for a bump on this. I still have no idea how to use PlaceAtNode, or if it's even usable in the way I want to use it.

 

I've tried setting the weapon's projectile to one that instantly explodes, but that makes the AI evaluate the weapon accordingly, which makes them try to use it at point blank range. This isn't ideal behavior, as I'd like the weapon to be as equally dangerous to NPCs as it is to unwary players. Just using PlaceAtMe with a projectile spawned by the script doesn't work the way I want it, either, as that means it's not usually centered on the gun.

 

How can I accomplish what I'm trying to do?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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