Jump to content

Photo

How Do You Set a Global Variable?


  • Please log in to reply
2 replies to this topic

#1
David Brasher

David Brasher

    Veteran

  • Members
  • PipPipPipPipPip
  • 4,909 posts
The computer does not like these lines:

AAMyGlobalVariable.SetValueInt(1)

AAMyGlobalVariable.SetValue(1)

AAMyGlobalVariable = 1

It always moans and whines about my global variable being undefined. It is a freaking global variable! I would think that it would by definition have to be defined.


Starting 1 compile threads for 1 files...
Compiling "TIF__01001D9C"...
c:\games\skyrim\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__01001D9C.psc(10,0): variable AAMyGlobalVariable is undefined
c:\games\skyrim\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__01001D9C.psc(10,0): type mismatch while assigning to a none (cast missing or types unrelated)
No output generated for TIF__01001D9C, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__01001D9C


Is there some sneaky trick I don't know?

#2
omega2008

omega2008

    Old hand

  • Members
  • PipPipPip
  • 579 posts
add this to your script right after your ScriptName:

GlobalVariable Property AAMyGlobalVariable Auto

then go to your item the script is attached and go to the script properties and select the respective global.

Every item like that should be defined that way, items, spells, imagespacemodifiers etc... Hope I was helpful

Edited by omega2008, 14 February 2012 - 06:48 AM.


#3
Cipscis

Cipscis

    Scripter

  • Premium Member
  • 1,275 posts
Take a look at this for a longer description of the issue - EditorIDs in Papyrus

Cipscis




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Page loaded in: 0.822 seconds