Jump to content

Calling a Function in a Different Script


LoginToDownload

Recommended Posts

Let's say I have two scripts attached to the same Actor Base. MyFunctionScript and MyUpdateScript (Yes, this is absolutely necessary). MyFunctionScript says:

 

scriptname MyFunctionScript Extends Actor Conditional

Function MyFunction()
  ;Do stuff
EndFunction

 

MyUpdateScript says:

MyFunction()

 

MyUpdateScript fails to compile, telling me MyFunction isn't a function or doesn't exist. This also occurs if I use a variable (MyActorBase) to hold the ActorBase in question. I can't actually turn MyFunctionScript into an ActorBase script, because it uses reference-specific junk like IsDead().

 

Admittedly, I don't understand the Conditional tag whatsoever, and have failed to find any real tutorial for it. In the past, I've only ever called custom functions in the script they were made, or using kMyQuest. Can anyone enlighten me?

Edited by LoginToDownload
Link to comment
Share on other sites

Thank you - that might be useful to me, depending on how the CK decides which scripts are responsible for what - but won't that just create an entirely new MyFunctionScript to go along with the MyFunction call?

 

EDIT: I'm an idiot and the Conditional flag does something completely different. I don't know what I was thinking. I guess my questions are answered, and I can just hope that's enough if I override smartly. Thank you again.

Edited by LoginToDownload
Link to comment
Share on other sites

  • Recently Browsing   0 members

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