[floatcvt]A_CheckLOF not working

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [floatcvt]A_CheckLOF not working

Re: [floatcvt]A_CheckLOF not working

by Graf Zahl » Sun Apr 03, 2016 1:45 pm

No. One block is 128 map units - and I just fixed that.

Re: [floatcvt]A_CheckLOF not working

by Major Cooke » Sun Apr 03, 2016 1:34 pm

So technically, is the max distance limit 6400 currently?

Re: [floatcvt]A_CheckLOF not working

by Graf Zahl » Sun Apr 03, 2016 1:29 pm

Ok, found it.

But while I was debugging this I found something interesting:

Any sight check or trace that spans more than 100 blockmap blocks or more will fail, due to the infamous "for (count = 0 ; count < 100 ; count++)" loop in there that was added to catch lost traces due to the corner bug in the function. This will have to be increased and the checks made more robust so that it can handle such things.

Re: [floatcvt]A_CheckLOF not working

by Major Cooke » Sat Apr 02, 2016 6:57 pm

Tested again after the re-merge, still persistent.

Re: [floatcvt]A_CheckLOF not working

by Major Cooke » Sat Apr 02, 2016 9:49 am

Nope, it's not. Trying to figure out what's causing it...

Re: [floatcvt]A_CheckLOF not working

by Graf Zahl » Sat Apr 02, 2016 9:10 am

That's the sight check bug in play.
Should be fixed.

Re: [floatcvt]A_CheckLOF not working

by Major Cooke » Fri Apr 01, 2016 10:09 pm

Okay, I found an example. This only works if the zombie's up close.

Code: Select all

Actor ST : Zombieman
{
	States
	{
	See:
		POSS A 0
		{
			if (A_CheckLOF("Null",CLOFF_SKIPOBSTACLES|CLOFF_FROMBASE,32767,0,0,0,40))
			{	A_Log("Success");	}
			else
			{	A_Log("Failure");	}
		}
		POSS AABBCCDD 4 A_Chase("","")
		Loop
	}
}

Re: [floatcvt]A_CheckLOF not working

by Graf Zahl » Wed Mar 30, 2016 2:16 am

This is still not a bug in A_CheckLOF. A_RearrangePointers cannot do what you ask. It only can switch around target, tracer and master, nothing else.

Re: [floatcvt]A_CheckLOF not working

by Graf Zahl » Tue Mar 29, 2016 9:56 am

I haven't checked yet - too busy with other stuff.

Re: [floatcvt]A_CheckLOF not working

by Major Cooke » Tue Mar 29, 2016 8:39 am

So did this one check out better?

Re: [floatcvt]A_CheckLOF not working

by Major Cooke » Sun Mar 27, 2016 7:26 am

Whoops, copied the old code instead of the new when I pasted. I simply forgot an A_RearrangePointers.

Corrected code:

Code: Select all

Actor ST
{
	+NOINTERACTION
	States
	{
	Spawn:
		PLAY A 35 
		PLAY A 0
		{
			A_RearrangePointers(AAPTR_PLAYER1,AAPTR_DEFAULT,AAPTR_DEFAULT,4);
			if (A_CheckLOF("Null",CLOFF_FROMBASE,32767,0,0,0,40))
			{	A_Log("Success");	}
			else
			{	A_Log("Failure");	}
		}
		Stop
	}
}

Re: [floatcvt]A_CheckLOF not working

by Graf Zahl » Sun Mar 27, 2016 6:37 am

To be honest, I have no idea what you are expecting here.

First, this is missnig the CLOFF_ALLOWNULL flag, making it always fail by default and second, it contains absolutely no instructions what to do with a found target so it runs through with the BadActor flag being set and the target being ignored, even if the player is in the line of fire.

I'd say 'works as intended' here.

[floatcvt]A_CheckLOF not working

by Major Cooke » Fri Mar 25, 2016 2:18 pm

EDIT: Fixed code.

Code: Select all

Actor ST
{
	+NOINTERACTION
	States
	{Actor ST
{
	+NOINTERACTION
	States
	{
	Spawn:
		PLAY A 35 
		PLAY A 0
		{
			A_RearrangePointers(AAPTR_PLAYER1,AAPTR_DEFAULT,AAPTR_DEFAULT,4);
			if (A_CheckLOF("Null",CLOFF_FROMBASE,32767,0,0,0,40))
			{	A_Log("Success");	}
			else
			{	A_Log("Failure");	}
		}
		Stop
	}
}
This always fails. Summon ST in console. It should succeed if nothing's in the way, but it doesn't.

Top