Something is wrong with this HateThing script. What is it?!

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!)
User avatar
AshHouswares
Posts: 145
Joined: Fri Jun 03, 2022 11:31 am
Graphics Processor: Not Listed

Something is wrong with this HateThing script. What is it?!

Post by AshHouswares »

I'm having a problem with this script.

I have a hate target on the map tagged 2001.
I have a spawnspotfacingforced on the map tagged 257, which becomes a monster that inherits the tag 258.
I have an aiming camera tagged 912 which is supposed to show a scene where the spawned monster heads over to the hate_target to attack it, passing a dead body on the way which it ressurects like an archivile.

However this is not working. The monster in fact does the exact opposite, and turns AWAY from the hate_target to face the wall behind it, and becomes inactive.

What am I doing wrong here? Please help.

Code: Select all

Script 131 (void)
{
	SetPlayerProperty (0, 1, PROP_TOTALLYFROZEN);
	SpawnSpotFacingForced ("Demon", 256, 0);
	SpawnSpotFacingForced ("Demon", 257, 258);
	delay (10);
	ChangeCamera (912, 0, 0);
	Thing_Hate (258, 2001, 0);
	delay (150);
	ChangeCamera (0, 0, 0);
	SetPlayerProperty (0, 0, PROP_TOTALLYFROZEN);
}
Can someone enlighten me here? What the Hell is wrong with this?
User avatar
AshHouswares
Posts: 145
Joined: Fri Jun 03, 2022 11:31 am
Graphics Processor: Not Listed

Re: Something is wrong with this HateThing script. What is it?!

Post by AshHouswares »

I really need some help here, this is a bit ridiculous how long I've tried to fix this. The script is different now. I no longer spawn the monster in, it's now in a dummy room which is a replica of the main room. THe monster is placed in the map without a mapspot needed. It has the exact same issue though. It turns away from the monster and faces the wall and becomes inative (to the East). What the Hell is wrong with this garbage?

Code: Select all

//Archvile spawns in to resurrect dead demon. (cut scene).
Script 131 (void) //what the fuck is wrong with this cunting script!?!?
{
	SetPlayerProperty (0, 1, PROP_TOTALLYFROZEN);
	ChangeCamera (912, 0, 0);
	Thing_Activate (257);
	delay (10);
	Thing_Hate (257, 258, 0);
	delay (150);
	ChangeCamera (0, 0, 0);
	SetPlayerProperty (0, 0, PROP_TOTALLYFROZEN);
	Thing_Remove (258);
	Thing_Remove (257);
}
This is doing my head in, I feel like throwing the entire computer out the window at this point.
Jarewill
 
 
Posts: 1817
Joined: Sun Jul 21, 2019 8:54 am

Re: Something is wrong with this HateThing script. What is it?!

Post by Jarewill »

The only issue I can see is your Thing_Hate function sets the spawn spot to hate the spawned monster instead of making the monster hate the thing.
It would help if you could upload an example map showcasing your issue, as it's hard to debug code like this without knowing of the map.
User avatar
AshHouswares
Posts: 145
Joined: Fri Jun 03, 2022 11:31 am
Graphics Processor: Not Listed

Re: Something is wrong with this HateThing script. What is it?!

Post by AshHouswares »

Jarewill wrote: Tue Jan 24, 2023 2:17 pm The only issue I can see is your Thing_Hate function sets the spawn spot to hate the spawned monster instead of making the monster hate the thing.
It would help if you could upload an example map showcasing your issue, as it's hard to debug code like this without knowing of the map.
I don't understand it. I just literally copied the entire code and setup over to a single secluded area in a new map so I can share it (I've attached it here) and it works perfectly. What the Hell? Why won't it work in my main MAP then? Could it be because my map uses a ZSCRIPT monster instead of an archivile? If so should I share my script for the monster?
TEST MAP OF RESURRECTION.wad
You do not have the required permissions to view the files attached to this post.
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Something is wrong with this HateThing script. What is it?!

Post by ramon.dexter »

No, it's because you have another mistake in your main ma0. Share the main map then, if you want this solved.
User avatar
AshHouswares
Posts: 145
Joined: Fri Jun 03, 2022 11:31 am
Graphics Processor: Not Listed

Re: Something is wrong with this HateThing script. What is it?!

Post by AshHouswares »

I can't do that, it's a commercial project (keep in mind that "Archivile" is a placeholder. In my game, the Archivile is replaced with a 100% custom monster with similar behaviour written in ZSCRIPT.) Even if this was not the case, the file is ginormous, since the entire game is a single map, hence the large tag numbers. I'm one of the developers on the game Horryefieing: The Circle Mansion and I'm one of the script editors.

