[Solved] Script Working In GZDoom But Not Zandronum

Discuss all aspects related to modding Zandronum here.
Post Reply
false_chicken
 
Posts: 36
Joined: Sat Aug 09, 2014 10:47 pm

[Solved] Script Working In GZDoom But Not Zandronum

#1

Post by false_chicken » Wed Oct 12, 2016 11:03 pm

Hello again! I have found a ACS based headshot script I am trying to implement into my mod. I have found that it works in GZDoom but not Zandronum.

It used to execute a named script (Which Zandro does not support atm) so I changed it to a number but it still doesn't work in Zandronum (But the changed version still works in GZDoom).

The Script:

Code: Select all

#include "zcommon.acs"

script 500 (int bloodz) // blood's Z is already passed automatically
{
	int ownerz;
	
	
	// set activator to blood's owner, and retrieve its Z coord
	SetActivatorToTarget(0);
	
	if ((ClassifyActor(0) & ACTOR_MONSTER))
	{
		ownerz = GetActorZ(0) >> 16;
		
		int headshotheight = (GetActorProperty(0, APROP_HEIGHT) >> 16) - 20;
		int legshotheight = (GetActorProperty(0, APROP_HEIGHT) >> 16) / 4; // yeah the math here is bad but i don't care
		
		// head shot
		if (bloodz > (ownerz + headshotheight))
		{
			Thing_Damage2(0, 0x7FFFFFFF, "Normal"); // replace with your custom headshot damage type
		}
		
		// leg shot
		// uncomment and do your own custom leg shot damage states here.
		//if (bloodz < (ownerz + legshotheight))
		//{
		//	printbold(s: "legshot!");
		//	Thing_Damage2(0, 0x7FFFFFFF, "LegShotDamage");
		//}
	}
}
The Decorate Code:

Code: Select all

Actor Nash_Blood : Blood replaces Blood
{
	+PUFFGETSOWNER // we need this this flag for everything to work
	States
	{
		Spawn:
			TNT1 AA 0
			TNT1 A 1 ACS_ExecuteAlways(500, 0, z) // headshot/legshot check
			BLUD CBA 8
			Stop
	}
}
And The Source: http://forum.zdoom.org/viewtopic.php?f=37&t=36066

Any ideas? It no longer uses named scripts but it still fails in Zandronum. The script never runs. I tested this by having it run a console command if it did. GZDoom informs me that it does not support console commands but Zandronum does nothing. Thanks! (Running Zandronum 2.1.2)
Last edited by false_chicken on Thu Oct 13, 2016 12:50 pm, edited 1 time in total.

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

Re: Script Working In GZDoom But Not Zandronum

#2

Post by ZZYZX » Wed Oct 12, 2016 11:11 pm

Try to put printbold(s:"something") at the start of the script to verify for sure that it works.
Also, ClassifyActor might be unsupported in Zandronum.
Also, the script might not be present in the library loaded with the current map.
Also, are you sure that puff's target is the actor that spawned it? (note: under ZDoom 2.5 codebase, which is Zandronum)
Does manual "puke 500 0 48" while aiming at something work? (aiming at something is required so that you can get player's target)

If neither of the above helps you with the problem, then it's probably a Zan-specific bug that you should report on the tracker.

false_chicken
 
Posts: 36
Joined: Sat Aug 09, 2014 10:47 pm

Re: Script Working In GZDoom But Not Zandronum

#3

Post by false_chicken » Wed Oct 12, 2016 11:37 pm

I have gotten the script to run. I moved the script into my mods main autoloaded ACS file. It now runs and appears to fail at the ClassifyActor if statement. That seems to be the culprit. It passes in ZDoom.

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

Re: Script Working In GZDoom But Not Zandronum

#4

Post by ZZYZX » Thu Oct 13, 2016 12:22 am

Try Zandronum 3.0 unstable release. It's at codebase 2.7.1 and should support ClassifyActor. However, if you choose to develop for 3.0, your mod might not be playable for the majority the next few years until 3.0 is stable :)

false_chicken
 
Posts: 36
Joined: Sat Aug 09, 2014 10:47 pm

Re: Script Working In GZDoom But Not Zandronum

#5

Post by false_chicken » Thu Oct 13, 2016 12:48 pm

ZZYZX wrote:Try Zandronum 3.0 unstable release. It's at codebase 2.7.1 and should support ClassifyActor. However, if you choose to develop for 3.0, your mod might not be playable for the majority the next few years until 3.0 is stable :)
Yeah... That's my hindrance xD. I wanna use the latest features and part of me wants to get ahead of the curve so I don't have to make any changes later when 3.0 is stable but I also want people to be able to... you know... play the mod lol. Also I would have to build Zandro as I am on Linux and I did not see any binaries available for the dev version. Eventually ill get a build environment setup to play with it.

Thanks for your help!

Post Reply