Jump to content

[LE] Scripting Newb needs help (Script inside).


Pyrathas

Recommended Posts

 

 

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
EndIf

But 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

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

  • Recently Browsing   0 members

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