Jump to content

Local variable + global function


DavidD

Recommended Posts

Hey there!

 

I'm trying to call a function from another script. Obviously making it global is the way to to.

 

When trying to call it the game thinks it's undeclared. Understandable since it can't know that it is.

 

GlobalVariable property foo auto

 

function func()

foo.SetValueInt(1)

foo.GetValueInt()

endFunction

 

Both get and set will fail so I thought that I could use a local variable. Nope. Global function calling a local function? Nope.

 

Does anyone have any idea what to do? I'm experienced in programming just not papyrus so you don't have to explain like I'm 5 (hopefully)

Edited by DavidD
Link to comment
Share on other sites

Hey there!

 

I'm trying to call a function from another script. Obviously making it global is the way to to.

 

When trying to call it the game thinks it's undeclared. Understandable since it can't know that it is.

 

GlobalVariable property foo auto

 

function func()

foo.SetValueInt(1)

foo.GetValueInt()

endFunction

 

Both get and set will fail so I thought that I could use a local variable. Nope. Global function calling a local function? Nope.

 

Does anyone have any idea what to do? I'm experienced in programming just not papyrus so you don't have to explain like I'm 5 (hopefully)

 

I guess that would work. I seem to have misunderstood the inheritance.

 

Thank you, I'll test and see if it'll work

Link to comment
Share on other sites

  • Recently Browsing   0 members

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