Aller au contenu

Photo

Question about executing scripts from UI


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

Hello everyone.

Is there a way to automatically execute a server script whenever a UI is opened?



#2
kevL

kevL
  • Members
  • 4 056 messages

probly like so, in <UIScene>

scriptloadable="true" OnAdd='UIObject_Misc_ExecuteServerScript("gui_script_file")'

(maybe OnCreate is better than OnAdd, idk)


- note that gui's recompile the .Nss on-the-fly
- and, also not sure, but it's a good idea to preface the .Nss filename w/ "gui_"


  • Clangeddin86 aime ceci

#3
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

probly like so, in <UIScene>

scriptloadable="true" OnAdd='UIObject_Misc_ExecuteServerScript("gui_script_file")'

(maybe OnCreate is better than OnAdd, idk)


- note that gui's recompile the .Nss on-the-fly
- and, also not sure, but it's a good idea to preface the .Nss filename w/ "gui_"

 

OnAdd worked, thanks.