Executing ACS Script at the beginning of a level?

Need help with your project? Ask here.
User avatar
Syfo-Dyas
Posts: 182
Joined: Sun Oct 09, 2005 21:54
Location: Ohio
Contact:

Executing ACS Script at the beginning of a level?

Post by Syfo-Dyas »

Hello, I have been trying to learn ACS through the Wiki, but am having trouble getting it to auto execute when I begin my level.

I was using an example from an old ZDOOM 1.22 wad as my base, but thus far I can not figure out how to make this work.

Here's what I got:

#include "zcommon.acs"

script 1 (void)
{
delay (const:2); // this allows two clicks to pass and wipe tp happen before it prints anything
print (s:"What is this place?");
delay (const:70);
print (s:"And how did I get here?");
delay (const:70);
print (s:"What have I gotten my self into now?");
delay (const:70);
print (s:"I suppose I better have a look around...");
ambientsound ("Sith", 127);
delay (const:105);
print (s:"Well, maybe not...");
delay (const:35);

Light_Fade (const:1, 160, 35);
Door_Open (const:7, 24);
}


Obviously I have this injected into the map WAD, and I have a door with a tag of 7, but I'm not understanding what is preventing this from working. Could someone with a better understanding of ACS and ZDOOM open my eyes?

Thank you!
User avatar
Rex Claussen
Developer
Developer
Posts: 2600
Joined: Tue Jul 11, 2006 18:36
Contact:

Re: Executing ACS Script at the beginning of a level?

Post by Rex Claussen »

You have:

script 1 (void)

You need:

script 1 OPEN

or

script 1 ENTER

An OPEN script will only execute the first time any player enters a map; an ENTER script will execute the first time each player enters a map (only useful for multiplayer).

My suggestion is, that if you expect you'll have other commands/specials you'd want to run at map start-up (in addition to those you listed above), you should move this script in its entirety to another script (say, script 2 (void)), and call script 2 from the OPEN script via:

ACS_Execute(2,0,0,0,0); //Activates script 2

This will keep this set of actions neatly together, and will prevent accidental interference to/from the other commands/specials you want to run at map start.
User avatar
Syfo-Dyas
Posts: 182
Joined: Sun Oct 09, 2005 21:54
Location: Ohio
Contact:

Re: Executing ACS Script at the beginning of a level?

Post by Syfo-Dyas »

Now I have this as the file SCRIPTS within the WAD file, but still nothing happens in either GzDOOM or Odamex.

Should I move the SCRIPTS file into the resource wad that I load along side of the map for my project?

Also, should I create a second script file, what file name should I save and load it as under XWE so that it does not conflict with other SCRIPTS file, and how does GzDOOM know which file to goto?
----------------

#include "zcommon.acs"

script 1 OPEN

{
delay (const:2); // this allows two clicks to pass and wipe tp happen before it prints anything
print (s:"What is this place?");
delay (const:70);
print (s:"And how did I get here?");
delay (const:70);
print (s:"What have I gotten my self into now?");
delay (const:70);
print (s:"I suppose I better have a look around...");
ambientsound ("Sith", 127);
delay (const:105);
print (s:"Well, maybe not...");
delay (const:35);

Light_Fade (const:1, 160, 35);
Door_Open (const:7, 24);
}
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Executing ACS Script at the beginning of a level?

Post by Gez »

[wiki]SCRIPTS[/wiki]? They're fine and dandy, and level editors will use them, but not ZDoom. What you need is a [wiki]BEHAVIOR[/wiki] lump. You create this lump with [wiki]ACC[/wiki]. Note that Doom Builder and [wiki]SLADE3[/wiki] can compile SCRIPTS lump, too, if they're correctly configured to find ACC.
User avatar
Syfo-Dyas
Posts: 182
Joined: Sun Oct 09, 2005 21:54
Location: Ohio
Contact:

Re: Executing ACS Script at the beginning of a level?

Post by Syfo-Dyas »

My behavior was building fine, and I don't know what I did, but now the script is suddenly working in GzDOOM, though Odamex still don't like it, but I think Odamex is new with ACS anyhow so I'll just bring that to the dev team's attention.

Thankx!
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Executing ACS Script at the beginning of a level?

Post by Gez »

Odamex does not have ACS support at all, as far as I know.
User avatar
Syfo-Dyas
Posts: 182
Joined: Sun Oct 09, 2005 21:54
Location: Ohio
Contact:

Re: Executing ACS Script at the beginning of a level?

Post by Syfo-Dyas »

It does now with the most recent release, but it, like the ZDOOM support, is very basic and broken in a few places:

See for yourself! :)

http://odamex.net/


Now I keep hearing everyone talk about Slade, and I must admit I'm not familiar with it as I grew up on Wintex and later XWE. Is it better and reliable?
User avatar
Rex Claussen
Developer
Developer
Posts: 2600
Joined: Tue Jul 11, 2006 18:36
Contact:

Re: Executing ACS Script at the beginning of a level?

Post by Rex Claussen »

Syfo-Dyas wrote:Now I keep hearing everyone talk about Slade, and I must admit I'm not familiar with it as I grew up on Wintex and later XWE. Is it better and reliable?
I believe the newest version of Slade is a beta, but from what I've heard it is quite stable and relatively easy to use.

SlumpEd is another relatively stable and versatile wad lump management utility.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Executing ACS Script at the beginning of a level?

Post by Gez »

Slade 3 is not in beta anymore; though I'd advise getting the development build 801 rather than the official 3.0.0 version, it's a bit newer and some little bugs have been fixed.

Slumped is the predecessor to Slade 3, and there are no strong reason to use it rather than Slade. It is a bit faster to start since it has a ton less features to initialize, but that's about all. It's a lot less stable though, with nearly no sanity checks when looking at content, so if stuff isn't as expected, it just instantly crashes without warning. Wee, fun! Try looking at the TEXTURE1 lump in strife1.wad for an example. Slade 3 is a lot more robust.
User avatar
Syfo-Dyas
Posts: 182
Joined: Sun Oct 09, 2005 21:54
Location: Ohio
Contact:

Re: Executing ACS Script at the beginning of a level?

Post by Syfo-Dyas »

Where do I find build 801?

The SVN link?
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Executing ACS Script at the beginning of a level?

Post by Gez »

User avatar
Syfo-Dyas
Posts: 182
Joined: Sun Oct 09, 2005 21:54
Location: Ohio
Contact:

Re: Executing ACS Script at the beginning of a level?

Post by Syfo-Dyas »

Very nice!
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Executing ACS Script at the beginning of a level?

Post by Gez »

And I just uploaded build 802.
User avatar
Syfo-Dyas
Posts: 182
Joined: Sun Oct 09, 2005 21:54
Location: Ohio
Contact:

Re: Executing ACS Script at the beginning of a level?

Post by Syfo-Dyas »

So Slade is the future then? No more XWE?

Are you one of the coders behind slade?
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Executing ACS Script at the beginning of a level?

Post by Gez »

Yeah. I'm just doing little bits here and there, though. The program's core architecture and logic is done by sirjuddington; I add little features that I want to have.

The interface is quite different from XWE and it does not have all the features XWE has (inversely, XWE does not have all the features Slade has), but it is the only lump management tool that is both available right now and currently developed.

Slade has a wiki for its documentation, though it's a bit bare-bones at the moment, with just one tutorial.
Post Reply

Return to “Editing Help”