Executing ACS Script at the beginning of a level?
- Syfo-Dyas
- Posts: 182
- Joined: Sun Oct 09, 2005 21:54
- Location: Ohio
- Contact:
Executing ACS Script at the beginning of a level?
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!
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!
- Rex Claussen
- Developer
- Posts: 2600
- Joined: Tue Jul 11, 2006 18:36
- Contact:
Re: Executing ACS Script at the beginning of a level?
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.
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.
- Syfo-Dyas
- Posts: 182
- Joined: Sun Oct 09, 2005 21:54
- Location: Ohio
- Contact:
Re: Executing ACS Script at the beginning of a level?
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);
}
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);
}
- Gez
- Developer
- Posts: 1399
- Joined: Mon Oct 22, 2007 16:47
Re: Executing ACS Script at the beginning of a level?
[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.
- Syfo-Dyas
- Posts: 182
- Joined: Sun Oct 09, 2005 21:54
- Location: Ohio
- Contact:
Re: Executing ACS Script at the beginning of a level?
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!
Thankx!
- Gez
- Developer
- Posts: 1399
- Joined: Mon Oct 22, 2007 16:47
Re: Executing ACS Script at the beginning of a level?
Odamex does not have ACS support at all, as far as I know.
- Syfo-Dyas
- Posts: 182
- Joined: Sun Oct 09, 2005 21:54
- Location: Ohio
- Contact:
Re: Executing ACS Script at the beginning of a level?
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?
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?
- Rex Claussen
- Developer
- Posts: 2600
- Joined: Tue Jul 11, 2006 18:36
- Contact:
Re: Executing ACS Script at the beginning of a level?
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.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?
SlumpEd is another relatively stable and versatile wad lump management utility.
- Gez
- Developer
- Posts: 1399
- Joined: Mon Oct 22, 2007 16:47
Re: Executing ACS Script at the beginning of a level?
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.
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.
- Syfo-Dyas
- Posts: 182
- Joined: Sun Oct 09, 2005 21:54
- Location: Ohio
- Contact:
Re: Executing ACS Script at the beginning of a level?
Where do I find build 801?
The SVN link?
The SVN link?
- Gez
- Developer
- Posts: 1399
- Joined: Mon Oct 22, 2007 16:47
- Syfo-Dyas
- Posts: 182
- Joined: Sun Oct 09, 2005 21:54
- Location: Ohio
- Contact:
- Gez
- Developer
- Posts: 1399
- Joined: Mon Oct 22, 2007 16:47
Re: Executing ACS Script at the beginning of a level?
And I just uploaded build 802.
- Syfo-Dyas
- Posts: 182
- Joined: Sun Oct 09, 2005 21:54
- Location: Ohio
- Contact:
Re: Executing ACS Script at the beginning of a level?
So Slade is the future then? No more XWE?
Are you one of the coders behind slade?
Are you one of the coders behind slade?
- Gez
- Developer
- Posts: 1399
- Joined: Mon Oct 22, 2007 16:47
Re: Executing ACS Script at the beginning of a level?
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.
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.