Marrub had the same error with the intercept function when he loaded TSP with Terminus's Metal Jukebox, but only if he loaded the Metal Jukebox first, and nobody else could reproduce the error even using the same version of the files in the same version of GZDoom. We never figured out the reason so if my putting the #include before #library is the culprit I will be very happy.
Graf Zahl wrote:Ok, I can't track this down but I have a suspicion. Here's the script's first few lines:
Code: Select all
#include "zcommon.acs"
#include "commonfuncs.h"
#include "mathFuncs.h"
#include "miscFuncs.h"
#library "CHACS"
Looks ok so far, right?
But the includes contain actual code, so anything in there does not tag strings properly for the library which can trigger all sorts of undefined behavior.
Blue Shadow wrote:Is that why it's said that #library should be the first line in the file, even before any #includes?
edward850 wrote:Yes, otherwise all strings before it won't be phrased in the library. It is technically possible for a script to have multiple sets of strings (although I'm unsure how far ACC will take that)
Ah. I didn't actually know this. It's passing strings to the function so that's probably the culprit. So the correct order would be
Code: Select all
#include "zcommon.acs"
#library "CHACS"
#include "commonfuncs.h"
#include "mathFuncs.h"
#include "miscFuncs.h"
then?
Graf Zahl wrote:That mod is a mess anyway. Endless errors upon start, someone really needs to clean up.
I'm not the mod author/maintainer, I just gave CactusHedge a little bit of acs a while ago, but what are the errors? The version from the thread gives me none on startup in ZDoom 2.8pre-1190-gd8d2058.
Graf Zahl wrote:Normally ACC should throw an error for this mistake, so I'm leaving the report open.
I grabbed a bunch of stuff off the acc git a while ago for what I'm using to compile and haven't recently updated, so it's probably on my end rather than an issue with current ACC.
I uploaded what I'm using
here.
Cryomundus wrote:Honestly, I'm not even sure how the acs was even compiled in the first place, as I can't actually compile the source file myself in SLADE.
Cryomundus wrote:I'm also a little curious as to how the acs file was actually compiled (as in what version of acc was used), because I can't actually compile it myself with the acc compiler provided on the zdoom site. It literally shouldn't be able to compile but it somehow was?
I'm using some ACC I downloaded off the acc git a while ago, linked above. It also might be that you haven't added the files commonFuncs.h, mathFuncs.h and miscFuncs.h to the folder where your ACC is located.
Cryomundus wrote: Heck, I'm not even sure why the acs was even needed in the first place. It doesn't seem to do anything particularly special.
I mean, it seems he wanted them to lob a cyb missile or something. Heck, he just make a custom decorate one, it'd be far easier and simpler. I get referencing is useful, but not when it makes a massive, unwieldy mess of code.
edit: by massive, unweildy mess, I mean the acs. I actually can't tell what the purpose of it is. It's also broken. And weird.
It's purpose is shooting a missile on an intercept course with the target based upon it's current speed rather than it's current location.
What makes the code messy/broken? Is it not commented enough or do you mean something is amiss formatting-wise?
Hege Cactus wrote:I'm going to probably have to contact him about it or just remove it from the mod, tho it would be a shame to eliminate it cause the interception adds quite a nice bit of life to normal cybie fight and the barons/HKs.
I'm honestly not good with ACS myself and I'm still learning so yeah so I dont really know much on it.
Try changing
Code: Select all
#include "zcommon.acs"
#include "commonfuncs.h"
#include "mathFuncs.h"
#include "miscFuncs.h"
#library "CHACS"
to
Code: Select all
#include "zcommon.acs"
#library "CHACS"
#include "commonfuncs.h"
#include "mathFuncs.h"
#include "miscFuncs.h"
(if the second block of code is actually the correct order;
wait to hear back from Graf or Edward about that EDIT: Checked with Edward on irc, and the second one is the correct order) and see if the problem persists.
Marrub had the same error with the intercept function when he loaded TSP with Terminus's Metal Jukebox, but only if he loaded the Metal Jukebox first, and nobody else could reproduce the error even using the same version of the files in the same version of GZDoom. We never figured out the reason so if my putting the #include before #library is the culprit I will be very happy.
[quote="Graf Zahl"]Ok, I can't track this down but I have a suspicion. Here's the script's first few lines:
[code]
#include "zcommon.acs"
#include "commonfuncs.h"
#include "mathFuncs.h"
#include "miscFuncs.h"
#library "CHACS"
[/code]
Looks ok so far, right?
But the includes contain actual code, so anything in there does not tag strings properly for the library which can trigger all sorts of undefined behavior.[/quote]
[quote="Blue Shadow"]Is that why it's said that #library should be the first line in the file, even before any #includes?[/quote]
[quote="edward850"]Yes, otherwise all strings before it won't be phrased in the library. It is technically possible for a script to have multiple sets of strings (although I'm unsure how far ACC will take that)[/quote]
Ah. I didn't actually know this. It's passing strings to the function so that's probably the culprit. So the correct order would be
[code]
#include "zcommon.acs"
#library "CHACS"
#include "commonfuncs.h"
#include "mathFuncs.h"
#include "miscFuncs.h"
[/code]
then?
[quote="Graf Zahl"]That mod is a mess anyway. Endless errors upon start, someone really needs to clean up.[/quote]
I'm not the mod author/maintainer, I just gave CactusHedge a little bit of acs a while ago, but what are the errors? The version from the thread gives me none on startup in ZDoom 2.8pre-1190-gd8d2058.
[quote="Graf Zahl"]Normally ACC should throw an error for this mistake, so I'm leaving the report open.[/quote]
I grabbed a bunch of stuff off the acc git a while ago for what I'm using to compile and haven't recently updated, so it's probably on my end rather than an issue with current ACC.
I uploaded what I'm using [url=https://drive.google.com/file/d/0BxbbtKR5bll_cGJuQUtLTzd5bkU/view?usp=sharing]here.[/url]
[quote="Cryomundus"]Honestly, I'm not even sure how the acs was even compiled in the first place, as I can't actually compile the source file myself in SLADE. [/quote]
[quote="Cryomundus"]I'm also a little curious as to how the acs file was actually compiled (as in what version of acc was used), because I can't actually compile it myself with the acc compiler provided on the zdoom site. It literally shouldn't be able to compile but it somehow was? [/quote]
I'm using some ACC I downloaded off the acc git a while ago, linked above. It also might be that you haven't added the files commonFuncs.h, mathFuncs.h and miscFuncs.h to the folder where your ACC is located.
[quote="Cryomundus"] Heck, I'm not even sure why the acs was even [i]needed[/i] in the first place. It doesn't seem to do anything particularly special.
I mean, it seems he wanted them to lob a cyb missile or something. Heck, he just make a custom decorate one, it'd be far easier and simpler. I get referencing is useful, but not when it makes a massive, unwieldy mess of code.
edit: by massive, unweildy mess, I mean the acs. I actually can't tell what the purpose of it is. It's also broken. And weird.[/quote]
It's purpose is shooting a missile on an intercept course with the target based upon it's current speed rather than it's current location.
What makes the code messy/broken? Is it not commented enough or do you mean something is amiss formatting-wise?
[quote="Hege Cactus"]I'm going to probably have to contact him about it or just remove it from the mod, tho it would be a shame to eliminate it cause the interception adds quite a nice bit of life to normal cybie fight and the barons/HKs.
I'm honestly not good with ACS myself and I'm still learning so yeah so I dont really know much on it.[/quote]
Try changing
[code]
#include "zcommon.acs"
#include "commonfuncs.h"
#include "mathFuncs.h"
#include "miscFuncs.h"
#library "CHACS"
[/code]
to
[code]
#include "zcommon.acs"
#library "CHACS"
#include "commonfuncs.h"
#include "mathFuncs.h"
#include "miscFuncs.h"
[/code]
(if the second block of code is actually the correct order; [s]wait to hear back from Graf or Edward about that[/s] [b]EDIT: Checked with Edward on irc, and the second one is the correct order[/b]) and see if the problem persists.