ACS error

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
Martix10
Posts: 51
Joined: Wed Jul 30, 2014 10:37 pm

ACS error

Post by Martix10 »

Hi .. it's me again :lol:
ACS is killing me! :|
Well I made this code:

Code: Select all

#library "MAP1BACS"
#include "zcommon.acs"

/////////////////////////////////////
////Personel Computer -- 1 Room//////
/////////////////////////////////////

bool acess = false;
bool inAcess = false;
int currentOption = 0;
int num_options = 2;
str options [2] = {"        Personel Log", "Exit"};

//Theres just the Y, the X are the same
int optionsPos[5] = {180.0, 200.0, 220.0, 240.0, 260.0};



Script 100 (void)
{
    SetPlayerProperty(0, 1, PROP_TOTALLYFROZEN);
    inAcess = false;
    acess = true;
    sethudsize(128, 128, 1);
    SetFont("COMPCT01");
    HudMessage(s:"A"; HUDMSG_PLAIN, 999, CR_UNTRANSLATED, 64.0, 64.0, 0.0);
    
    sethudsize(800, 600, 1);
    SetFont("BIGFONT");
    hudmessage(s: "=======================================\n=====UAC Systems=====\n======================================="; HUDMSG_PLAIN, 900, CR_GREY, 400.0, 100.0, 255.0);
    
    SetFont("consolefont");
    hudmessage(s: options[0]; HUDMSG_PLAIN, 901, CR_GREY, 130.0, 180.0, 255.0);
    hudmessage(s: options[1]; HUDMSG_PLAIN, 902, CR_GREY, 130.0, 200.0, 255.0);
    
    acs_execute(101, 0, 0, 0, 0);
    
}

//Current Option
Script 101(void)
{
    sethudsize(800, 600, 1);
    SetFont("consolefont");
    hudmessage(s: ">"; HUDMSG_PLAIN, 903, CR_GREY, 100.0, optionsPos[currentOption], 255.0);
    
    delay(15);
    hudmessage(s: ""; HUDMSG_PLAIN, 903, CR_GREY, 100.0, optionsPos[currentOption], 255.0);
    delay(15);
    restart;

}

//Option UP
Script 102 (void)
{
if(acess)
{
    if(currentOption > 0)
    currentOption--;
}
}

//Option Down
Script 103 (void)
{
if(acess)
{
    if(currentOption < (num_options - 1))
    currentOption++;
}
}

//Select Option
Script 104 (void)
{
    if(acess == true && inAcess == false)
    {
    Acs_execute((105 + currentOption), 0, 0, 0, 0);
    }else if(acess == true && inAcess == true)
    {
    Acs_execute(100, 0, 0, 0, 0);
    }
}

//Personel Log
Script 105 (void)
{

inAcess = true;
ACS_Terminate(101, 0);
for (int i = 0; i < 5; i++) 
{
    hudmessage(s: ""; HUDMSG_PLAIN, (901 + i), CR_GREY, 0, 0, 0.0);
    
}
    sethudsize(800, 600, 1);
    SetFont("consolefont");
    Hudmessage(s:"Personel log - Johm Grimm == April 18 - 2056"; HUDMSG_TYPEON | HUDMSG_PLAIN, 902, CR_GREY, 300.0, 180.0, 999.0, 0.01, 10.0);
    hudmessage(s:"These nightmares, every day the same thing. The doctor said this could be caused\n",
               s:"by stress that this place offers, but I don't know if it's only that. It seems\n",
               s:"to have something more behind, I feel alive in the dream, I can feel pain, heat,\n",
               s:"cold.. everything! But I can't do that 'test' or whatever is that. If this\n",
               s:"continues I'll ask for a few days of license and get out of here .. I don't want\n",
               s:"to go crazy \n\n\n\nPress 'Select' to back"; 
     HUDMSG_TYPEON | HUDMSG_PLAIN, 901, CR_GREY, 400.0, 250.0, 999.0, 0.01, 10.0);
}

//Exit
Script 106 (void)
{
for (int i = 0; i < 5; i++) 
{
    hudmessage(s: ""; HUDMSG_PLAIN, (900 + i), CR_GREY, 0, 0, 0.0);
    
}
acs_terminate(101, 0);
hudmessage(s: ""; HUDMSG_PLAIN, 999, CR_GREY, 0, 0, 0.0);
acess = false;
inAcess = false;
SetPlayerProperty(0, 0, PROP_TOTALLYFROZEN);

}
It's compile in the DoomBuilder and runs good. But if I try to import I get this error
"Bad charecter in script text" MAP1BACS.acs(line1)

What the he** i did wrong ? :(
Last edited by Martix10 on Thu Jan 08, 2015 11:13 am, edited 1 time in total.
User avatar
Kappes Buur
 
 
Posts: 4182
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: ACS error

Post by Kappes Buur »

Just a general suggestion: Code should be using the code tags
http://forum.zdoom.org/viewtopic.php?f= ... 87#p805702

As to your script.
The error occurred with MAP1BACS. Shouldn't you be posting that one instead?
User avatar
Martix10
Posts: 51
Joined: Wed Jul 30, 2014 10:37 pm

Re: ACS error

Post by Martix10 »

Sorry about that :\
This is the MAP1BACS ..
User avatar
MaxED
Posts: 2246
Joined: Tue Feb 28, 2012 12:55 pm

Re: ACS error

Post by MaxED »

Works fine on my side (see attached pk3).
Also, make sure to read teh documentation.
Attachments
LibTest.pk3
(3.71 KiB) Downloaded 25 times
User avatar
Kappes Buur
 
 
Posts: 4182
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: ACS error

Post by Kappes Buur »

Martix10 wrote:This is the MAP1BACS ..
If that script is MAP1BACS, then why is it called with #library "MAP1BACS"?

Should it not be something like this

Code: Select all

#library "MAP1BACS"
#include "zcommon.acs"

Script 100 (void)
{
     //  some script contents here, but not MAP1BACS
} 
User avatar
MaxED
Posts: 2246
Joined: Tue Feb 28, 2012 12:55 pm

Re: ACS error

Post by MaxED »

Kappes Buur wrote:If that script is MAP1BACS, then why is it called with #library "MAP1BACS"?
Make sure to read teh documentation too!
Spoiler:
User avatar
Kappes Buur
 
 
Posts: 4182
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: ACS error

Post by Kappes Buur »

MaxED wrote: Make sure to read teh documentation too!
I did. However my interpretation was different.
From the text I thought that #library "MAP1BACS" called a script named MAP1BACS, located between A_ markers.
Sort of like a macro.

But 'declares current script as MAP1BACS library' puts an entirely different spin on my understanding. :)
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: ACS error

Post by FDARI »

By "try to import", do you mean when you try to compile another ACS script which references this library?
What file/path are you referencing with the offending #import command / where and how is the source stored?
(I always needed to keep external files with updated acs-source to compile scripts using library #import)
User avatar
Martix10
Posts: 51
Joined: Wed Jul 30, 2014 10:37 pm

Re: ACS error

Post by Martix10 »

Ok Ok .. I just erase everything, and did all again. Now is working ...
I didn't compile it, just put in a .txt file and imported it in the DoomBuilder
#import "C:\Games\Doom\Mod\acs\MAP1BACS.txt"

This thing is odd :(
Locked

Return to “Editing (Archive)”