Andreas Posted February 10, 2020 I am experimenting with UDMF and... well... I am having issues getting my scripts to work. In game I get the error message "invalid ACS module". For context, here are all the steps I went through: 1) I started the map in Eureka but I needed to use ACS for some stuff, so I decided to switch to Slade 3. 2 I created a new WAD from scratch, in UDMF format, went to the previous wad and copy-pasted the map itself (not the lumps)... I know this will break actions and such, but I didn't mind since I only had 3 or 4 of them set up and had only placed a handful of things. So it wouldn't be too much work to fix. 3) I created a new lump which I called "SCRIPTS", made sure it was between A_START and A_END, then typed this in: #library "scripts" #include "zcommon.acs" script 1 (void) { print(s:"Hello world."); } script 2 (void) { FloorAndCeiling_LowerRaise (5, 8, 8); } 4) I hit the 'compile' button -- I bet you thought I'd forgotten this stage, eh? ;) 5) I created another lump called LOADACS with only one line in it: "SCRIPTS" 6) I then opened my map and reset all the actions to their correct UDMF counter-parts (teleports and switches gave me some difficulty, but I finally got them to work as expected) 7) I went to the linedef that needs to trigger script 2 and set its special to "80 ACS_Execute" with the "Player Cross" trigger and added the script # as first argument, leaving the second at 0 since it's for the current map. I think that covers everything. When I test run the game, right at the start the console says "invalid ACS module" and when I walk over the trigger line, it spurts out "P_StartScript: unknown script 2". What did I miss? BTW, when I compiled my script, I noticed that it automatically created a a BEHAVIOR lump... I thought that was for Hexen format only? Does UDMF use this too? I tried to delete it, but it just recreated it when I compiled the script again. And I don't know if this is significant, but the icon for the BEHAVIOR lump shows as a question mark with type 'Unknown'... 0 Quote Share this post Link to post
Gez Posted February 10, 2020 (edited) 11 minutes ago, Andreas said: 3) I created a new lump which I called "SCRIPTS", made sure it was between A_START and A_END, then typed this in: The source code (text lump) should not be between these markers. A_START and A_END are the namespace for compiled ACS only. You get a situation where the engine is trying to load the source code as bytecode, and of course it fails. 11 minutes ago, Andreas said: BTW, when I compiled my script, I noticed that it automatically created a a BEHAVIOR lump... I thought that was for Hexen format only? Also for UDMF maps. Why would it have a different name? Edited February 10, 2020 by Gez 0 Quote Share this post Link to post
Andreas Posted February 10, 2020 14 minutes ago, Gez said: The source code (text lump) should not be between these markers. A_START and A_END are the namespace for compiled ACS only. You get a situation where the engine is trying to load the source code as bytecode, and of course it fails. Also for UDMF maps. Why would it have a different name? It's just that everytime I've seen BEHAVIOR mentioned it seemed to imply that it was Hexen specific. Good to know anyway. So... I moved my SCRIPTS lump down under A_END, recompiled and... tada! the question mark icon on BEHAVIOR disappeared and it is now showing as compiled code, cool. However, my sript still won't run :o Now, when I start the game, console says "Could not find autoloaded ACS library SCRIPTS"... I also noticed that everytime I compile my scripts, a new BEHAVIOR lump appears (ie it does not overwrite the existing one) and the new one systematically pops up just above SCRIPTS, and *never* between A_START and A_END... is this normal? :o If those markers are for compiled ACS, shouldn't BEHAVIOR go between them? 0 Quote Share this post Link to post
Gez Posted February 10, 2020 BEHAVIOR was created for Hexen, and is used to distinguish between Doom format and Hexen format, however there's no reason why UDMF cannot use it either. There are two different ways to use ACS: As map scripts As library scripts Map scripts are available only in the associated map, libraries are available in all maps. The whole thing about LOADACS and the A_START/A_END namespace is for libraries. By convention, the source code to map scripts are in lumps named SCRIPTS, and when compiled it results in lumps named BEHAVIOR. You probably should use a different name for your library than "SCRIPTS" so as to stop confusing SLADE's ACS handling. But if you want to stick with it, rename BEHAVIOR to SCRIPTS and move it in the namespace. 0 Quote Share this post Link to post
Andreas Posted February 10, 2020 It took some trial and error, but I got my script to work! Pretty awesome. Thank you for the help Gez, doubt I'd have figured it out without you. The information in the wiki is very useful, but it doesn't always tell you HOW to do things. 0 Quote Share this post Link to post
Andreas Posted February 10, 2020 BTW, I just noticed that everytime I cross the linedef it executes the script again, despite the fact that I did NOT check the "repeatable" box for the ACS_Execute special... this is not wanted behavior. Can I block this from within the script? 0 Quote Share this post Link to post
Kappes Buur Posted February 10, 2020 (edited) 1 hour ago, Andreas said: BTW, I just noticed that everytime I cross the linedef it executes the script again, despite the fact that I did NOT check the "repeatable" box for the ACS_Execute special... this is not wanted behavior. Can I block this from within the script? I would doublecheck the activation flag. That can be done in ACS with a variable set to true. Then the script would check for the condition of the variable inside an if statement, execute the action and then set the variable to false, as to block any further action. That is especially useful if there are more then one linedef triggering the script. https://zdoom.org/zdkb/scriptdecisions.html Edited February 10, 2020 by Kappes Buur added the link 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.