Water Arrows

Post » Thu Apr 14, 2016 3:56 am

Just started trying to make water arrows. This is my mgef that's attached to my enchantment that's attached to my explosion which is attached to my projectile.



Scriptname AceWaterArrowScript extends activemagiceffect

Formlist Property MyList Auto ;A formlist with all light sources in it.

Event OnEffectStart(Actor akTarget, Actor akCaster)

ObjectReference LightSource = Game.FindClosestReferenceOfAnyTypeInList(MyList, 0, 0, 0, 10000)
LightSource.Disable()
LightSource.Delete()

EndEvent

The water arrow explodes with a water splash so the explosion is going off. I added every light to the formlist for testing purposes. I'm not even sure how I'm going to swap the lit meshes for put out meshes or how I'd make sure the lights come back after a while. Off to a great start!


Anyway, my script doesn't seem to do anything. Why?

User avatar
josie treuberg
 
Posts: 3572
Joined: Wed Feb 07, 2007 7:56 am

Post » Wed Apr 13, 2016 3:50 pm

Does it even compile? The FindClosestReferenceOfAnyTypeInListFromRef function takes three parameters, and you gave it five. Your three zero floats are supposed to be an object reference. Maybe akTarget or akTarget.GetReference()?
User avatar
sam smith
 
Posts: 3386
Joined: Sun Aug 05, 2007 3:55 am

Post » Thu Apr 14, 2016 3:54 am

This is the example given: ObjectReference closestGem = Game.FindClosestReferenceOfAnyTypeInList(GemList, 0.0, 0.0, 0.0, 5.0), it has 5 too. I edited to make it easier to read.


The example didn't give it object references but adding aktarget doesn't allow the script to comile.



Edit: I see what you mean now. It's sort of working but it seems to only work if the player is in the radius of the 300, otherwise aiming for a light source doesn't delete it.



Event OnEffectStart(Actor akTarget, Actor akCaster)

ObjectReference LightSource = Game.FindClosestReferenceOfAnyTypeInList(MyList, akTarget.X, akTarget.Y, akTarget.Z, 300);10k was for testing
;LightSource.Disable()
LightSource.Delete()

EndEvent


Example. There's a candle on the floor, I aim for at a distance, nothing happens. I come close to it and aim for my feet, the lightsource is disabled. Probably because actor akTarget is looking for an actor lol.. Not sure how to point to self. I'd prefer not to create an actor at the point of impact and then quickly remove it.


Btw, it it dangerous to put all light sources in the formlist?

User avatar
Miragel Ginza
 
Posts: 3502
Joined: Thu Dec 21, 2006 6:19 am


Return to V - Skyrim