Thanks for the response. I have done chapters 1-3 on the CK wiki. I'll take a look at yours but to follow through with more information here is my script (which is essentially a copy and paste from the wiki) along with the properties I have modified as best as could follow from what the wiki itself says to do.
This is what I have.
Scriptname HelloWorld extends ObjectReference
import Utility
Actor Property PlayerREF Auto
Float Property xOffset Auto ; Relative X position for the target
Float Property yOffset Auto ; Y Offset for Target
Float Property zOffset Auto ; Z offset for Target
Float Property RandomOffsetX Auto ; Randomness applied to X Offset. Initializes at 0.
Float Property RandomOffsetY Auto ;Randomness applied to Y Offset. Initializes at 0.
Float Property RandomOffsetZ Auto ; Randomness applied to Z Offset. Initializes at 0.
Float Property PulseRate = 1.0 Auto ; How often do we shoot?
Float Property RandomRate Auto ; Add random delay to pulse rate, capped at this value
Activator Property TargetType Auto ; What type of object are we zapping if we're spawning a node?
ObjectReference Property CurrentTarget Auto ; The actual target we're shooting at
Bool Property SpawnNode Auto ; Do we spawn a target? If not, zap the nearest valid target. Initializes 'False'
Spell Property Zap Auto ; What spell shall we use for the effect?
FormList Property TargetTypeList Auto ; List of potential targets
Float Property SeekRange = 1000.0 Auto ; The range it will "Lock into" a target if not making a node.
Event OnInit()
if CurrentTarget ;!= None
elseIf SpawnNode
float newXOffset = XOffSet + RandomFloat(-RandomOffsetX, RandomOffsetX)
float newYOffset = YOffSet + RandomFloat(-RandomOffsetY, RandomOffsetY)
float newZOffset = ZOffSet + RandomFloat(-RandomOffsetZ, RandomOffsetZ)
CurrentTarget = PlaceAtme(TargetType)
CurrentTarget.MoveTo(Self, newXOffSet, newYOffSet, newZOffSet)
endif
RegisterForSingleUpdate(PulseRate)
EndEvent
Event OnUpdate()
; find something nearby to shoot at if we're not making our own target.
if !SpawnNode && !TargetTypeList && GetDistance(PlayerREF) < SeekRange ; No list given, Default to the player if he is in range.
CurrentTarget = PlayerREF
elseif TargetTypeList
CurrentTarget = Game.FindClosestReferenceOfAnyTypeInListfromRef(TargetTypeList, Self, SeekRange)
endif
if CurrentTarget ; it's possible that there is no target
Zap.Cast(Self,CurrentTarget)
endif
RegisterForSingleUpdate(PulseRate + RandomFloat(0.0, RandomRate))
EndEvent
Here is a screenshot of my properties window for the script.