Script Help Thread
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.
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.
Script Help Thread
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.
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.
- Bio Hazard
- Posts: 4019
- Joined: Fri Aug 15, 2003 8:15 pm
- Location: ferret ~/C/ZDL $
- Contact:
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);
}
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)}
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)}
- Cutmanmike
- Posts: 11354
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Yes and yes. Don't forget the colons though.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)}
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:
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?
- Cutmanmike
- Posts: 11354
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Err.. I'm not quite sure about that but try this.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?
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");
}
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:Can Two or more scripts use the same tag? Cuz i want a script to wait until another is finished before it executes.
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.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.
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.
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.
Try making the seekermissile's maxangleturn/threshold thingy very low. Just an idea (I don't know if it WILL work).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.
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.jimmy91 wrote:Try making the seekermissile's maxangleturn/threshold thingy very low. Just an idea (I don't know if it WILL work).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.
I was also wondering, can A powerup give to different powerup types at the same time?