Recent changes Random page
GAMING
Gaming
 
WoWWiki
Halopedia
FFXIclopedia
Age of Conan
Warhammer Online
Grand Theft Wiki
See more...

Combine several scripts to sctivate on the same event

From NWNWiki

Jump to: navigation, search

The frustrating way is to copy and paste all the scripts in to one and pray just before hitting the "compile" button. Chances are, they won't compile for several reasons.

I found it much easier to do it the following way instead. I'll use the OnHartbeat handle for example and lets say I have 3 scripts I want to combine.

  • Save each script with its own name (i.e "hartbeat_01", "hartbeat_02", "hartbeat_03" or whatever you desire)
  • In the Actual OnHartbeat in which you want all of these to run, write a new script like this one.
void main()
{
    ExecuteScript("hartbeat_01",OBJECT_SELF);
    ExecuteScript("hartbeat_02",OBJECT_SELF);
    ExecuteScript("hartbeat_03",OBJECT_SELF);
}

That's all there is to it! Now they each run in the OnHartbeat of the object, area, or module they are attached to without you having to "re-script" to get them to compile.

Rate this article:
Share this article: