MPankey Posted May 31, 2016 Share Posted May 31, 2016 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 More sharing options...
FrankFamily Posted May 31, 2016 Share Posted May 31, 2016 Afaik http://www.creationkit.com/fallout4/index.php?title=FindAllReferencesWithKeyword_-_ObjectReference uses "normal" keywords, the ones you add to stuff, make a property and use it as parameter. Is that what you are using? Link to comment Share on other sites More sharing options...
MPankey Posted May 31, 2016 Author Share Posted May 31, 2016 Yep. But it's not working for some reason. Link to comment Share on other sites More sharing options...
Reneer Posted May 31, 2016 Share Posted May 31, 2016 Please post your script. :) Link to comment Share on other sites More sharing options...
MPankey Posted May 31, 2016 Author Share Posted May 31, 2016 I will when I get of work. Thank you for being willing to help! Link to comment Share on other sites More sharing options...
Reneer Posted May 31, 2016 Share Posted May 31, 2016 No problem. I'll definitely take a look when you post it and see what I can find. Link to comment Share on other sites More sharing options...
MPankey Posted June 1, 2016 Author Share Posted June 1, 2016 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 More sharing options...
MPankey Posted June 1, 2016 Author Share Posted June 1, 2016 You can see some of the alternative code we've tried hiddin with semicolons. teh keyword "pRemoteExplosive" was added to all mines Link to comment Share on other sites More sharing options...
DDProductions83 Posted June 1, 2016 Share Posted June 1, 2016 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#*! if you are within range Link to comment Share on other sites More sharing options...
MPankey Posted June 1, 2016 Author Share Posted June 1, 2016 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 More sharing options...
Recommended Posts