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

How do i make barrels spawn?

Recommended Posts

I want to make new barrels appear not respawn. How would I set the script up for this?

Share this post


Link to post

you'd use Thing_SpawnNoFog like this:

script 1 (int mapspot,int newtid)
{ Thing_SpawnNoFog(mapspot,T_BARREL,0,newtid);
}
With this script,you could define a tid of the thing to spawn the barrel at (usually a mapspot) and a new tid for the spawned barrel.

Share this post


Link to post

So I'm still a little confused on how to set up the script. I set it up like this but it didn't work could yuou tell me where I went wrong?
I set the tid (which I assume stands for thing id) to 2035 which is the barrel and the mapspot to one. I already have script operating in this wad to allow conveyor belts to move barrels so I set the script to 2.

#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(1, T_BARREL, 0,2035);
}

This is how I have it set up line for line word for word, when I compile it no errors come up so I'm confused as to what wrong.
I'm new at scripting and I'm still getting used to how to set things up so any help is appreciated.

Share this post


Link to post

What you now have to do is using one of the ACS_Execute specials to execute the script 2 with additional parameters to choose where the barrel is spawned and if it has yet another tag.

Take a look at this:
http://www.zdoom.org/wiki/index.php?title=ACS_Execute
ACS_Execute (script, map, s_arg1, s_arg2, s_arg3),

Now, if you want to spawn a barrel on a mapspot in your map tagged 20 and give the new barrel a tag of 35, your ACS_Execute command should look like this in ACS:

ACS_Execute (2, 0, 20, 35);

...or in DB if you edit a line to give it a new special...

Special Type: 80 (ACS_Execute)
Script: 2
Map: 0
Arg1: 20
Arg2: 35

...and that's it ;)

Share this post


Link to post

Ok so I read how to do it but I'm still really confused on how to do it this is how the script is setup now, I added a script in the to "color" the water so it's green when you swim in it.

#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(20, T_BARREL, 0,35);
ACS_Execute(2, 5, 20, 35);
}

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

Now what I can't figure out is how to set the tid and the mapspot. This script compiles no problem, I set a map spot up with a tag of 20 and still nothing. A barrel's thing id is 2035, so maybe its because I'm not setting the new tid up properly? Thanks for all the help so far.

Share this post


Link to post

you have to put the ACS execute directive into your map,not into your script. Tag it to a walkover line for example. The tid has nothing to do with the doombuilder number of the thing, it is used to identify this particular thing in scripts. You could also have

script 4 open
{ ACS_Execute(2,0,20,35);
  delay(5*35);
  restart;
}
which would spawn a new barrel every 5 seconds.

Thing_SpawnNoFog(20, T_BARREL, 0,35);

You should keep this to

Thing_SpawnNoFog(mapspot,T_BARREL,0,newtid);
to keep the functionality of the script.

Share this post


Link to post

far_haven hit it, I had the mapspot tagged when I should have left it mapspot. Same thing with newtid. Thanks for the help guys it works great now ^^

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
×