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

Some basic ASC help

Recommended Posts

Hey, Ive done a few maps with normal doom 2 stuff, and I started reading about ACS and zdoom functionality and I thought it would be fun to do more complicated stuff.

But, Im new to ACS. Ive read the reference at http://www.zdoom.org/wiki/index.php?title=Main_Page
.

I dont quite see how I could, for eg, open a door and raise a ceiling when you walk over a linedef.

Im sure its old hat to some of you, so what would the script be?

Share this post


Link to post

I assume you're using DB for your map editing (this will make it much easier to do)...

Give the line you want to use special #80 (activate script), and change the first arg (Script number) to 2 (the script number), and then create a script for the level (click Edit BEHAVIOUR Lump, under Scripts) and copy this into the script:

#include "zcommon.acs"

script 2 (void)

{
Door_Open(2,15); // 2 is the door's sectortag, 15 is the speed at which the door will open
Ceiling_RaiseByValue(3,15,64); // 3 is the ceiling's sectortag, 15 is the raising speed,
//64 is how far the ceiling will move before stopping)
}

Then compile it, make sure the ceiling and door have the right tags (and edit the speed and movement value to your liking), save and play. When you walk over the line that activates the script, the door tagged 2 will open at 15 speed, and the ceiling tagged 3 will move 64 units at 15 speed.

EDIT: oops forum hax :/

Share this post


Link to post

Thanks, works

This ACS looks very exciting for me. Might try and get a map going over easter.

As a side note, do most people use zdoom? I assume Im limiting it to people who use zdoom if I use ACS sctipt?

Share this post


Link to post
Chainsaw said:

As a side note, do most people use zdoom? I assume Im limiting it to people who use zdoom if I use ACS sctipt?



Oh, you will lose some of those individuals which can't play without OpenGL enhancements but I think the vast majority here uses any source port that's necessary to play a level - unless there are technical reasons. But in that regard ZDoom has a rather good track record so there's no need to worry.

Share this post


Link to post

Ok, I have the following script:

script 1 (int a)

{
Door_Raise(a,30,70);
Plat_DownWaitUpStay(a+1,30,70);
}


It is activated by pressing use on any of the pillars (as you may see, its a bi-directional door). But I can only press use on each activating linedef once to activate the script.

This happens when using linedef action 80 and 226.

How can I make it activate every time someone presses use?

Share this post


Link to post

You have to set the 'repeatable' flag for the linedef. This can be found somewhere in the linedef properties. In DoomBuilder it is called 'Repeatable effect'.

Share this post


Link to post

Ok , have a weird thing happening. I have 2 buttons using these 2 different scripts:

int bonus = 0;

script 3 (void)
{
	if(bonus == 0)	bonus = 1;
		
	else			bonus = 0;
}

script 4 (void)
{
	if(bonus == 0) Thing_Spawn(1, T_IMP, 180, 1);
	else Thing_Spawn(1, T_BFG, 180, 1);
}

but every time I activate script 3 and I use script 4 1 more object spawns (so I get 1 imp, then 2 BFG,s then 3 imps and so on). It seems a little odd to me.

Share this post


Link to post

You give your spawned objects a tid of 1 so as long as they stay on the map a new item is spawned for each item you already spawned. Remove the last 1 from Thing_Spawn and it should work.

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
×