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

ACS skill

Recommended Posts

I want a sector to raise and enemies to teleport in. I have it working, but I want the number of enemies to differ among skills.

In theory it would look like this:

script 2 (void)
{
ceiling_raisebyvalue(8, 64, 120);
a = gameskill();
switch (a)
{
    case 0:       
        thing_spawn(2, t_vile, 120);
        break;    
    case 1:       
        thing_spawn(2, t_vile, 120);
        break;
    
    case 2:       
        thing_spawn(2, t_vile, 120);
        thing_spawn(3, t_vile, 225);
        break;
    case 3:
        thing_spawn(2, t_vile, 120);
        thing_spawn(3, t_vile, 225);
        thing_spawn(4, t_vile, 315);
        break;
    case 4:
        thing_spawn(2, t_vile, 120);
        thing_spawn(3, t_vile, 225);
        thing_spawn(4, t_vile, 315);
        break;
}
}

But that more or less explains what I want, but isn't how it works.

blah.

Share this post


Link to post

There is an easier way to do this. Your mapspots can be set to whatever skill level, just like normal monsters and things. For instance, the mapspot(s) with a tid of 2 will have all skill level flags on, the mapspot(s) with a tid of 3 will have skill levels 3, and 4 and 5 checked, and the mapspots(s) with a tid of 4 will have only skill level 4 and 5 checked. Then you could just do this:

script 2 (void)
{
    Ceiling_RaiseByValue(8, 64, 120);
    Thing_Spawn(2, t_vile, 120);
    Thing_Spawn(3, t_vile, 225);
    Thing_Spawn(4, t_vile, 315);
}

Share this post


Link to post
Ichor said:

There is an easier way to do this. Your mapspots can be set to whatever skill level, just like normal monsters and things. For instance, the mapspot(s) with a tid of 2 will have all skill level flags on, the mapspot(s) with a tid of 3 will have skill levels 3, and 4 and 5 checked, and the mapspots(s) with a tid of 4 will have only skill level 4 and 5 checked. Then you could just do this:


I would have never thought of that. And it is so simple.
Thanks for the help.

Share this post


Link to post

uh, thing_spawn uses a byte angle, not one based on 360 deg in a circle: http://zdoom.doomworld.com/reference/defs.html

oh, and for fun and profit (with proper byte angles):

script 2 (void)
{
	ceiling_raisebyvalue(8, 64, 120);
	for(int w = 2, x = 0, y = 96, z = 128; x <= gameskill(); x++) {
		if(x == 1 || x == 4) continue;
		else {
			thing_spawn(w, t_vile, y);
			y += z; z = z >> 1; z *= -1; w++;
		}
	}
}

Share this post


Link to post

yes, but for some reason it doesn't support the shorthand versions, so I couldn't do z >>= 1; but ^ & | << >> all work

Share this post


Link to post
Cyb said:

uh, thing_spawn uses a byte angle, not one based on 360 deg in a circle


Oh, I was just using the numbers that were the same as the angle of the map spot thing.
In my case it would work better if the spawned viles were facing the wrong way.
Thanks for yet more help.

Share this post


Link to post
Cyb said:

yes, but for some reason it doesn't support the shorthand versions, so I couldn't do z >>= 1;

Ah, that's probably why it didn't work when I tried it out :)

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  
×