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

ACS not working

Recommended Posts

Hey, I'm new to DoomWorld, but I'm also on ST. I thought posting here would be better, because this is generally a larger forum.

Okay, I'm having an ACS problem. I'm making a monster spawn room, but some of it is not working.

I made it so that when you bump into a line in front of a switch, it displays the name of the monster.
What I don't get, is why the first one isn't working. It won't display "Zombiemen". I have no idea what's wrong.

I can assure you the linedef properties are correct. (Quadruple checked them.)

Here's the code for the bumping-into line. (sorry about the huge amount of text)

Script 15 (int MessageID)
{
if(messageID == 1)
{
print(s:"Zombiemen");
}
if(messageID == 2)
{
print(s:"Shotgunguys");
}
if(messageID == 3)
{
print(s:"Chaingun guys");
}
if(messageID == 4)
{
print(s:"Imps");
}
if(messageID == 5)
{
print(s:"Dark imps");
}
if(messageID == 6)
{
print(s:"Demons");
}
if(messageID == 7)
{
print(s:"Spectres");
}
if(messageID == 8)
{
print(s:"Cacodemons");
}
if(messageID == 9)
{
print(s:"Cacolanterns");
}
if(messageID == 10)
{
print(s:"Pain elementals");
}
if(messageID == 11)
{
print(s:"Lost Souls");
}
if(messageID == 12)
{
print(s:"Hell knights");
}
if(messageID == 13)
{
print(s:"Abaddons");
}
if(messageID == 14)
{
print(s:"Barons of hell");
}
if(messageID == 15)
{
print(s:"Arachnotrons");
}
if(messageID == 16)
{
print(s:"Revenants");
}
if(messageID == 17)
{
print(s:"Mancubus");
}
if(messageID == 18)
{
print(s:"NAZIS :D");
}
}
...And here is the spawning code. This one is activated when the player "uses" the switch.

(The first command for all of them (Ceiling lower to lowest) isn't working!!! Why won't it work!?)
Script 16 (int MessageID)
{
if(messageID == 1)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Zombiemen \cgSpawned");
SpawnSpot("Zombieman",54,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 2)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Shotgunguys \cgSpawned");
SpawnSpot("Shotgunguy",54,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 3)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Chaingun guys \cgSpawned");
SpawnSpot("Chaingunguy",54,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 4)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Imps \cgSpawned");
SpawnSpot("DoomImp",54,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 5)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"DarkImps \cgSpawned");
SpawnSpot("Darkimp",54,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 6)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Demons \cgSpawned");
SpawnSpot("Demon",54,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 7)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Spectres \cgSpawned");
SpawnSpot("Spectre",54,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 8)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Cacodemons \cgSpawned");
SpawnSpot("Cacodemon",54,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 9)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Cacolanterns \cgSpawned");
SpawnSpot("Cacolantern",54,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 10)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Pain elementals \cgSpawned");
SpawnSpot("Painelemental",55,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 11)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Lost souls \cgSpawned");
SpawnSpot("LostSoul",54,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 12)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Hell knights \cgSpawned");
SpawnSpot("Hellknight",55,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 13)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Abaddons \cgSpawned");
SpawnSpot("Abaddon",54,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 14)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Barons of hell \cgSpawned");
SpawnSpot("Baronofhell",55,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 15)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Arachnotrons \cgSpawned");
SpawnSpot("Arachnotron",55,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 16)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Revenants \cgSpawned");
SpawnSpot("Revenant",55,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 17)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"Mancubus \cgSpawned");
SpawnSpot("Fatso",55,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 18)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
print(s:"NAZI INVASION :D");
SpawnSpot("wolfensteinSS",54,51,90);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
if(messageID == 19)
{
Ceiling_lowerToLowest(58,100);
TeleportInSector (50, 54, 56, 1, 0);
Delay(35);
Print(s:"Monster room clean");
Thing_remove(51);
FloorAndCeiling_RaiseByValue (58, 100, 256);
Delay(35);
Floor_Lowertolowest(58,100);
Delay(35);
}
}
... So what the Hell is wrong? I just don't get it...


~[JP]

Share this post


Link to post

Puke the script to see if the script itself works. (In the console, type 'puke 15 5' or something to that effect. 15 being the script number and 5 being an arg, in this case, for int messageID.)

Share this post


Link to post

No, well, you see, it *Works*, just not on all of them. The first script works, but the zombieman and abaddon text don't show up. The rest of them do. For the second script, the first command for each doesn't work. Again, the rest does.

So I'm not quite sure what's wrong here... I assure you there is no startscript error.

Share this post


Link to post

This code is extremely redundant. A switch block (bottom of the page) would be more suitable in the 2nd case, where as an array would be better for the first case.

For example, the first case would be this:

str monsternames[18]={"Zombiemen","Shotgun Guys","Chaingun Guys","Imps","Dark Imps","Demons","Spectres","Cacodemons",
"Cacolanterns","Pain Elementals","Lost Souls","Hell Knights","Abaddons","Barons of Hell","Arachnotrons","Revenants",
"Mancubii","NAZIS :D"};