I honestly cannot understand the issue. The tags are not being uses elsewhere. I will tell you what I can do. Share a video clip of what is happening. I'll show you. I was reluctant to do so, as this counts as a spoiler for the game when it's not ecen released yet but looks like I have little choice right now.

Demonic Possession Cut-Scene Bug
Jarewill
 
 
Posts: 1817
Joined: Sun Jul 21, 2019 8:54 am

Re: Something is wrong with this HateThing script. What is it?!

Post by Jarewill »

We cannot debug a video and a working map.
You don't need to share the whole project, just a small slice of it that includes the issue and everything needed to trigger it.
For example that includes the map portion where it happens, the script and the custom monster.
We cannot help you without it.
User avatar
shino1
Posts: 60
Joined: Mon Dec 17, 2018 1:18 am

Re: Something is wrong with this HateThing script. What is it?!

Post by shino1 »

Is it your commercial project or a project you've been hired on with an NDA? Becuase if it's yours you can do what you want.
User avatar
AshHouswares
Posts: 145
Joined: Fri Jun 03, 2022 11:31 am
Graphics Processor: Not Listed

Re: Something is wrong with this HateThing script. What is it?!

Post by AshHouswares »

It's not mine alone, I'm just a coder. The game is owned by someone else, and everything in the game is done by a different team member (ie; sprite artist, texture artist, voxel artist, sound engineer and so on). Nobody will be happy with it all getting leaked before it's ready to release. The resources would undoubtedly be ripped and used before the original game they are from is even available. Considering the money that's gone into have those things made, it can't be leaked yet.
User avatar
AshHouswares
Posts: 145
Joined: Fri Jun 03, 2022 11:31 am
Graphics Processor: Not Listed

Re: Something is wrong with this HateThing script. What is it?!

Post by AshHouswares »

Hi I just wanted to throw an extra update on this here. I have discovered something. It is nothing to do with the script OR the map. The problem is the MONSTER itself. I know this for a fact, because I changed the ZSCRIPT MONSTER to a different DECORATE monster, and the issue was no longer present.

This issue is with my monster written in ZSCRIPT.

Code: Select all

class Mazzikim : Actor
{ 
//$Category Monsters
//$Title Mazzikim
//$Sprite SHESA1
	Default
	{
  Health 2000;
  DamageFactor "Normal", 0;
  DamageFactor "Light", 1.0;
  RenderStyle "Add";
  Scale 0.95;
  PainChance 100;
  Speed 5;
  Radius 30;
  Height 56;
  Mass 400;
  SeeSound "Mazzikim/Sight";
  AttackSound "demon/melee";
  PainSound "Shedim/Pain";
  DeathSound "Mazzikim/Death";
  ActiveSound "Mazzikim/active";
  DropItem "Bullets", 60;
  Monster;
  +NOGRAVITY
  +DROPOFF
  +FLOAT
  +FLOORCLIP
  //+TELESTOMP
  +DONTHARMCLASS
  +Float
  +NoBlood
  +LookAllAround
  +NoBlockMonst
  Obituary "%o was possessed by a Devil.";
  }
  States
  {
  Spawn:
    MAZZ AABBCCDD 3 A_VileChase;
    Loop;
  Melee:
    MAZZ EF 8 Fast A_FaceTarget;
    MAZZ G 8 Fast A_CustomMeleeAttack (random (2, 6) *5, "ClawHit", "skeleton/swing");
	MAZZ HI 8 Fast A_FaceTarget;
    MAZZ J 8 Fast A_CustomMeleeAttack (random (2, 6) *5, "ClawHit", "skeleton/swing");
    Goto Spawn;
  Heal:
    MAZZ RSTUV 2;
    Stop;
  Pain:
	MAZZ K 2 Fast;
	MAZZ K 2 Fast A_Pain;
	Goto Spawn;
  Death:
	MAZZ L 8;
	MAZZ M 8 A_Scream;
	MAZZ N 4;
	MAZZ O 4 A_NoBlocking;
	MAZZ P 4;
	MAZZ Q -1;
	Stop;
  }
}
This is my ZSCRIPT monster code, can anybody see anything here that would be causing the issue shown in the video above? Please, if someone can help I would be very grateful. The issue has been narrowed down to just the monster itself. But I cannot figure out what that error is.

EDIT:
THIS ISSUE HAS NOW BEEN RESOLVED. I figured out the issue. The monster had no SEE state, so it was essentially blind and thus, could not see the Hate_Target. It's fixed now and working perfectly.

Return to “Scripting”