Hmmmmm, I put that in as a void script and tried to have to monster's spawn state execute so there TiD could be changed before the script activated but it still didnt work. So I decided to puke the script ingame and "1 of 12 Monsters" came up. I started killing the monsters 1 by and keep repuking the script and after about the 5th monster died it droped down to "0 of 12 Monsters" Funny thing is I looked at that monsters Decorate and theres nothing to explain why it was counted and the others weren't. IDK I don't think either scripts are working. I'll try to figure it out more tommorrow. Thanks for helping me out anyways.Ijon Tichy wrote:Code: Select all
HudMessage(d:ThingCount(T_NONE, 249), s:" of 12 monsters"; HUDMSG_PLAIN, 6, CR_YELLOW, 0.8, 0.2, 0);
Useful ACS Scripts
RE: Useful ACS Scripts
-
Ijon Tichy
- Frequent Poster Miles card holder
- Posts: 901
- Joined: Mon Jun 04, 2012 5:07 am
RE: Useful ACS Scripts
Code: Select all
script 31 OPEN
{
int monCount;
while (1)
{
monCount = ThingCount(0, 249);
HudMessage(d:monCount, s:" of 12 monsters"; HUDMSG_PLAIN, 6, CR_YELLOW, 0.8, 0.2, 0);
if (monCount == 0) { break; }
Delay(1);
}
}
Last edited by Ijon Tichy on Sun Sep 23, 2012 4:35 pm, edited 1 time in total.
RE: Useful ACS Scripts
Cool Thanks. That solved one of my problems. At least now the Hudmessege is Displaying now. Only problem is it still shows 0 of 12 monsters because there TiDs aren't changing. So I tried Spawning it without an Invasion spawner like this
cspitter2b is the monster. Anyways now at the start of the map it says "runaway script 1 terminated" and it won't even spawn. Obviously I screwed up the scripted again. I also wandering if I am just making things more complicated then they need to be.
Code: Select all
script 1 OPEN
{
while (( GetInvasionWave( ) != 1 ));
Spawn ("cspitter2b", -4864, 8576, 0, 249, 270);
While(( GetInvasionState( ) != IS_COUNTDOWN ));
delay( 1 );
Thing_remove(1);
Last edited by WhoDaMan on Sun Sep 23, 2012 7:14 pm, edited 1 time in total.
RE: Useful ACS Scripts
fixedIjon Tichy wrote: script 31 OPEN
{
int monCount;
while (1)
{
monCount = ThingCount(T_NONE, 249);
HudMessage(d:monCount, s:" of 12 monsters"; HUDMSG_PLAIN, 6, CR_YELLOW, 0.8, 0.2, 0);
if (monCount == 0) { break; }
Delay(1);
}
}
Thats because it needs to look like thisWhoDaMan wrote: cspitter2b is the monster. Anyways now at the start of the map it says "runaway script 1 terminated" and it won't even spawn.
Code: Select all
script 1 OPEN
{
while (GetInvasionWave() != 1);
Delay(1);
Spawn ("cspitter2b", -4864, 8576, 0, 249, 270);
while (GetInvasionState() != IS_COUNTDOWN);
delay(1);
Thing_remove(1);
}
Last edited by Llewellyn on Sun Sep 23, 2012 7:23 pm, edited 1 time in total.
RE: Useful ACS Scripts
OK cool thanks. I got it to spawn now but unfortuantly its either not spawning with the specified TiD, or the Thingcount script isn't reading the new TiD, or both. Point is its still displaying as 0 of 12 once all the monsters have spawned. I can't used namedthingcount because they each have a slightly different name.
EDIT: Ok, Ive determined the monster is spawning with the correct ID. I puked the script after it spawned and it went up to "1 of 12 monsters" then puked it again after I killed it and it went back down to 0.
EDIT: Ok, Ive determined the monster is spawning with the correct ID. I puked the script after it spawned and it went up to "1 of 12 monsters" then puked it again after I killed it and it went back down to 0.
Last edited by WhoDaMan on Sun Sep 23, 2012 8:22 pm, edited 1 time in total.
RE: Useful ACS Scripts
CAn you just post all of your acs so I can tell what you're doing wrong, instead of short snippets that have nothing to do with the actual problem?WhoDaMan wrote: OK cool thanks. I got it to spawn now but unfortuantly its either not spawning with the specified TiD, or the Thingcount script isn't reading the new TiD, or both. Point is its still displaying as 0 of 12 once all the monsters have spawned. I can't used namedthingcount because they each have a slightly different name.
EDIT: Ok, Ive determined the monster is spawning with the correct ID. I puked the script after it spawned and it went up to "1 of 12 monsters" then puked it again after I killed it and it went back down to 0.
RE: Useful ACS Scripts
ACS
Decorate of monster
My lasted attempt to get it to work. The Thing count in the first script works but.... trying to reexicute it in the monster's death state didn't work as once the monsters is dead it still says 1 of 12 instead of 0 of 12.
Code: Select all
script 1 OPEN
{
while (( GetInvasionWave( ) != 1 ))
{
delay( 1 );
}
Spawn ("cspitter2b", -4864, 8576, 200, 251, 270);
int monCount;
while (1)
{
monCount = ThingCount(T_NONE, 251);
HudMessage(d:monCount, s:" of 12 monsters"; HUDMSG_PLAIN, 6, CR_YELLOW, 0.8, 0.2, 0);
if (monCount == 0) { break; }
Delay(1);
While(( GetInvasionState( ) != IS_COUNTDOWN ))
delay( 1 );
}
Thing_remove(1);
}
script 31 OPEN
{
int monCount;
while (1)
{
monCount = ThingCount(T_NONE, 251);
HudMessage(d:monCount, s:" of 12 monsters"; HUDMSG_PLAIN, 6, CR_YELLOW, 0.8, 0.2, 0);
if (monCount == 0) { break; }
Delay(1);
}
}
Decorate of monster
Code: Select all
ACTOR cspitter2b : cspitterb
{
SpawnID 249
States
{
Spawn:
BBRN A 1
BBRN A 0 ACS_Execute (4, 14, 0, 0, 0) <==== Ignore
Goto see
See:
BBRN A 200
BBRN A 1 A_Custommissile ("iconcube3", 110, 0, 0, 2)
Loop
Death:
BBRN B 0 A_Die
BBRN B 0 ACS_Execute (5, 14, 0, 0, 0) <==== Ignore
BBRN B 1 A_Scream
BBRN B 1 A_Fall
BBRN B 1 ACS_Execute (31, 14, 0, 0, 0)
BBRN B -1
Stop
}
}
RE: Useful ACS Scripts
Delete script 31, it's causing problems, and then use this:
Code: Select all
int monCount;
script 1 OPEN
{
while (GetInvasionWave() != 1)
delay(1);
Spawn ("cspitter2b", -4864, 8576, 200, 251, 270);
while (1)
{
monCount = ThingCount(T_NONE, 251);
HudMessage(d:monCount, s:" of 12 monsters"; HUDMSG_PLAIN, 6, CR_YELLOW, 0.8, 0.2, 0);
if (monCount == 0)
break;
Delay(1);
}
While(GetInvasionState() != IS_COUNTDOWN)
delay(1);
Thing_remove(1);
}RE: Useful ACS Scripts
Thankyou SO MUCH. It worked!!!!! One last question. Do I use the same script for waves 2 and 3 if I want them to be the same way? and Thanks a ton to you and Ijon Tichy for all the help.
Nvm on question, I figured it out. Thanks again yall :D.
Nvm on question, I figured it out. Thanks again yall :D.
Last edited by WhoDaMan on Sun Sep 23, 2012 11:52 pm, edited 1 time in total.
-
TheBladeRoden
- Posts: 30
- Joined: Thu Jun 07, 2012 10:33 am
RE: Useful ACS Scripts
Here's a script to cap a player's freelook speed, useful for simulating vehicles or turrets and stuff. Though for some reason bots can still override it. Edit the "500" to taste.
Code: Select all
script 152 (void)
{
if (GetActorProperty(0, APROP_Health) > 0)
{
int AnglePre, PitchPre, AnglePost, PitchPost, AngleResult, OppositeAngle;
int MaxAnglePostLeft, MaxAnglePostRight;
int AltMaxAnglePostLeft, AltMaxAnglePostRight;
AnglePre=getactorangle(0);
PitchPre=getactorpitch(0);
MaxAnglePostLeft=AnglePre+500;
if (MaxAnglePostLeft > 65536)
{
MaxAnglePostLeft = MaxAnglePostLeft-65536;
}
MaxAnglePostRight=AnglePre-500;
if (MaxAnglePostRight < 0)
{
MaxAnglePostRight = MaxAnglePostRight+65536;
}
OppositeAngle = AnglePre-32768;
if (OppositeAngle < 0)
{
OppositeAngle = OppositeAngle + 65536;
}
Delay(1);
AnglePost=getactorangle(0);
PitchPost=getactorpitch(0);
int TooFarLeft = 0;
int TooFarRight = 0;
if(MaxAnglePostLeft < OppositeAngle)
{
if (AnglePost >= MaxAnglePostLeft && AnglePost <= OppositeAngle)
{
TooFarLeft = 1;
}
}
if(MaxAnglePostLeft > OppositeAngle)
{
if (AnglePost >= MaxAnglePostLeft && AnglePost <= 65536)
{
TooFarLeft = 1;
}
if (AnglePost >= 0 && AnglePost <= OppositeAngle)
{
TooFarLeft = 1;
}
}
if(MaxAnglePostRight > OppositeAngle)
{
if (AnglePost >= OppositeAngle && AnglePost <= MaxAnglePostRight)
{
TooFarRight = 1;
}
}
if(MaxAnglePostRight < OppositeAngle)
{
if (AnglePost >= 0 && AnglePost <= MaxAnglePostRight)
{
TooFarRight = 1;
}
if (AnglePost >= OppositeAngle && AnglePost <= 65536)
{
TooFarRight = 1;
}
}
if (ToofarLeft == 1)
{
SetActorAngle(0,AnglePre + 500);
AnglePost = AnglePre + 500;
}
if (ToofarRight == 1)
{
SetActorAngle(0,AnglePre - 500);
AnglePost = AnglePre - 500;
}
if(PitchPost > PitchPre + 500)
{
SetActorPitch(0,PitchPre + 500);
PitchPost = PitchPre + 500;
}
if(PitchPost < PitchPre - 500)
{
SetActorPitch(0,PitchPre - 500);
PitchPost = PitchPre - 500;
}
restart;
}
}
Last edited by TheBladeRoden on Fri Sep 28, 2012 9:59 am, edited 1 time in total.