Kaiser Posted June 29, 2012 So I am trying to compile a simple ACS script for Hexen (using Chocolate Doom branch) and the game crashes (no I_Error message or anything) whenever the script is executed. My script is something like this: #include "common.acs" script 1 (void) { print(s: "testing"); } I use the script editor in Doom Builder 2 to edit my script. After that I make sure the script type is set to HEXEN ACS and I compile that script before saving my map. Something that I am missing here? 0 Share this post Link to post
Edward850 Posted June 29, 2012 It sounds like it's not compiling using the hexen bytecode, which is odd, because the hexen format should automatically be using it. Are you sure you have selected to correct game/map configuration? Failing that, you could cheat and add '-h' to the parameters in /Scripting/Zdoom_ACS.cfg. 0 Share this post Link to post
Kaiser Posted June 29, 2012 Doesn't seem to fix it. Also this is for vanilla Hexen, I doubt I would want to use a version of ACC that was modified to work for Zdoom. 0 Share this post Link to post
DaniJ Posted June 29, 2012 Well, your script looks nothing like vanilla Hexen ACS. I can see at least two Zdoom features in just that short snippet. 0 Share this post Link to post
Kaiser Posted June 29, 2012 To be fair I've noticed that vanilla hexen doesn't support low-case strings so that's one thing I've caught. But everything else should work on Hexen. Hexen supports both print and printbold routines. 0 Share this post Link to post
DaniJ Posted June 29, 2012 Can you post the whole of the problem script? Its hard to say what the issue might be without it. 0 Share this post Link to post
Kaiser Posted June 29, 2012 That is the whole script. Though I am starting to think it's Doom Builder that's not saving the compiled script properly. 0 Share this post Link to post
DaniJ Posted June 29, 2012 Tried compiling it with the standalone compiler? 0 Share this post Link to post
Kaiser Posted June 29, 2012 Actually I had to download the original ACC executable from idgames and then manually saved the *.O file as the behavior lump and that seems to work. Also just realized that there's several duplicated SCRIPTS lumps inserted in my test wad. I can assume that's a bug... 0 Share this post Link to post
Gez Posted June 29, 2012 Something I've noticed about Doom Builder is that it tends to append two null bytes to script lumps. E.g., I'd create a brand new UDMF map without any sort of scripting, and it'd give me 2-byte DIALOGUE and SCRIPTS lumps that only contain 00 00. If it does the same thing to the BEHAVIOR lump, it might explain the problem? Kaiser said:Doesn't seem to fix it. Also this is for vanilla Hexen, I doubt I would want to use a version of ACC that was modified to work for Zdoom. The latest version of Randy's ACC (here) aborts with an error message when you use the -h switch and the script contains instructions that cannot be used in vanilla Hexen. (Previous versions silently escalated to ZDoom bytecode; that behavior is now assigned to the -hh switch.) 0 Share this post Link to post
Kaiser Posted June 29, 2012 Not for behavior lump, but the SCRIPTS lump has the 00 00 appended to it. It just never bothers to update the behavior lump when I compile the script in the editor. 0 Share this post Link to post
Quasar Posted June 29, 2012 I think you have to save the wad file afterward >_> 0 Share this post Link to post
Kaiser Posted June 29, 2012 I did that too, still nothing. I guess I can live with using SlumpED for exporting the updated behavior lump for now. Though it's a huge hassle that I have to close the editor first and then relaunch it after I am done. 0 Share this post Link to post
CodeImp Posted June 29, 2012 I have tried making a vanilla Hexen map and it seems to work. See http://youtu.be/sS4g_Powors Other than using "print" (which I doubt is the problem) what else are you doing differently? 0 Share this post Link to post
Kaiser Posted June 29, 2012 CodeImp said:I have tried making a vanilla Hexen map and it seems to work. See http://youtu.be/sS4g_Powors Other than using "print" (which I doubt is the problem) what else are you doing differently? Ah okay I see what's going on. I completely misunderstood what that SCRIPTS tab was used for, I thought it was something not related to Hexen so I clicked on 'New' and another tab was created. Then I saw that it let me specify a script type so I chose Hexen Format and then tried compiling. Personally that script interface seems somewhat vague. It should probably be updated to be more 'user-error' proof so morons like me won't make mistakes like that again :P Then yet maybe I could take a stab at it since I have access to the SVN... 0 Share this post Link to post
CodeImp Posted June 29, 2012 What do you have in mind? I made the SCRIPTS tab like this on purpose, because that is the lump in the map that you are editing. The script editor can also be used to edit any other script files (because you may want to use include statements) and this way it clearly has tabs for the map that you are editing (and you can't close these tabs, because the map is open and they belong with the map). 0 Share this post Link to post
Kaiser Posted June 29, 2012 As far as I can recall, Hexen doesn't support SCRIPTS lumps so wouldn't it make sense to rename the tab to BEHAVIOR for Hexen-specific levels? Or instead, label the tab as 'Level Script' so at least the description seems more direct. Though I am curious to see if anyone else has better ideas... assuming I am not the only one who feels somewhat convoluted. 0 Share this post Link to post
Gez Posted June 29, 2012 Kaiser said:As far as I can recall, Hexen doesn't support SCRIPTS lumps so wouldn't it make sense to rename the tab to BEHAVIOR for Hexen-specific levels? You don't edit the raw BEHAVIOR lump, though... Hexen just happily ignores script sources as long as they are after the BEHAVIOR lump, since it just turns them into some lump that is never referenced. 0 Share this post Link to post