Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Question

Okay so I've messed with ACS scripting for GZDooMBuilder (BugFix) And can do basic (and not-so basic) scripts. Is it possible to have an ACS script work without needing a fixed map and for it to work with .pk3 file format?

Share this post


Link to post

7 answers to this question

Recommended Posts

  • 1
Posted (edited)

Funnily enough you do every time you write a script. The very first line, "#include zcommon.acs", is calling a whole bunch of scripts that aren't connected to a specific map.

Share this post


Link to post
  • 1
1 hour ago, therektafire said:

Wait I thought zcommon is part of the "standard library" per se of ACS and when you compile your script it gets added to it (hence the #include part). So the include is part of the acs bytecode and is executed at runtime and not a compiler directive that is executed at compile time? I didn't know that :/ Then again I'm not that experienced with acs itself so I guess of course I wouldn't know that lol

 

No you're right. I may have  misread it, but my understanding of the original question wasn't about executing scripts outside of a map, but merely storing them in the pk3 unconnected to a particular map, and subsequently running them in any map you like.  

Share this post


Link to post
  • 0
4 hours ago, Bauul said:

Funnily enough you do every time you write a script. The very first line, "#include zcommon.acs", is calling a whole bunch of scripts that aren't connected to a specific map.

 

They're not? Huh! Nice info to know. :D

Share this post


Link to post
  • 0
7 hours ago, Bauul said:

Funnily enough you do every time you write a script. The very first line, "#include zcommon.acs", is calling a whole bunch of scripts that aren't connected to a specific map.

Wait I thought zcommon is part of the "standard library" per se of ACS and when you compile your script it gets added to it (hence the #include part). So the include is part of the acs bytecode and is executed at runtime and not a compiler directive that is executed at compile time? I didn't know that :/ Then again I'm not that experienced with acs itself so I guess of course I wouldn't know that lol

Share this post


Link to post
  • 0

zcommon.acs is the base for all your ACS work, and what you write does get compiled into it (use of #include and not #library). It functions similarly to a library, wherein it defines basic functions that your ACS code can use. When writing a library of your own, the first line should be, like in every other script, "#include zcommon.acs". With the #library command, you're adding code that's already been written, but cannot be modified by in-game code, which contains variables, arrays, and other things you've already defined, so while a given map's code may be dependent on the library in question, the library is dependent only on your included zcommon/common/vcommon (whatever you're using) ACS file.

Share this post


Link to post
  • 0

Mostly zcommon.acs provides all the identifiers needed to make legible scripts. When you forget to put that #include line, you get a ton of error messages about "function whatever used but not defined"; zcommon.acs contains these definitions.

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×