Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Do0t

Acs code not working

Question

My acs code doesn't work even after i did a compiled version and a LOADACS, everytime i try to use the code on a map i get a console message"P_startscript; Unknown script "Test"." However, using the code directly on the Gzdoom Builider Script Editor with OPEN or map trigger seen to work. The Decorate trigger is a test actor using the lost soul as placeholder. I don't have a programming background and that's my first time doing something with Acs, the code is pretty mess and made with nothing but "if else" statements but it does work. The Acs purpose is to teleport the actor near the player when everything else is made on Decorate.

 

ACTOR Testemob 1050
{
  Health 10
  Radius 16
  Height 56
  Mass 50
  Speed 15
  Damage 3
  PainChance 0
  meleedamage 100
  meleerange 80
  Monster
  +FLOAT
  +NOGRAVITY
  +DONTFALL
  +NOICEDEATH
  +NOCLIP
  AttackSound "skull/melee"
  PainSound "skull/pain"
  DeathSound "skull/death"
  ActiveSound "skull/active"
  RenderStyle SoulTrans
  Obituary "$OB_SKULL" // "%o was spooked by a lost soul."
  States
  {
  Spawn:
    SKUL AB 10  A_Look
    Loop
  See:
    SKUL AB 5 A_Chase
    SKUL AB 0 A_JumpIfCloser (400,"FOUND")
     
    
    Loop
  
  FOUND:
   
   
   SKUL AB 3 A_FaceTarget (0)
   SKUL AB 0 ACS_NamedExecute ("Test",0)
   SKUL AB 0 A_Stop
      
   Goto See

 

---------------------------------------

#library "nope"

#include "zcommon.acs"


Script "Test" (void)
{

    int away = 1;

    int basex = GetActorX  (0);
    int basey = GetActorY (0);
    int basez = GetActorZ (0);

    int speedx = GetActorVelX (0);
    int speedy = GetActorVelY (0);

    int cool = 150 << 16;


    if ( CheckProximity(0,"Testemob",500.0, 1) )
        {


    Print(s:"Near");

         if (away==1) {


        away= random(5,7);


            if (away==5)

{SetActorPosition (5,basex+cool,basey, basez,0);}
            if (away==6)

{SetActorPosition (5,basex, basey+cool, basez,0);}
            if (away==7)

{SetActorPosition (5,basex, basey-cool, basez,0);}

SetActorVelocity (5,speedx,speedy,0,0,0);


             delay(30);


         }

        }
    else
         {

Print(s:"Away");

         }


    delay(10);


restart;
}
 

The random tid 5 is the tid i used when testing.

 

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 0
1 hour ago, Do0t said:

I'm not sure what is wrong but if you want a look yourself over the wad here's a link

 

https://nofile.io/f/7OPR8Jndn7F/Testingmap.wad

I see the problem.  You have your ACS scripts in a lump named SCRIPTS, but LOADACS is looking for a lump named nope.  Either change the name of the SCRIPTS lump to nope, to match what LOADACS is looking for, or change LOADACS to load the SCRIPTS lump, rather than the nope lump.

Share this post


Link to post
  • 0


I changed the name on the LOADACS to SCRIPTS and compiled the acs script again with SCRIPTS as name but still not working unfortunately. Anyway, thanks for the help but at this point i don't see what else i can do besides scrapping everything and giving up on the mod i'm working, no acs for me.

Share this post


Link to post
  • 0

I tried to change the name of the library from nope to SCRIPTS, but I couldn't compile it.  My compiler for Zandronum doesn't know what SetActorPosition is.

 

Anyway, don''t give up so fast.  Maybe somebody else here can help where I couldn't.  Try also asking in the ZDoom forums.

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
×