Need help with an ACS Error

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Mallow
Posts: 3
Joined: Sun Oct 29, 2017 10:48 pm

Need help with an ACS Error

Post by Mallow »

Yo

I recently decided I was gonna make a library for my commonly used ACS functions and whatnot. So I cracked open a few guides and did that. Few hours later I can finally play my maps with the functions - now stored in the library - executing properly, but i'm still getting an error in the compiler about my imported library. The error I'm getting is an invalid declarator error on line 1 of my imported library because the compiler only shows "ACS" as the contents of the library. Extremely new to this stuff so I'm just wondering whats going on and what I can do to fix it, because I can't imagine this is how its supposed to be lol.

Using Slade3 for resource editing, GZdoom builder for wad making.

got an imgur album here with pictures I took from slade and gzdoom builder if that helps: https://imgur.com/a/aBHhr
User avatar
ramon.dexter
Posts: 1240
Joined: Tue Oct 20, 2015 12:50 pm
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Need help with an ACS Error

Post by ramon.dexter »

Well, if you are making the script as a library, it should have #library "<name>" in the beginning.

Basically, any script placed outside a map IS a library and needs to be defined as so.

Also, use some different font that "papyrus" for coding. Lots of errors can come from using such a non-coding font (like some marks are displayed differently, and so on...)
Mallow
Posts: 3
Joined: Sun Oct 29, 2017 10:48 pm

Re: Need help with an ACS Error

Post by Mallow »

ramon.dexter wrote:Well, if you are making the script as a library, it should have #library "<name>" in the beginning.

Basically, any script placed outside a map IS a library and needs to be defined as so.

That was already done. I realize now that I did not include a picture of my library, but take my word that that part was already done and it all compiled fine. The problem here is that my compiled functions get converted by slade from acs code to literal "ACS". It seems to be something with slade because I just tried looking at my library from one of my maps (again, it just displays "ACS") and then copied the supposed content of that library over that, saved, then quit. When I reloaded, the proper functions and definitions were still there. So again, as stated above, I think something about saving compiled acs in slade right now is causing it to only display "ACS" on the file (but internally it still has my functions because the game still did work fine, despite things looking wrong).

*EDIT* I realize I jumped the gun with the paragraph above, the process I described using there and working was something I tried already and it doesn't work. It does get my ACS to display in GZDB, but when I go to testmap, it says it can't read any of it and nothing works. So to recap, I'm still at this: library works, but displays only as "ACS" and thus gives me an "invalid declarator" error when I compile - but this error does not prevent me from testmapping and does not appear to cause anything to go wrong with my maps so far. *END EDIT*

*DOUBLE EDIT* Well, found out what the error is doing negatively to me, it won't let me test any changes made to my map specific ACS. GZDB saves the changes, but it still tests exactly like the old ACS I had. Damn this is throwing me off so much, I followed those guides to the point too :/. *END DOUBLE EDIT*

ramon.dexter wrote:Also, use some different font that "papyrus" for coding. Lots of errors can come from using such a non-coding font (like some marks are displayed differently, and so on...)

At this point I'm quite used to papyrus, so unless it causes errors by nature of using it, I think I'll be fine...
Mallow
Posts: 3
Joined: Sun Oct 29, 2017 10:48 pm

Re: Need help with an ACS Error

Post by Mallow »

As much as I hate bumps... gonna have to cuz this is killing me. I'm just gonna assume that I explained it poorly in my first post and start over. I've followed the steps to creating a library found on these pages: https://zdoom.org/wiki/Libraries, https://zdoom.org/wiki/LOADACS, http://realm667.com/index.php/en/tutori ... s-59207368. After following the instructions there, I went to go replace common pairs of actions with the new functions I created in my library. However, I discovered that, upon compilation, my scripts would give me an error, "invalid declarator" and it was citing line 1 of my library file. At that point I saw gzdb was trying to compile my library as well as the individual mapscript, but the library that it was compiling only displayed "ACS", thus, I got an error.

I've reviewed the process many times and I can't find anywhere where I deviated from the instructions, so I'm at a loss here. Here is my imgur album again (https://imgur.com/a/aBHhr) with pictures as follows: 1) my library inside my wad, 2) my loadacs lump, 3) one of my map's scripts, 4) my library as it shows up in gzdb, and 5) which I just added, my library in notepad prior to compilation.

Thanks for any help ~

Return to “Scripting”