ACS behaving strangely

Discuss all aspects related to modding Zandronum here.
Post Reply
jdagenet
Forum Regular
Posts: 192
Joined: Tue Jun 05, 2012 8:08 am

ACS behaving strangely

#1

Post by jdagenet » Wed Nov 30, 2016 6:43 pm

I'm trying to make a light weight .wad patch for a mod that you would just place at the very bottom of the file load order. The patch file contains an ACS script with a simple Log function to verify functionality.

Now, I have the Log function printing "Hello" as a string, but somehow it's printing the name of the map :eek: Not to mention the actual core of the script itself is not working when it in fact should.
Just to eliminate all possibilities, here are the scripts in question:
[spoiler]

Code: Select all

#include "zcommon.acs"

Script 789 (VOID)
{
if(CheckInventory("Choketeeth")<=0){//Wont trigger if activator isnt a Choke.
Terminate;
}
if(CheckInventory("HealDelay")>=1){//Neither if he recently healed from a non-lethal bite.
Terminate;
}
If(GetActorProperty(0, APROP_HEALTH)<=0){//Or when dead.
Terminate;
}

GiveInventory("HealDelay",1);
int h = GetActorProperty(0, APROP_HEALTH);
If(GetActorProperty(0, APROP_HEALTH)==124){
SetActorProperty(0,APROP_HEALTH,h + 001);//Heals will not go over 125 HP by this.
Terminate;
}
If(GetActorProperty(0, APROP_HEALTH)==123){
SetActorProperty(0,APROP_HEALTH,h + 002);
Terminate;
}
If(GetActorProperty(0, APROP_HEALTH)==122){
SetActorProperty(0,APROP_HEALTH,h + 003);
Terminate;
}
If(GetActorProperty(0, APROP_HEALTH)==121){
SetActorProperty(0,APROP_HEALTH,h + 004);
Terminate;
}
If(GetActorProperty(0, APROP_HEALTH)==120){
SetActorProperty(0,APROP_HEALTH,h + 005);
Terminate;
}
If(GetActorProperty(0, APROP_HEALTH)<=119){//119 or less health heals always for 6.
SetActorProperty(0,APROP_HEALTH,h + 006);
Terminate;
}
If(GetActorProperty(0, APROP_HEALTH)>=125){//Terminates if at or above 125 health.
Terminate;
}
}

Script 612 (void)
{
	Log(s:"Hello");
}
[/spoiler]

When I go in-game, I simply puke script 612 just to verify that Zandro is communicating with the code, which it does technically I guess, but like I said, it's retrieving the name of the map when it clearly should not be. I've already checked and made sure that the script numbers aren't conflicting with any other scripts that might be in the actual core of the mod itself.

I'm using the latest version of ACC to compile the scripts and I've tested this in both the latest official release of Zandro as well as 3.0 so I'm all out of ideas here.

Thank's in advance.

User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

Re: ACS behaving strangely

#2

Post by ZZYZX » Wed Nov 30, 2016 6:50 pm

Global(LOADACS) script? #library present? If not, put one.

User avatar
arkore
Forum Regular
Posts: 189
Joined: Mon Dec 17, 2012 8:01 pm

Re: ACS behaving strangely

#3

Post by arkore » Wed Nov 30, 2016 6:56 pm

Insert line at top of your code:

Code: Select all

#library "MYTEST"

jdagenet
Forum Regular
Posts: 192
Joined: Tue Jun 05, 2012 8:08 am

Re: ACS behaving strangely

#4

Post by jdagenet » Wed Nov 30, 2016 7:00 pm

Wow, that totally fixed it. Can't believe I forgot something that simple :lol:

Alright guys, thank's a ton!

Post Reply