Errors with ZScript in ULTIMATE DOOM BUILDER [SCRAPPED/IGNORE]

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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!)
Psychojack88
Posts: 53
Joined: Sat May 07, 2022 10:12 pm
Graphics Processor: nVidia (Modern GZDoom)

Errors with ZScript in ULTIMATE DOOM BUILDER [SCRAPPED/IGNORE]

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;
	
Last edited by Psychojack88 on Wed Oct 29, 2025 5:14 pm, edited 2 times in total.
Psychojack88
Posts: 53
Joined: Sat May 07, 2022 10:12 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Errors with ZScript in ULTIMATE DOOM BUILDER [SCRAPPED/NOT NEEDED]

Post by Psychojack88 »

I'm posting this as scrapped because this particular issue has long been resolved and has no need of any more help. It was just a simple syntax error on my part and I have been able to go around this issue just fine. Consider this post for the scrapyard.
User avatar
Enjay
 
 
Posts: 27298
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Errors with ZScript in ULTIMATE DOOM BUILDER [SCRAPPED/IGNORE

Post by Enjay »

We tend not to put threads in the garbage unless there is a very good reason (like the thread being against the rules etc).

In this case it might not be that valuable because things didn't get resolved but quite often if someone is searching for something and they stumble upon a thread it can help them - even sometimes in situations where the problem wasn't fully resolved.

So, we tend not to delete threads and also ask that people don't blank or otherwise remove the contents of their posts just because they are done with them. (Not that you were doing that, I'm just explaining why we keep stuff.)

Similarly, if someone finds a solution to their problem, it's nice of they come back and explain what it was because it can help someone else.
Psychojack88
Posts: 53
Joined: Sat May 07, 2022 10:12 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Errors with ZScript in ULTIMATE DOOM BUILDER [SCRAPPED/IGNORE

Post by Psychojack88 »

Oh I see. Apologies Enjay, I didn't know. I figured that if it wasn't something that was going to be resolved then best not to waste the site space and was just placing a notification that I don't really need to resolve the issue.

With that said, I understand. I just say scrapped as in I'm probably not going to come back to this one since the issue is pretty much not something for me to resolve or need to resolve. Sorry for the confusion and my misunderstanding Enjay. You're right, someone else might have need of this in the future, may help them in some way with a specific issue down the line.

Return to “Scripting”