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)
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