How to make a Pawn temporary ignore Players?

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
User avatar
Barbie
Godlike
Posts: 2806
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

How to make a Pawn temporary ignore Players?

Post by Barbie »

I thought that setting SightRadius=0 for a ScriptedPawn would make it ignoring players, excepting being bumped or attacked of course. If I try this in a local match, it works as expected. If I try this online, the ScriptedPawn is attacking me immediately. Does anyone know the reason for this difference?
T3D of SkaarjLord0

Code: Select all

Begin Map
Begin Actor Class=SkaarjLord Name=SkaarjLord0
     FootRegion=(Zone=LevelInfo'MyLevel.LevelInfo0',ZoneNumber=1)
     HeadRegion=(Zone=LevelInfo'MyLevel.LevelInfo0',ZoneNumber=1)
     SightRadius=0.000000
     ViewRotation=(Yaw=-9152)
     Level=LevelInfo'MyLevel.LevelInfo0'
     Tag="SkaarjLord"
     Base=LevelInfo'MyLevel.LevelInfo0'
     Region=(Zone=LevelInfo'MyLevel.LevelInfo0',ZoneNumber=1)
     Location=(X=248.000000,Y=-80.000000,Z=-465.899994)
     Rotation=(Yaw=-9152)
     Name="SkaarjLord0"
End Actor
End Map
(I intend to reset the SightRadius later with a PropertyChanger.)
(I know that I could create a subclass with an additional state where SeePlayer is ignored.)
Attachments
SkaarjWithSightRadiusZero.jpg
SkaarjWithSightRadiusZero.unr
(5.01 KiB) Downloaded 2 times
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Buggie
Godlike
Posts: 2741
Joined: Sat Mar 21, 2020 5:32 am

Re: How to make a Pawn temporary ignore Players?

Post by Buggie »

Because in MH exists loop on timer which set visible player as enemy to all monsters. It be reason of waking up titans at some point.
User avatar
Barbie
Godlike
Posts: 2806
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: How to make a Pawn temporary ignore Players?

Post by Barbie »

But "MonsterHunt.MonsterHunt" is set as Default Game Type and on local play it works as expected? Also I set the same Game Type for online play.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Red_Fist
Godlike
Posts: 2166
Joined: Sun Oct 05, 2008 3:31 am

Re: How to make a Pawn temporary ignore Players?

Post by Red_Fist »

Try first turning things on, then off with a trigger and the flipper, (two flippers), or two times, like ignore, then not ignore and back to ignore. after match starts.

Also use the "Attitude" for the flipper like, ignore, then back again, then switch that with a trigger as above.
I think things need to change after the match starts, then back, using triggers. They need a basis to start from as opposed to getting it from the defaults, so it has to be done after the match starts.

still have to try your flipper, keep forgetting, but I think separate ones so a trigger can only force things one at a time per event.
Binary Space Partitioning
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: How to make a Pawn temporary ignore Players?

Post by sektor2111 »

"Statue" issue in Bot company or whatever controller goes awake because of "S.GoToState('Attacking')" without discrimination.
However... I solved issue in a different way... using a decoration looking as monster and spawning Monster only when desired moment arrived - just like that. Clearly Decoration won't attack anything... Why to mess up with a Pawn when we do have other options ? C'mon, be creative...
I even used a sort of fading, monster being slowly more and more visible until he started to move... (MH-ThoseSeasons if memory doesn't cheat me).
Buggie
Godlike
Posts: 2741
Joined: Sat Mar 21, 2020 5:32 am

Re: How to make a Pawn temporary ignore Players?

Post by Buggie »

Barbie wrote: Sat May 13, 2023 6:32 pm But "MonsterHunt.MonsterHunt" is set as Default Game Type and on local play it works as expected? Also I set the same Game Type for online play.
It work as expected - use MH as gametype.

MH work not as expected - force all monsters have Enemy = first visible player, not respect almost anything.
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: How to make a Pawn temporary ignore Players?

Post by sektor2111 »

Monster set normally works normally... OUT of game-type specific "changes".
But... (I did not check version 613) original MonsterHunt v503 in StartMatch() will set Attitude to player HATE (yeah, NaliRabbit is not ScriptedPawn anyway), doesn't matter map's setup,

Code: Select all

function StartMatch()
{
	local ScriptedPawn S;

	CountHunters();

	foreach AllActors(class'ScriptedPawn', S)
	{
		if ( !S.IsA('Nali') && !S.IsA('Cow') && !S.IsA('NaliRabbit') )
			S.AttitudeToPlayer=ATTITUDE_Hate; // You can forget your useless creativity about settings
	}

	super.StartMatch();
}
that's why it's always attacking Player not Bot. Bot is capturing attention based on its own code which does a CanSee() check which... clearly fails sometimes. If you think that it doesn't fail ever, check it yourself. I tested LineOfSight, CanSee, PlayerCanSeeMe, I know results, maybe you will want to know them as well... Original tweak helps at some low skilled manta which has IGNORE as Attitude but later spawned Monsters are just dumb when difficulty is not set in run-line (is ZERO by default).

Aside, because of these flaws, a few years ago I wrote something different in that last MH2 which I was using - enforcing difficulty based on game settings not based on run-line, and... monster is not only put back against player but it's more aggressive and capable to "tell" to another nearby monster about player, that's why I won't replace my "craps" with said updates* and I'm not interested how "creative" is mapper trying to work against game-type rules. Rule was clearly pointed in original version "Work with your teammates to hunt down the monsters!" and this is what I did, enforcing this rule and making things to work exactly on this way - as requested by default designed rule.

Back in Pawn stage (or continuing...) Any Non-Pawn actor can simulate a Monster until desired moment. I have never been attacked by a decoration.
Red_Fist
Godlike
Posts: 2166
Joined: Sun Oct 05, 2008 3:31 am

Re: How to make a Pawn temporary ignore Players?

Post by Red_Fist »

Yes if you wanted them to all spawn ignore after the one time, then it needs new class. But in my property flipper test map I start out (place) the skaarj as friendly, then I can flip it to hate or ignore or friendly over and over, unless it's killed.

So if you need it for a one time use, the property flipper works perfectly, using attitude.
Binary Space Partitioning
Post Reply