Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
hobblinharry

new to ACS and pulling out my hair (sectors???)

Recommended Posts

so i just started trying to mess with ACS the other day and i can compile basic scripts and get them working, but im trying to do something that may not be even possible. i want to trigger setmusic when a player enters a specific sector on a map.

i know what im trying to do can be done very easily in a UDMF map but im working with a map in doom format. i found this: http://www.zdoom.org/wiki/Using_ACS_in_Doom-format_maps - which i have got basic stuff working on the map im trying to do this on, but im racking my brain over triggering setmusic for the sector.

the ONLY thing i can find regarding ACS and sectors is this page: http://zdoom.org/wiki/ACS_ExecuteAlways

so im using it as a template for what im trying to do, but i cant get anything in the while loop to trigger, not even the regen example. im assuming the int InSector[8] at the top, the 8 is referring to sector tag 8, so i updated it accordingly, but i cant get it working, so im at a loss :( plz halp

code:

#library "setmusic"
#include "zcommon.acs"

int InSector[72];

script 10 (void)
{
	int mnam = GetLevelInfo (LEVELINFO_LEVELNUM);
	if (mnam == 32)
	{
		InSector[PlayerNumber()] = TRUE;
		while (InSector[PlayerNumber()]) {
			SetMusic("CLUB");
			GiveInventory("HealthBonus", 1);
			ThingSound(0, "special/regen", 127);
			delay(15);
		}
    }
}

Share this post


Link to post

1. Use UDMF format. It's maximum flexible and as you said, your issue would be easy to solve there. I don't get your reason to limit yourself to Doom format when you're already determined to map for ZDoom (as ACS is only supported by ZDoom based ports).

2. Your script is totally out of context and useless. The "InSector" is just a user declared array of integers (you can see its declaration at the top of the script, it means nothing in the game, the array could be named anyhow). There is no actual check for player's presence in a sector. The example code has nothing to do with checking player's presence in a sector, it merely demonstrates how 2 scripts can interact with each other through global variables. Also, your script never even starts, because it's a void script (not ENTER script or anything), so it needs to be executed by ACS_Execute or ACS_ExecuteAlways function somewhere from the map, which you can't do in Doom format.

3. Letting a script run in a while loop during the course of an entire map is generally unclean and not so good idea - another reason to simplify your work using UDMF format.

4. I don't know a solution applicable to Doom format, sorry.

Share this post


Link to post
Gez said:


thanks for the tip, Gez. ive tried to mess around with this a bit, not getting anywhere, not sure if you have personal experience.

i found out that zdoom already implements the dectorate definition, and i understand how the number scheming works, the DoomWiki article is a little more clear: http://doomwiki.org/wiki/MUSINFO on that.

so as it stands, i have a map with thing type 14101, and since im doing a zip file instead of a wad i have MUSINFO.txt with only

MAP32
1 CLUB

in it. music change isnt happening and it feels like im missing something in the middle to bring it all together, so i probably am, but i cant discern what that something is

Share this post


Link to post

Trying to make a vanilla compatible port of the PSX secret levels with enhancements when running under ZDoom?

Share this post


Link to post
hobblinharry said:

in it. music change isnt happening and it feels like im missing something in the middle to bring it all together, so i probably am, but i cant discern what that something is

Have you tried "changemus CLUB" in the console to see if the music works?

Share this post


Link to post
Sodaholic said:

Trying to make a vanilla compatible port of the PSX secret levels with enhancements when running under ZDoom?


yeah basically, which probably seems pointless but i need a project to "get into" this kind of stuff and i figured this was a good place to start

Gez said:

Have you tried "changemus CLUB" in the console to see if the music works?


yes that works. anymore feedback would be greatly appreciated but im not asking anyone to hold my hand on this. basically to elaborate on my response to Sodaholic im just dicking around with stuff to get my feet wet

Share this post


Link to post

If you're trying start with ACS, UDMF would've been a far better place to start. If you're trying to start with Doom level design in general, avoiding ACS would be far better - although if you still wanted to use it, then UDMF would still be far better, as it actually has ways to trigger ACS scripts rather than relying on ACS's in-built triggers which aren't really that good for level scripting.

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
Sign in to follow this  
×