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

Scripting Help for my new Zdoom based wad.

Recommended Posts

I'ver completely new to scripting, so I reallt have not much of any idea how it works. I wrote a script for my wad that controls a elevator with multiple sectors. I wanted it to lower, wait a bit, and automatically raise back to the original location.

here's the script:

#include "zcommon.acs"

//Elevator Control Script

Script 1 (int Elevtag)

{
Floor_LowerByValue (Elevtag, 16, 252);
Ceiling_LowerByValue (Elevtag, 16, 252);

Delay (140);

Floor_RaiseByValue (Elevtag, 16, 252);
Ceiling_RaiseByValue (Elevtag, 16, 252);
}

I get the lowering of the elevator to work. But once it lowers, it doesnt execute the second part of the script for some reason. I think it looks ok. Is ther something wrong?

EDIT: Ignore this. I've fixed the problem. there aren;t supposed to be spaces between each line of commands. But can anyone give be a better script for controlling this elecvator. I've read the Zdoom pages, but they aren't of much help.

Share this post


Link to post

You have to add a tagwait(elevtag); before the delay. This function waits until the elevator stops which looks like the thing you want. Your code hasn't finished moving the sector when the second set of calls is done and thus can't start that movement action.

BTW, there's a FloorAndCeiling_Lower/RaiseByValue call which might be better suited for elevators than doing it separately.

Share this post


Link to post
Graf Zahl said:

You have to add a tagwait(elevtag); before the delay. This function waits until the elevator stops which looks like the thing you want. Your code hasn't finished moving the sector when the second set of calls is done and thus can't start that movement action.

BTW, there's a FloorAndCeiling_Lower/RaiseByValue call which might be better suited for elevators than doing it separately.


thanks man. By the way. Are you the guy that made the Ghost Busters Doom? Or was it someone else?

Share this post


Link to post

I can't remember the syntax, but there is an acs special that moves the floor and ceiling together. Check the Zdoom Wiki - it should be there.

Graf Zahl didn't make Ghostbusters Doom, that Was Scuba Steve. Graf is the GZDoom guy.

Share this post


Link to post

Here's another problem while i was trying to compile another script. I wanted to script to activate when I kill all the monsters of a certain tag. A Bunch of floors would raise and and their textures and special would be set to normal to forma teleporter (the line specials i'll do later).

here's the script

Script 3 (void)

{
Floor_RaisebyValue (14, 16, 56);
Floor_RaisebyValue (20, 8, 16);
Floor_RaisebyValue (21, 8, 8);
Floor_RaisebyValue (22, 8, 8);
Floor_RaisebyValue (23, 8, 8);
Floor_RaisebyValue (24, 8, 8);
ChangeFloor (14, CEIL5_2);
ChangeFloor (20, CEIL5_2);
ChangeFloor (21, DEM1_4);
ChangeFloor (22, DEM1_3);
ChangeFloor (23, DEM1_2);
ChangeFloor (21, DEM1_1);
Print (s: "A teleporter Pad as appeared");
}

when I try to compile it it keeps pointing to my flat name and saying "Line 30 in file "C:\PROGRA~1\DOOMBU~1\script.acs" ...
C:\PROGRA~1\DOOMBU~1\script.acs:30: ceil5_2 : Identifier has not been declared.
> ChangeFloor (14, CEIL5_2);
> ^"

What is going on? O_o

Share this post


Link to post

Here are the two specials I was thinking about before.

FloorAndCeiling_LowerByValue (tag, speed, height);
FloorAndCeiling_RaiseByValue (tag, speed, height);

Yeah, and

changefloor(tag, "CEIL5_2");

like Graf said, should do it.

Share this post


Link to post

oooo...in quotes...i gotta remember that. O_o... Thanks a buch guys. Anyway. How do I set a up s script that executes after all enemies with a certain tag is killed? I've been messing around with the scripts and havent gotten it to work yet.

Also, another question. In the Hexen format, things, such as monsters can have special actions, I was wondering how these work. Do they work when they die, or what? If so, then I know how to make the script work. But if not..then i'm kinda lost o_o.

Share this post


Link to post
Ezxariarch said:

oooo...in quotes...i gotta remember that. O_o... Thanks a buch guys. Anyway. How do I set a up s script that executes after all enemies with a certain tag is killed? I've been messing around with the scripts and havent gotten it to work yet.


You have to test repeatedly with the thingcount function whether there are still monsters alive. Once all are dead you have to end the loop:

