Page 1 of 1

ACS behaving strangely

Posted: Wed Nov 30, 2016 6:43 pm
by jdagenet
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.

Re: ACS behaving strangely

Posted: Wed Nov 30, 2016 6:50 pm
by ZZYZX
Global(LOADACS) script? #library present? If not, put one.

Re: ACS behaving strangely

Posted: Wed Nov 30, 2016 6:56 pm
by arkore
Insert line at top of your code:

Code: Select all

#library "MYTEST"

Re: ACS behaving strangely

Posted: Wed Nov 30, 2016 7:00 pm
by jdagenet
Wow, that totally fixed it. Can't believe I forgot something that simple :lol:

Alright guys, thank's a ton!