| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
hpl3:community:scripting:custom_user_modules [2017/06/12 13:54] abion47 [Global Functions] |
hpl3:community:scripting:custom_user_modules [2017/06/12 14:14] (current) abion47 [Getting Started] |
||
|---|---|---|---|
| Line 93: | Line 93: | ||
| }</code> | }</code> | ||
| - | Next, you need to add your module to your mod's "Modules.cfg" file. That file is an XML file that lists every module loaded when the game starts. (If your mod doesn't have a "Modules.xml" file, you can copy the one from SOMA's config folder to use as a starting point.) | + | Next, you need to add your module to your mod's "Modules.cfg" file. That file is an XML file that lists every module loaded when the game starts. (If your mod doesn't have a "Modules.cfg" file, you can copy the one from SOMA's config folder to use as a starting point.) |
| There are several attributes that need to be set for your module's entry. An entry looks like this: | There are several attributes that need to be set for your module's entry. An entry looks like this: | ||
| Line 265: | Line 265: | ||
| { | { | ||
| cScript_SetGlobalArgInt(0, alSomeInt); | cScript_SetGlobalArgInt(0, alSomeInt); | ||
| - | cScript_SetGlobalArgString(1, asSomeString); | + | cScript_SetGlobalArgString(1, asSomeString); |
| - | cScript_RunGlobalFunc("SomeHandler", "", "_Global_DoSomeWork"); | + | cScript_RunGlobalFunc("SomeHandler", "", "_Global_DoSomeWork"); |
| - | + | ||
| - | return cScript_GetGlobalResultBool(); | + | return cScript_GetGlobalResultBool(); |
| }</code> | }</code> | ||
| Line 280: | Line 280: | ||
| { | { | ||
| bool abResult = SomeModule_DoSomeWork(alSomeInt, asSomeString); | bool abResult = SomeModule_DoSomeWork(alSomeInt, asSomeString); | ||
| - | + | | |
| - | // Do some nonsense with the result | + | // Do some nonsense with the result |
| }</code> | }</code> | ||