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

Moving barrels and spawning them?

Recommended Posts

I want to make a factory map where I have conveyor belts moving exploding barrels and have new barrel spawn, like if it was coming out of a dispenser. Any thoughts on how to set this up? I thought that if I set the sector (I'm using Zdoom: Doom in Hexen mode) to scroll it would work but it didn't. If anyone can give me the script or tell me how to set the sector up to do this it would be great.

Also how do I make barrels spawn? Thanks for the help so far!

Share this post


Link to post

Any idea on what the script is to change the direction of the belts? Right now they only go north and east. I'm sure I can change it but being new to scripting and seeing how using can really improve your maps I want to impliment it as much as possible I just don't know how. Thanks for any help and thanks for all the help so far. This community is a great place.

Share this post


Link to post

you wanting a toggle switch to change the direction?

I can script somtm up pretty quick if so...

Share this post


Link to post

I just want to know how to do it, if you make the script up then I will credit you in my wad as a source along with anyone else who has helped me. Here's the code:

#include "zcommon.acs"

script 1 open
{
Scroll_Floor (2, 0, 50, 2);
scroll_floor (3, 50, 0, 2);
}

script 2(int mapspot, int newtid)
{
Thing_SpawnNoFog(mapspot,T_BARREL, 0,newtid );

ACS_Execute(2, 5, 20, 35);
}

script 3 open
{
sector_setfade(8, 0, 128, 0);
}

script 4 open
{
ACS_Execute(2,0,20,35);
delay(2*35);
restart;
}

It works and compiles perfectly so no need to change any I just want to know how to change direction. Thanksin advance.

Share this post


Link to post

I'll make a demo map, I'll come back with a link and edit this post when Im done!


EDIT: Alright, here we are. The barrels will spawn no matter what direction the converyor belt is moving and is controlled by a dynamic script! (WOO)

Anyway heres the link:

http://www.savefile.com/files/634054

And heres the code:

#Include "zcommon.acs"

int direction = 1;

script 1 open  //put your stuff here
{

}

script 2 open  //spawn the barrels depending on the movement of the floor
{
if(direction==1)
	{
	thing_spawnnofog(2, T_BARREL, 0, 0);
	}
else
	{
	thing_spawnnofog(1, T_BARREL, 0, 0);
	}
delay(105);
restart;
}

script 3 (void)
{
if(direction==1)
	{
	direction=2;
	}
else
	{
	direction=1;
	}
}

script 4 open
{
if(direction==1)
	{
	scroll_floor(1, 32, 0, 2);
	}
else
	{
	scroll_floor(1, -32, 0, 2);
	}
delay(1);
restart;
}
Happy to help!

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
×