Jump to content

Photo

"OnActivate" doesn't work.

scripting coding onactivate morrowind help support programming script tescs

  • Please log in to reply
2 replies to this topic

#1
Ganguro

Ganguro

    Journeyman

  • Members
  • Pip
  • 45 posts

I made an NPC with the following script:

Begin DisabledNPCScript

    short done

        if (done==0)
            disable
            set done to 1
        endif

End DisabledNPCScript

Then I made a door, which, once activated, will enable the NPC.

I gave it the following script:

Begin EnableDisabledNPC

    short done
        
        if (done==1)
            return
        endif

        if ( OnActivate == 1 )
            DisabledNPC->Enable
            Activate
        endif

End EnableDisabledNPC

The game complains about the "EXPRESSION" and "Right Eval" which means that "OnActivate" is an incorrect expression and that it's also not defined in the script.

What am I supposed to define it as? It's neither a short, nor a float.

 

Or is OnActivate simply just broken?
Help!



#2
abot

abot

    Faithful poster

  • Premium Member
  • 1,281 posts
spacing is important, try this:
if ( done == 1 )

#3
FIMzzZzz

FIMzzZzz

    Enthusiast

  • Members
  • PipPip
  • 116 posts

are you referencing "done == 1" in the door script from the npc script? if so, this is a local variable, and can only be referenced inside the same script. you can use global variables to circumvent this.

 

instead of enable you could also use PositionCell to teleport the npc from a "npc holding cell" this would only require a script on the door. (not 100% sure, maybe even possible with one script and enable)







Also tagged with one or more of these keywords: scripting, coding, onactivate, morrowind, help, support, programming, script, tescs

IPB skins by Skinbox
Page loaded in: 1.204 seconds