Script 15 (int MessageID)
{
 print(s:monsternames[MessageID--]);
}
instead of the mess you have at the moment. As for the problem about the script not working, it appears to be map based rather than script based as from what I can see, it should work. Double check arguments and tags.

Share this post


Link to post

Okay... This is really weird. I tried that new script, (Much simpler, thank you!) however, a new really WEIRD problem comes up. Not only does it not fix the real problem, it causes a weird bug. At the last one (18) It is supposed to display "NAZIS :D", but in the map test, it displays "CAMTX128". WTF.

I am starting to suspect that an earlier ACS script of mine was faulty, but then, how can Doom Builder not find these problems? How can it test the map when there are ACS problems?

This is almost a new entire question...

Share this post


Link to post

Do you have any camera scripts? If DB is still testing it correctly, then the ACS scripts might be messing each other up. Is there anything else using that variable?

And, what exactly isn't working? The ceiling change, right?

Share this post


Link to post

Hmm... Do I know you? Are you... you... Alsch?

Well, in any case, yes, there is a camera script. It displays fine though, and there is nothing wrong with the script.

SetCameraToTexture(19,"CAMTX128",95);
No, there is nothing using the one variable that I have just acquired.

And yes, the ceiling will not lower down. It is being a b*tch.

Share this post


Link to post

I assure you, I haven't the slightest clue what this "Alsch" is.


And check the line that has the camera texture on it. Is the variable right?

Share this post


Link to post

No, there is nothing wrong with the camera thing. I still just think DB2 is messed up for me. Here is another example that I just ran into:

Okay, here is another script that has 0 problems. DoomBuilder thinks that there IS a problem.

script 128 (Int MessageID)
{
    if(messageID == 1)
    {
        UnMorphActor(0);
        giveinventory("JustUnmorphed",1);
        delay(3);
        takeinventory("JustUnmorphed",1);
    }
    if(messageID == 2)
    {    <-***WTF THERES NOTHING WRONG***
        if(Checkinventory("IsNinja") = 1)
        {
            if(Checkinventory("Dontwantkatanaspec") = 0)
            {
            print(s:"Disabled the Katana special attack");
            giveinventory("Dontwantkatanaspec",1);
            }
            Else
            {
            print(s:"Enabled the Katana special attack");
            takeinventory("Dontwantkatanaspec",1);
            }
        }
        Else
        {
        print(s:"Nice try, man. You're not a \cgNinja\c-.");
        }
    }
}
It says there is a problem on line 32 (which is line 11 here, marked with the asterisks)

It says I'm missing a ')'. WTF.

And let me clear something out first. I did do the # include zcommon.acs thing. This script is part of my LOADACS lump, so I can use this script on every map.

Here is my complete ACS script (to be loaded on every map):
#library "JP_REL"
#include "zcommon.acs"

script 125 (void)
{
	giveinventory("Rkey",1);
	delay(2);
	takeinventory("Rkey",1);
}
script 126 (void)
{
	giveinventory("Kkey",1);
	delay(2);
	takeinventory("Kkey",1);
}
script 127 (void)
{
	giveinventory("Gkey",1);
	delay(2);
	takeinventory("Gkey",1);
}
script 128 (Int MessageID)
{
    if(messageID == 1)
    {
        UnMorphActor(0);
        giveinventory("JustUnmorphed",1);
        delay(3);
        takeinventory("JustUnmorphed",1);
    }
    if(messageID == 2)
    {
        if(Checkinventory("IsNinja") = 1)
        {
            if(Checkinventory("Dontwantkatanaspec") = 0)
            {
            print(s:"Disabled the Katana special attack");
            giveinventory("Dontwantkatanaspec",1);
            }
            Else
            {
            print(s:"Enabled the Katana special attack");
            takeinventory("Dontwantkatanaspec",1);
            }
        }
        Else
        {
        print(s:"Nice try, man. You're not a \cgNinja\c-.");
        }
    }
}


So I see nothing wrong. But DB2 says there is something wrong. Who's right, and what's wrong!??

Share this post


Link to post

Oh, that happened to me a lot of times. It's the ")" right before the "2" that it's not recognizing.

Share this post


Link to post

if(Checkinventory("IsNinja") = 1)

if(Checkinventory("Dontwantkatanaspec") = 0)

You're not checking for equality here (as you intended), but you try to assing a value.

Share this post


Link to post

Umm, I don't understand. I want the ACS script to check if the player has the inventory item. If it returns 1 (true), it will match 1. Interpreting the script I made:

If doomplayer has "IsNinja", execute the following.
If doomplayer has "Dontwantkatanaspec", execute the following.

You see? I'm not quite sure what I should do.

Share this post


Link to post

A single '=' is used to assing a value to a variable. If you check for equality you have to use two '=', i.e. '==' (as you already did a lolzillion times in the rest of your script.

So you have to write

if(Checkinventory("IsNinja") == 1)

and

if(Checkinventory("Dontwantkatanaspec") == 0)

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
×