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

Help With Script

Recommended Posts

		Script 5 (void)
     Light_ChangeToValue (6, 56); //Lowers lights to 56 in sector 6
     Thing_Spawn (5, T_ZOMBIE, 180); //Spawns Zombies
     delay (90);
     Ceiling_RaiseInstant (7, 0, 16); //Raises sector 7 to 16 * 8 = 128
     delay (90);
     Light_ChangeToValue (6, 128); //Raises lights to 128 in sector 6

Alright, so the plan is you open the door, you see the stuff on the other side of the room, you walk over there, and walking over the green lines triggers the sequence in the script.

1. It gets dark
2. Zombies start spawning
3. You're running around in the dark with zombies
4. A section of the wall opens up
5. You're still running around in the dark with zombies
6. Then the lights kick in.

That's what the script looks like it does. (To me a least.)

When I play the map what happens is.

1. It gets dark.
2. Zombies spawn.
3. Lights come back on.
4. Lights go off.
5. More zombies spawn.
6. Wall opens up.
7. Lights come back on.

Another problem is you can trigger this script three times in a row.

I've used the Spawn_Thing two others times in the map with no problem.
I've used the Ceiling_RaiseInstant once in the same map with no problem.
I've also used the delay script.

If you want me to post the map so you can have a closer look just tell me and I'll upload it.

Also, in case someone is confused, what I want to happen is the first example (what I thought it would do)

P.S if there is a better way to spawn numerous amounts of units at once, please tell. I don't like all the teleport things all over the place. :P

Share this post

Link to post

It depends how its running. If youre using the line special, its possible that you have more than one line running this script, and by crossing one line and then another youre activating the script more than once. If it only needs to run once the lazy way to fix would be to declare a random variable, if it equals 0 then execute the rest of the script, then add 1 to the variable at the end.

Share this post

Link to post

I found the problem and narrowed it down to it was because there are three lines. When you cross one line, it triggers the script when you cross another line it triggers the script again.

Then someone from the zDoom forum helped me to fix it.

Share this post

Link to post

Someone in the zDoom forum helped me out on this one.

Anyway, I have another question about a different script, but I didn't want to make another thread with almost the identical name.

So, there is a room in my map with a switch that triggers stairs in another room to build up, and it spawns six hell knights in the room you're in. I want to know how to make the door lock, and only unlock once all six hell knights are dead.

Share this post

Link to post

You could either assign a thing special to the spawned Hell Knights that activates a script to check if they're all dead, or you could assign them a tid and set up a loop after they spawn and keep checking the thing count of all monsters with that tid.

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