How do I link script files together?

From OHRRPGCE-Wiki

Jump to: navigation, search

Why, with the include command, of course!

include, another.hss

You may recognize this command from other standard definitions, such as:

include, plotscr.hsd  #must be at the top of every HSS file.
include, scancode.hsi #constants for the key codes, for use with "key is pressed"

In some cases, to make working on a game with multiple people easier, or if you want to use pre-made scripts like the Third Party HSI, or for organisational purposes, you will want to use seperate script files and join them together.

Also, any filename with any extension can be included. People tend to use the extensions .hss for script files, .hsi for pre-made script collections, and .hsd for the embedded function definitions.

[edit] Example

Let's say you have a script file, first.hss:

include, plotscr.hsd

plotscript, script one, begin
  #whatever
end

include, second.hss

Note the include at the bottom. Here is second.hss:

plotscript, script two, begin
  #whatever
end

Now, when you run first.hss through HSPEAK, it will turn it into this:

plotscript, script one, begin
  #whatever
end

plotscript, script two, begin
  #whatever
end

[edit] See Also

Personal tools