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: 72
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: 72
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: 1420
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: 72
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: 1339
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: 72
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: 1420
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: 56
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.

Return to “Scripting”