![]() |
[SCRIPT] Using Global.hps to use a script in every level - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: [SCRIPT] Using Global.hps to use a script in every level (/thread-21486.html) Pages:
1
2
|
RE: Using Global.hps to use a script in every level - Your Computer - 05-15-2013 The global.hps file can call functions, though only the HPL2 functions and the ones defined in it (since HPS files cannot access each other), but most of the HPL2 functions aren't practical for the global.hps file since the file is compiled and loaded before any map is loaded. I use it mostly for blocking default hints and disabling darkness sanity loss. RE: Using Global.hps to use a script in every level - Tomato Cat - 05-15-2013 (05-15-2013, 01:40 AM)Your Computer Wrote: The global.hps file can call functions, though only the HPL2 functions and the ones defined in it (since HPS files cannot access each other), but most of the HPL2 functions aren't practical for the global.hps file since the file is compiled and loaded before any map is loaded. I use it mostly for blocking default hints and disabling darkness sanity loss. So that's why classes don't work across .hps files? RE: Using Global.hps to use a script in every level - Your Computer - 05-15-2013 (05-15-2013, 01:51 AM)Tomato Cat Wrote: So that's why classes don't work across .hps files? They can't be accessed across HPL2 scripts because they're not saved to be accessed across multiple scripts, unlike the map variable functions. RE: Using Global.hps to use a script in every level - Apjjm - 05-15-2013 (05-15-2013, 01:26 AM)JustAnotherPlayer Wrote: Ok, so it can't do so. Can it do the include command by Apjjm?The only way to get a separate script file to run in every map is to use a bit of a hack like including a preprocessor to add stuff like #include. This is akin to just pasting the script at the top of all your script files though, except you have some tool do it all for you automatically, and you only have to make changes in one place if you mess something up. To re-iterate what people have said about global.hps, i think it only runs once as soon as the custom story is started (or new game pressed). You can't add timers or any stuff like that using it. Even if it was run at the start of every map, classes and such in one script file are only in the scope of that script file in amnesia. RE: Using Global.hps to use a script in every level - PutraenusAlivius - 05-15-2013 Shit, no global timers for me. RE: Using Global.hps to use a script in every level - Apjjm - 05-15-2013 (05-15-2013, 03:37 AM)JustAnotherPlayer Wrote: Shit, no global timers for me. Global timers can still be done but it is a huge hack. Spoiler below!
RE: Using Global.hps to use a script in every level - PutraenusAlivius - 05-15-2013 The time unit is ms right? RE: Using Global.hps to use a script in every level - Apjjm - 05-15-2013 (05-15-2013, 04:42 AM)JustAnotherPlayer Wrote: The time unit is ms right?The time unit for the global timers stuff should be the same as the time unit for normal timers, i.e. in seconds. |