Script Help Thread

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Script Help Thread

Post by Amuscaria »

Im just making a script help thread for anyone that is new to ACS, such as myself. Right now, i can only work with scripts with only 1 variable. Anything more that makes my eyes bleed.

I need some help on a elevator script though.

Script 1 (int Elevtag)

{
FloorandCeiling_LowerByValue (Elevtag, 16, 252);
TagWait (Elevtag);
Delay (140);
FloorandCeiling_RaiseByValue (Elevtag, 16, 252);
}

this scripts lowers the ceilings and floors of 2 sectores. I have it so that when you cross a line, the elevator lowers, then it later rises back up. However, when I assiang another line to lower it back down (afer you get out of it into the lower floor), the thing acts up wierd. It would just UP into the ceiling and never come down aagain. I can't figure out what I'm doing wrong, since both lines are using the same script.
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Post by Risen »

Put another tagwait() after the second mover. The script is probably starting again before the floor finishes moving.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

Risen wrote:Put another tagwait() after the second mover. The script is probably starting again before the floor finishes moving.
Wait? So I need two tags?
User avatar
Bio Hazard
Posts: 4019
Joined: Fri Aug 15, 2003 8:15 pm
Location: ferret ~/C/ZDL $
Contact:

Post by Bio Hazard »

No, he means you should do this:

Code: Select all

Script 1 (int Elevtag){
    FloorandCeiling_LowerByValue (Elevtag, 16, 252);
    TagWait (Elevtag);
    Delay (140);
    FloorandCeiling_RaiseByValue (Elevtag, 16, 252);
    TagWait (Elevtag);
}
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

Oh i see. thanks a bunch. I'll give that a try.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

Can Two or more scripts use the same tag? Cuz i want a script to wait until another is finished before it executes.

Also, I have a question about the the script syntax. Are these the same things? I was just wondering so I can shorten the amount of lines used in my ACS scripts.

{
delay(70)
}

and

{delay(70)}
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Post by Cutmanmike »

Eriance wrote:Can Two or more scripts use the same tag? Cuz i want a script to wait until another is finished before it executes.

Also, I have a question about the the script syntax. Are these the same things? I was just wondering so I can shorten the amount of lines used in my ACS scripts.

{
delay(70)
}

and

{delay(70)}
Yes and yes. Don't forget the colons though.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

oops. Yeah, forgot about the colons. Another question. Im having trouble timeing some stuff right.

In Action Floor_RaiseByValue (tag,speed,movement), the speed is how many pixels the floor raises up per tic right? I have something that looks like this:

Spoiler:
The floor moves 1 unit for 102 units, so I assume that it wil ltake 102 tics before it completes. So I delay 102 tics before I call the next action. However, the next action executes before the thing is done raising. Is the speed NOT how many pixels the floor raises per tic? Or is it per second? per 8 tics?
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Post by Cutmanmike »

Eriance wrote:oops. Yeah, forgot about the colons. Another question. Im having trouble timeing some stuff right.

In Action Floor_RaiseByValue (tag,speed,movement), the speed is how many pixels the floor raises up per tic right? I have something that looks like this:

Spoiler:
The floor moves 1 unit for 102 units, so I assume that it wil ltake 102 tics before it completes. So I delay 102 tics before I call the next action. However, the next action executes before the thing is done raising. Is the speed NOT how many pixels the floor raises per tic? Or is it per second? per 8 tics?
Err.. I'm not quite sure about that but try this.

Code: Select all

Script 18 (void)
{
Print(s:"The Demon-Blood Reservoir is beginning to fill");
Ceiling_RaiseByValue(76,1,102);
Floor_RaiseByValue(74,1,102);
Floor_RaiseByValue(82,1,102);
Delay(102);
Print(s:"The Reservoir is filled");
}
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

Ok...it's indeed the speed is how many pixels the floor will raise for every 8 tics. I just tested it out.
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Post by Risen »

Eriance wrote:Can Two or more scripts use the same tag? Cuz i want a script to wait until another is finished before it executes.
Yes, but two actions can't affect the same sector at the same time. Use tagwait() at the beginning of the script, and it won't start in on the action until the other one is finished with its current action. You can also use scriptwait() if there are more than just sector actions. You'll probably want to use both to be safe.
Eriance wrote:Ok...it's indeed the speed is how many pixels the floor will raise for every 8 tics. I just tested it out.
This is another instance where tagwait() would be preferred. Then the speed doesn't matter, and you could change that or the heights later and not worry about how long it takes.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

Ok. I have a nother question about a script and if ti's possible. THis one, I have NO idea how to do.

Is it possible to have a script that allows the player to constantly shoot out a ring of projectiles? Or every so often as long as the player has a powerup that uses this script?

Also, is it possible to force a seeker missile to home in oh the player, that shot it, allowing it to kinda circle around him? Just wondering? If Someone can provide these script, it would be greatly appreciated.
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Post by Jimmy »

Eriance wrote:Also, is it possible to force a seeker missile to home in oh the player, that shot it, allowing it to kinda circle around him? Just wondering? If Someone can provide these script, it would be greatly appreciated.
Try making the seekermissile's maxangleturn/threshold thingy very low. Just an idea (I don't know if it WILL work).
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

jimmy91 wrote:
Eriance wrote:Also, is it possible to force a seeker missile to home in oh the player, that shot it, allowing it to kinda circle around him? Just wondering? If Someone can provide these script, it would be greatly appreciated.
Try making the seekermissile's maxangleturn/threshold thingy very low. Just an idea (I don't know if it WILL work).
No, that wont work. The seekermissiles does't seeker the player that shot it. Seeker missiles that was shot by another projectile will target the player, but will hurt him. Also, I need a script that shoots a missile out of the player, not a weapon.

I was also wondering, can A powerup give to different powerup types at the same time?
Locked

Return to “Editing (Archive)”