Pyrathas Posted February 5, 2018 Author Share Posted February 5, 2018 Here is one problem: EVENT onActivate(objectReference akActivatingRef) if akActivatingRef == BadLever !beenActivated beenActivated = TRUE ActivateTrap() elseif akActivatingRef == Lever !beenActivated beenActivated = TRUE UnlockShackle() endif EndEvent In the OnActivate event the passed in variable akActivatingRef (akActionRef in stock scripts) is the object reference that activated the object holding the script.àIn otherwords, you are comparing the player or an NPC to your levers.àThey obviously don't match and thus halts the script.So it should be akActionRef?Doesn't matter if you call the variable akActionRef, akActivatingRef, or TheGuyWhoYankedTheLever. The problem is that the variable contains the object reference of the actor that activated the activator. To break it down, your script is basically saying this: If the player character is the same thing as this lever then do this stuff otherwise do nothing.The result is, your script does nothing. If the script is on the lever(s), try comparing to self instead. i.e. If self == lever ;do stuff EndIfBut wouldnât the script mess up on the NPC since on sir it restrained them? I tried placing it on the shackles and contemplating putting it on an x marker to link ref them Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 5, 2018 Share Posted February 5, 2018 You might need more than one script... Link to comment Share on other sites More sharing options...
Pyrathas Posted February 5, 2018 Author Share Posted February 5, 2018 So maybe put the shackles and set restraint on shackles and one per on levers? Link to comment Share on other sites More sharing options...
Pyrathas Posted February 5, 2018 Author Share Posted February 5, 2018 Would keyword script reference work for encompassing NPCs? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 5, 2018 Share Posted February 5, 2018 So maybe put the shackles and set restraint on shackles and one per on levers?If where you have the script now keeps the NPCs in place within shackles, then keep those necessary portions of the script there. Additionally, you will need one script per lever to do whatever needs done when the lever is pulled. It could be the same script reused if coded correctly. However, separate scripts might be easier. Would keyword script reference work for encompassing NPCs?I do not know. Link to comment Share on other sites More sharing options...
Pyrathas Posted February 5, 2018 Author Share Posted February 5, 2018 Ok Iâll give it a try Link to comment Share on other sites More sharing options...
Recommended Posts