Errors with ZScript in ULTIMATE DOOM BUILDER

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
Psychojack88
Posts: 15
Joined: Sat May 07, 2022 10:12 pm
Graphics Processor: nVidia (Modern GZDoom)

Errors with ZScript in ULTIMATE DOOM BUILDER

Post by Psychojack88 »

Trying to make a companion mod using NienerWiener's template and for some reason I'm getting script errors in Ultimate Doom Builder. I am really close to testing but been struggling here since this was a tried and true template and would really like to test this melee oriented character. Here's the list of errors.

GScript error, "DAISY ETERNAL ZScript BETA v1 copy.pk3:pj_dezscript/pj_daisyeternalspawner.zsc"G line 11:
GUnexpected '='
Expecting '-' or '+' or '++' or '--' or '.' or '(' or ';' or identifier or string constant or integer constant or 'super' or '~' or '!' or 'sizeof' or 'alignof' or unsigned constant or float constant or name constant or 'false' or 'true' or 'null'

GScript error, "DAISY ETERNAL ZScript BETA v1 copy.pk3:pj_dezscript/pj_daisyeternalspawner.zsc"G line 12:
GUnexpected ')'
Expecting '-' or '+' or '++' or '--' or '(' or 'class' or identifier or string constant or integer constant or 'super' or 'function' or '~' or '!' or 'sizeof' or 'alignof' or unsigned constant or float constant or name constant or 'false' or 'true' or 'null'

GScript error, "DAISY ETERNAL ZScript BETA v1 copy.pk3:pj_dezscript/pj_daisyeternalspawner.zsc"G line 15:
GUnexpected '}'
Expecting end of file or 'include' or 'extend' or 'class' or 'mixin' or 'struct' or 'const' or 'enum'

GScript error, "DAISY ETERNAL ZScript BETA v1 copy.pk3:pj_dezscript/pj_daisyeternalfriend.zsc"G line 61:
GUnexpected identifier
Expecting ';' or ','

Execution could not continue.
4 errors while parsing DAISY ETERNAL ZScript BETA v1 copy.pk3:zscript.txt

Here's the code for daisyeternalspawner.zsc

Code: Select all

Class DaisyEternalSpawnHandler : EventHandler
{
	Override Void PlayerEntered(PlayerEvent e)
	{
		Let pl = players[e.PlayerNumber].mo;
		
		let dke = pl.Spawn("DaisyEternal",pl.pos,ALLOW_REPLACE);
		If(dke)
		{
			dke.Master = pl;
			dke.Translation = pl.Translation;   ///////////////////// -->ERROR 1
			dke.A_FaceMaster();			///////////////////////-->ERROR2
		}
	}
} //////////////////////////////////////////////////////////////-->ERROR 3 ???
Here's the code for daisyeternalfriend.zsc

Code: Select all

class PJ_DaisyEternal : actor
{
	Int TeleTic;	
	Int	IdleTic;
	Default
	{
		Monster;
		Health 667;
		Radius 20;
		Height 40;
		Mass 100 ;
		Speed 12;
		PainChance 128;
		GibHealth -100;
		Damage 0;
		Height 40;
		MaxStepHeight 64;
		XScale 1;
		YScale 1;
		-COUNTKILL
		+LOOKALLAROUND
		+FLOORCLIP
		//+FRIENDLY --> Redundnat Code
		+NOTAUTOAIMED
		+SLIDESONWALLS
		+DONTMORPH
		+NOBLOCKMONST
		+QUICKTORETALIATE
		+NOICEDEATH
		+BUDDHA
		+AVOIDMELEE
		+MOVEWITHSECTOR
		//+SHOOTABLE Redundant Code
		+JUMPDOWN
		+DROPOFF 
		+FULLVOLSEE
		+DONTHARMSPECIES
		+NOINFIGHTSPECIES
		+NOTELEPORT
		+NOTELEFRAG
		+NOTARGET
		+NODAMAGETHRUST
		+GHOST
		//-SOLID Redundnat Code
		-COUNTKILL //Added Daisy can't be counted as kill. She's a friendly for Pete's sake!
		MaxStepHeight 48;
		MaxDropOffHeight 48;
		//Meleerange 64;
		//SeeSound "daisy/see";
		//DeathSound "daisy/death";
		//AttackSound "daisy/attack";
		//Obituary "%o got killed by a waifu rabbit. Probably deserved it"
		//Scale 0.8 Redundant
		//PainSound "daisy/pain";
		DamageFactor "BuildFriendDamage", 0;
		DamageFactor "DaisyEternalDamage"", 0;
		//var int user_distance;
	}
	override int TakeSpecialDamage(Actor inflictor, Actor source, int damage, Name damagetype)
	{
		if (source && (source.player || source is "DaisyEternal")) ////////////////////////////////////////////////--> ERROR 4
		{
			return 0;
		}
		return super.TakeSpecialDamage(inflictor, source, damage, damagetype);
	}
	Override Void PostBeginPlay()
	{
		Super.PostBeginPlay();
		A_StartSound("FriendMarine/Laugh",CHAN_VOICE);
		A_StartSound("FM/IntroSFX",CHAN_AUTO);
	}
	override void Tick() 
	{
		super.Tick();
		if (isFrozen())
		{
			return;
		}
		if (!master)
		{
			Spawn("TeleportFog", (pos.x, pos.y, pos.z + height * 0.5));
			Destroy();
			return;
		}
		if (health < default.health)
		{
			A_SetHealth(health + 1);
		}
	}
	Override bool CanCollideWith(Actor other, bool Passive)
	{
		If(!Other) 
		Return False;
		If(Other && !Passive)
		{
			If(Other.Player)
			{
				If(!Deathmatch) 
				Return False;
				Else If(Deathmatch && Other == Master) 
				Return False;
			}			
			If(Other.bMISSILE && Other.Target && Other.Target.Player)
			{
				If(!Deathmatch) 
				Return False;
				Else If(Deathmatch && Other.Target == Master) 
				Return False;
			}			
			Return True;
		}
		If(Other && Passive)
		{
			If(Other.Player)
			{
				If(!Deathmatch) 
				Return False;
				Else If(Deathmatch && Other == Master) 
				Return False;
			}			
			If(Other.bMISSILE && Other.Target && Other.Target.Player)
			{
				If(!Deathmatch) 
				Return False;
				Else If(Deathmatch && Other.Target == Master) 
				Return False;
			}
			Return True;
		}
		Return True;
	}	
	States
	{
    Spawn:
		PLAY E 1 A_Look;
		TNT1 A 0 A_CheckSight("TeleTic");
		Loop;
	See:
		PLAY AAAABBBBCCCCDDDD 1
		{
			If (Master && Distance3D(master) < 70)
			{
				Return ResolveState("Stand");
			}
			A_Chase();
			A_Recoil(-1);
			Return ResolveState(Null);
		}
		TNT1 A 0 A_CheckSight("TeleTic");
		Loop;
	TeleTic:
        TNT1 A 0 
        {
            if (teletic >= 5)
            {
                A_ClearTarget();
				teletic = 0;
				Warp(master, frandom(-16, -64), frandom(-64, 64), 0, 0, WARPF_STOP|WARPF_TOFLOOR);
            }
			teletic++;
        }
        Goto See;
	
Post Reply

Return to “Scripting”