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

A list of questions about ACS.

Recommended Posts

I would like to use acs to add variety and originality to my current project. here is a list of questions:
1.)
How do I write a BEHAVIOR lump in GZDB?
2.)
What is the best way to add ACS to a wad/PK3?
3.)
How do I add tags to map spots in GZDB? do they just inherit from the sector they're in?
4.)
can you point me to any guides or references to get me started?
That is all.

Share this post


Link to post

1. Open the SCRIPTS window, write an ACS script there, then compile it.
2. Either the abovementioned way, or via making a library and using LOADACS.
3. No, they don't inherit tags from sectors, you should give them their own tags. In Hexen and UDMF map formats, there is a Tag field in their thing properties.
4. http://zdoom.org/wiki/ (particularly http://zdoom.org/wiki/ACS), http://forum.zdoom.org/ and http://www.google.com/

Share this post


Link to post

when I write my ACS script and go to compile, it makes me save, and when I do it tells me I can only compile external files as a library, how can I either get around this or write my behavior lump as a library, and out of curiosity, why are you so omnipresent?

Share this post


Link to post

There is probably something wrong with the content of your script. Post your script here, so that somebody can identify the problem. As for your other question... I don't know, I'm probably just liking this forum a lot.

Share this post


Link to post

Well, I can already see one issue with my script, how can I build a map In UDMF using GZDB? as I was referencing a mapspot assuming that it inherited the tag of the sector.

Share this post


Link to post
Godfather38 said:

how can I build a map In UDMF using GZDB?

Start a new map and choose a Game Configuration with the word "UDMF" in its name.

Share this post


Link to post

"GZDoom: Doom 2 (UDMF)" should be among the default available configurations. Feel free to visit "Tools -> Game Configurations" to add more configurations to the list that appears when you are starting a new map.

Share this post


Link to post

Yeah, I added the tick and it worked. I think that was SharkLordSatans issue. working on fixing the script now.

Right, so I have my script, what would the type be for a custom actor as referenced by "thing_spawnfacing"?

Share this post


Link to post

1. For custom actors, use SpawnSpotFacing instead of Thing_SpawnFacing.
2. To be able to set delay of a printed text, use HUDMessage instead of Print.

Share this post


Link to post

Well, your answer to question 2 works, so thank you, but I figured out question one and the answer was that I didn't have a spawn ID, although you might be referring to if I had made an entirely new actor class of some sort.

Share this post


Link to post

You are right about Spawn IDs, but... The problem with Spawn IDs is that their value should be unique (not colliding with Spawn IDs of other actors, not even default Doom actors) AND must be between 1-255 (and keep in mind that many of these values are already taken by the default Doom actors). If you have lots of custom actors, this range might not be sufficient to give an unique Spawn ID to each one. Therefore it's generally better to not use them, and to spawn actors via functions that accept their classname as a parameter instead.

Share this post


Link to post

Alright, I see it on the wiki now, too - the limit was increased since ZDoom version 2.8.1. It's still easier and more convenient to use classnames, though.

Share this post


Link to post
Godfather38 said:

It might be more convenient, but writing a number is a lot easier in my opinion.


Until you return to the project months later and have to sift through your DECORATE to find the value. Of course, you could place comments in your ACS.

Share this post


Link to post

In the sense of writing it, yes, it's easier. In the sense of remembering (or finding) it, it depends on whether you're better at remembering words (classnames) or numbers. In the sense of making sure that every new actor will be assigned a Spawn ID actually different from every other actor's Spawn ID, it's not at all easier. :)

Share this post


Link to post

I love how this thread has devolved into a debate about what methods are better when using acs to spawn things, and by the way if you structure your decorate linearly and all your spawn ids are sequential then all it takes is a quick scroll to make sure the spawn ids are different, and if I don't use comments then I can just open my decorate in another tab, whether I'm using slade or GZDB's built in code editor.

Share this post


Link to post

Welcome to Doomworld, where derailing threads is the norm! ;D

On topic though, are all of your issues solved?

Share this post


Link to post

If you use spawnids in ACS, here's what I'd recommend to do: define them with constants. Let's say you have a custom monster imaginatively called the archfiend, with spawnid 666 because lulz, in the top of your ACS file you'll have:

#define MT_ARCHFIEND 666
Then when you use Thing_SpawnFacing and similar, instead of using the spawnid value directly (666), you use the define (MT_ARCHFIEND).

This way, you have several advantages:
1. The code is more legible, as you don't need to remember what number is associated with what actor class when you can give them a meaningful identifier.
2. If for some reason you want to change the spawnid of an actor type (maybe to solve a number collision issue or whatever), you only have to change the #define line, everything else is automagically updated since you didn't use the value in the rest of the code. You won't risk forgetting to update one of the scripts this way!
3. Suppose you want to replace all the archfiends by the elite hellions in your script, this is as easy as search and replacing MT_ARCHFIEND with MT_HELLIONS, whereas search and replacing the numerical values would have the risk of changing unwanted things (like sector tags, platform displacement, delay times, and so on).

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
×