while (thingcount(T_NONE, tag)>0)
{
    delay (5);
}
... do your stuff here.

Also, another question. In the Hexen format, things, such as monsters can have special actions, I was wondering how these work. Do they work when they die, or what? If so, then I know how to make the script work. But if not..then i'm kinda lost o_o.


Yes, they are executed when the monster dies but in your case the thingcount method is probably easier.

Share this post


Link to post

I know how to use the boom Elevator to some extent, but i have to do I cant have a multiple secots as a art of the elevator if they have different heights (i can if they had the same ceiling and floor height with a few dummy sector tricks- used this in my DE-EP1's Map01). But i got it working pretty good now, though no perfect.

I have another question about a script that wont execute correctly. I understood how to use the thingcount now and was testing it out. Here's the idea, after 4 Hellknights with a tag of 100 is killed, a Teleporter will rise from the lava (changes to no floor-damage, texture, everything). When i had NO Hellknights placed in the map, this worked perfectly. But now, I have my 4 tag 100 hellknights in the map, they come out, i kill them, but nothing happens. Here's my script.

Script 4 (void)

{
While(ThingCount(T_HELLKNIGHT, 100) > 0);
Delay(35);
ACS_Execute (3, 0);
}
(script 3 is the script that does all the movement and floor chaning actions.)

Script 5 (void)

{
Floor_LowerByValue (11, 8, 112);
Delay (70);
Thing_Activate (100);
}

Thing 100 is the Hellknights

Should I have used "IF" instead of "While" ThingCount? DO I need another script just with this?

Script 6

{
ThingCount (T_HELLKNIGHT, 100) = 4;
}

Share this post


Link to post
Ezxariarch said:

While(ThingCount(T_HELLKNIGHT, 100) > 0);



Remove the semicolon from that line. It creates an empty loop so the script will be terminated by the engine after some time.

Share this post


Link to post

oooo o.o. You must be the god of scripting o_o. Thanks a bunch. BUt..heres another problem once i got the floors raised the teleporter appear. I cant seen to get the lines to change to type 70-teleporter type.

Here is the script that makes the teleporter appear.

Script 3 (void)

{
Floor_RaisebyValue (20, 8, 16);
Floor_RaisebyValue (21, 8, 8);
Floor_RaisebyValue (22, 8, 8);
Floor_RaisebyValue (23, 8, 8);
Floor_RaisebyValue (24, 8, 8);
ChangeFloor (20, "CEIL5_2");
ChangeFloor (21, "DEM1_4");
ChangeFloor (22, "DEM1_3");
ChangeFloor (23, "DEM1_2");
ChangeFloor (24, "DEM1_1");
SetLineSpecial (2990, 70, 2);
SetLineSpecial (2993, 70, 2);
SetLineSpecial (2994, 70, 2);
SetLineSpecial (2996, 70, 2);
SetLineSpecial (2997, 70, 2);
SetLineSpecial (2999, 70, 2);
SetLineSpecial (3000, 70, 2);
SetLineSpecial (3001, 70, 2);
Sector_SetDamage (20, 0, 0);
Sector_SetDamage (21, 0, 0);
Sector_SetDamage (22, 0, 0);
Sector_SetDamage (23, 0, 0);
Sector_SetDamage (24, 0, 0);
Print (s: "A teleporter platform has appeared");
}

for the SetLineSpecial, do i put the number of the line? Like, if the line was LineDef # 1000, i put that number in the first part? Or is the Line Id something else?

Share this post


Link to post
Ezxariarch said:

for the SetLineSpecial, do i put the number of the line? Like, if the line was LineDef # 1000, i put that number in the first part? Or is the Line Id something else?



The line ID is set with the special Line_SetIdentification (#121) in the map. There is no field where you could put it - an annoying shortcoming of Hexen's map format.

Share this post


Link to post

Sweeet Now the first level if my second episode is finished. Just gotta put a new few monsters into it. Just out of curiosity, can I turn off that autosave option in Zdoom?

Share this post


Link to post

I have a problem with some of my new projectiles that has the +DONTHURTSHOOTER command. It says it's not a actor property. Is there something wrong wtih the way I'm putting it? Here's my Decorate:

ACTOR Hellshot
{
Radius 3
Height 3
Speed 30
Damage 20
Scale 1.0
PROJECTILE
RENDERSTYLE ADD
ALPHA 0.95
DeathSound "weapons/firex3"
ExplosionDamage 128
ExplosionRadius 128
+DONTHURTSHOOTER
+FIREDAMAGE
States
{
Spawn:
HBAL A 2 Bright A_SeekerMissile (10, 20)
HBAL A 0 A_CustomMissile("RedPuff",0,0,0)
HBAL B 2 Bright A_SeekerMissile (10, 20)
HBAL B 0 A_CustomMissile("RedPuff",0,0,0)
HBAL C 2 Bright A_SeekerMissile (10, 20)
HBAL C 0 A_CustomMissile("RedPuff",0,0,0)
HBAL D 2 Bright A_SeekerMissile (10, 20)
HBAL D 0 A_CustomMissile("RedPuff",0,0,0)
loop
Death:
HBAL EF 3 Bright
HBAL G 3 Bright A_Explode
HBAL HI 3 Bright
stop
}
}


Also another question. I wanted to make projectiles that home on other projectiles ot create this spinning effect. Put A_Custommissile("Seeker", 5,0,0). But all it does is shoot the projeciles at me. Is there a way to make it so that it doesn't shoot me but rather the projecile that launched it? If that's even possible.

And is there ways to make the seeker missiles more aggressively seek out enemies instead of me having to point them at a target. Also, is there a way to increase their seeking rance. Right now, the missiles only seek if im standing 1024 units away or else it would just fly straight.

Share this post


Link to post
Ezxariarch said:

I have a problem with some of my new projectiles that has the +DONTHURTSHOOTER command. It says it's not a actor property. Is there something wrong wtih the way I'm putting it? Here's my Decorate:

ACTOR Hellshot
{
Radius 3
Height 3
Speed 30
Damage 20
Scale 1.0
PROJECTILE
RENDERSTYLE ADD
ALPHA 0.95
DeathSound "weapons/firex3"
ExplosionDamage 128
ExplosionRadius 128
+DONTHURTSHOOTER
+FIREDAMAGE
States
{
Spawn:
HBAL A 2 Bright A_SeekerMissile (10, 20)
HBAL A 0 A_CustomMissile("RedPuff",0,0,0)
HBAL B 2 Bright A_SeekerMissile (10, 20)
HBAL B 0 A_CustomMissile("RedPuff",0,0,0)
HBAL C 2 Bright A_SeekerMissile (10, 20)
HBAL C 0 A_CustomMissile("RedPuff",0,0,0)
HBAL D 2 Bright A_SeekerMissile (10, 20)
HBAL D 0 A_CustomMissile("RedPuff",0,0,0)
loop
Death:
HBAL EF 3 Bright
HBAL G 3 Bright A_Explode
HBAL HI 3 Bright
stop
}
}


Remove the '+' from DontHurtShooter. It's a property, not a flag.

Also another question. I wanted to make projectiles that home on other projectiles ot create this spinning effect. Put A_Custommissile("Seeker", 5,0,0). But all it does is shoot the projeciles at me. Is there a way to make it so that it doesn't shoot me but rather the projecile that launched it? If that's even possible.


Missiles can't home in on other missiles. They home in on the shooter's target. Due to some internal data design a missile's target is its shooter and that's why it doesn't work.

And is there ways to make the seeker missiles more aggressively seek out enemies instead of me having to point them at a target. Also, is there a way to increase their seeking rance. Right now, the missiles only seek if im standing 1024 units away or else it would just fly straight.


Currently not. Doom's targeting system doesn't allow more without some explicit programming for the missile.

Share this post


Link to post
Graf Zahl said:

Remove the '+' from DontHurtShooter. It's a property, not a flag.



Missiles can't home in on other missiles. They home in on the shooter's target. Due to some internal data design a missile's target is its shooter and that's why it doesn't work.



Currently not. Doom's targeting system doesn't allow more without some explicit programming for the missile.


Is there a way to MAKE the wraithverge using decorate? Current;y, i have made something like it, but its way too deadly. I have a projectil that is a ripper, has Hexen bounce, and is a seeker. It deals 1 damage using the strife system and lasts for 4 seconds. That was enough to kill the cyber demon in 1 shot. It, however, doesnt seek out the targets ater it kills the initial units. I did try another one using the lost soul as a base and putting ripper on it. But I was unable to make it DIE after 4 seconds ever though I put "goto death" after the attack sequence is finish. It works, but the missiles dont go away and contiues to slaughter everything. Is there a away to to remedy this or make the wraith verge possible?

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
×