Jump to content

Help with keyword based Script


MPankey

Recommended Posts

I'm about 70% percent of the way through a remote detonated explosives mod but I keep hitting a wall with the scripting. I've got a script function to check all objects for a certain keyword in a certain radius. However the script never detects the objects. I know it's running because of a debug messenger in the script but it doesn't ever find anything with the keyword. After researching similar scripts I found that the keyword referenced doesn't seem to be the same as the usual type you can easily add to objects? What type of keyword do I need to add to the objects and how.or how can I have the script check for a normal keyword? I'm at my wits end here, any help would be appreciated.
Link to comment
Share on other sites

ScriptName RDE_DetonationScript extends ObjectReference


;Weapon Property RDE_C4PlasticExplosive Auto Const

Keyword Property pRemoteExplosive Auto Const

; float Property WorkingRadius Auto Const


Event OnEquipped(Actor akActor)

If (akActor == Game.GetPlayer())

RegisterForAnimationEvent(akActor, "WeaponFire")

EndIf

EndEvent


Event OnUnequipped(Actor akActor)

If (akActor == Game.GetPlayer())

UnregisterForAnimationEvent(akActor, "WeaponFire")

EndIf

EndEvent


Event OnAnimationEvent(ObjectReference akSource, string asEventName)

ObjectReference[] RemoteExplosiveList = akSource.FindAllReferencesWithKeyword(pRemoteExplosive, 5000.0)

;ObjectReference[] RemoteExplosiveList = akSource.FindAllReferencesOfType((RDE_C4PlasticExplosive as Weapon),5000.0)

int i = 0

Debug.Notification(RemoteExplosiveList.Length + " explosives within range. First: " + RemoteExplosiveList[0])

While (i < RemoteExplosiveList.Length)

Debug.Notification("i = " + i)

RemoteExplosiveList.DamageObject(100)

i += 1

EndWhile

EndEvent
Link to comment
Share on other sites

Ok question, you are throwing mines, then having a remote detonator?

 

Why not run a oninit on the mines to add to a refcol on a quest, and when you get the animation event to detonate run a 0,0 timer on the quest which 'should' run on each individual and then do a get distance to playerref, and if < whatever, BOOOM BABY

 

Just sayin, could probably rig it up in no time and then it stores all the mines you've thrown always so you can detonate mines you placed days ago or some s#*&#33; if you are within range

Link to comment
Share on other sites

That does sound better than a script. I think. I just made my first mod last week so most of what you just said I didn't understand. I haven't even started looking at using quests to do things. I wouldn't have any idea on how to set that up.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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