Chopkinsca Posted January 12, 2004 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. 0 Share this post Link to post
Chopkinsca Posted January 12, 2004 The archviles don't spawn, except on skill 4 when the one at map point 2 is the only one that teleports in. 0 Share this post Link to post
Ichor Posted January 12, 2004 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); } 0 Share this post Link to post
Chopkinsca Posted January 12, 2004 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. 0 Share this post Link to post
Cyb Posted January 12, 2004 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++; } } } 0 Share this post Link to post
Cyb Posted January 12, 2004 yes, but for some reason it doesn't support the shorthand versions, so I couldn't do z >>= 1; but ^ & | << >> all work 0 Share this post Link to post
Chopkinsca Posted January 12, 2004 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. 0 Share this post Link to post
boris Posted January 12, 2004 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 :) 0 Share this post Link to post