Block Monsters, not Bots... Anyone know how to do this?

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Block Monsters, not Bots... Anyone know how to do this?

Post by zacman »

Here's my problem: My queen has Teleport Destinations, but it appears that when she leaves the zone, she no longer teleports to them, and gets teleportation spazzes that we all just love her for :P I *Tried* using BlockMonster actors at the doorway, *BUT* it appears that these block BOTS form accessing the area too (They walk into it and get stuck >w>) Does anyone know how to block MONSTERS and not BOTS?
Image[url=steam://friends/add/76561198048595886]Image[/url]
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Block Monsters, not Bots... Anyone know how to do this?

Post by Feralidragon »

That's strange, I thought that bBlockActors wouldn't block bots, since they are "players", unless bBlockPlayers is something only thought for Unreal (like most of the engine mapping specific actors stuff), and therefore they didn't take "bots" into account, but only the "playerpawn".

Either ways, try this:

Code: Select all

class BlockMonstersFix extends Keypoint;

function Touch (actor Other)
{
	if (Pawn(Other) != None && !Pawn(Other).bIsPlayer)
		Other.Bump(self);
}

defaultproperties
{
     bCollideActors=True
     bStatic=False
}
By my own experiments, I think it works with bStatic=True as well (if so, it's better for performance reasons), but try it like that first to see if it works as it is. Basically, both players and bots will be able to pass, but other pawns will "bump" on it and should not pass.
Also, I didn't test the code, so there's absolutelly no guarantees it will work (I built it in a few seconds).
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Re: Block Monsters, not Bots... Anyone know how to do this?

Post by zacman »

Will try that, Thanks :B Failing that, since Im rebuilding the queen area anyway (Damn BSP holes :mad2: ) I'll just shrink the doorway so she can't get her fat ass thru :lol:
Image[url=steam://friends/add/76561198048595886]Image[/url]
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Re: Block Monsters, not Bots... Anyone know how to do this?

Post by zacman »

Didn't work :cry: Skaarj just ran right through it as if it wasn't even there :S
Image[url=steam://friends/add/76561198048595886]Image[/url]
User avatar
Shadow
Masterful
Posts: 743
Joined: Tue Jan 29, 2008 12:00 am
Personal rank: Mad Carpenter
Location: Germany
Contact:

Re: Block Monsters, not Bots... Anyone know how to do this?

Post by Shadow »

You should maybe try out the IsA function:

Code: Select all

function Touch (actor Other)
{
   if (Pawn(Other) != None && !Pawn(Other).bIsPlayer && Pawn(Other).IsA('Skaarj'))
      Other.Bump(self);
}
The bIsPlayer bool is rather irrelevant in this case, as ScriptedPawns don't have bIsPlayer = true
Image
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Re: Block Monsters, not Bots... Anyone know how to do this?

Post by zacman »

I just went ahead and changed the doorway in the end, lol, and by some miracle I didn't get a BSP explosion (I can't even add a cube without the map going OMGWTF .-.) Skaarj can still get thru, but as long as her heighness can't, its all good :tu: Thanks anyway
Image[url=steam://friends/add/76561198048595886]Image[/url]
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Block Monsters, not Bots... Anyone know how to do this?

Post by Feralidragon »

Shadow wrote:You should maybe try out the IsA function:

Code: Select all

function Touch (actor Other)
{
   if (Pawn(Other) != None && !Pawn(Other).bIsPlayer && Pawn(Other).IsA('Skaarj'))
      Other.Bump(self);
}
The bIsPlayer bool is rather irrelevant in this case, as ScriptedPawns don't have bIsPlayer = true
That was the idea regarding bIsPlayer. Bots and Players have bIsPlayer=True, while other pawns do not. However, further code reading tells that some pawns alternate this variable, so it would give bugs anyway, so yeah, bIsPlayer is not suited for the job.

In that case, IsA('ScriptedPawn') would be better, or perhaps create a name variable and then IsA(WhateverPawnNameVar), so a filtering could be defined by the mapper.
Perhaps Other.Bump(self) isn't working either for some pawns (well, since I already saw them "bumping" into stuff but keep going onto it lol).
So perhaps, it should be:

Code: Select all

class BlockMonstersFix extends Keypoint;

var() name PawnType;

function Touch (actor Other)
{
	if (Pawn(Other) != None && Pawn(Other).IsA(PawnType))
	{
		Other.Bump(self);
		Other.MoveSmooth(Other.OldLocation - Other.Location);
	}
}

defaultproperties
{
	PawnType=ScriptedPawn
    bCollideActors=True
    bStatic=False
}
User avatar
Shadow
Masterful
Posts: 743
Joined: Tue Jan 29, 2008 12:00 am
Personal rank: Mad Carpenter
Location: Germany
Contact:

Re: Block Monsters, not Bots... Anyone know how to do this?

Post by Shadow »

Yeah of course using a name Variable for the PawnType is indeed more comfortable.
Image
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Re: Block Monsters, not Bots... Anyone know how to do this?

Post by zacman »

Shadow wrote:You should maybe try out the IsA function:

The bIsPlayer bool is rather irrelevant in this case, as ScriptedPawns don't have bIsPlayer = true
SkaarjTrooper :B
Image[url=steam://friends/add/76561198048595886]Image[/url]
User avatar
Shadow
Masterful
Posts: 743
Joined: Tue Jan 29, 2008 12:00 am
Personal rank: Mad Carpenter
Location: Germany
Contact:

Re: Block Monsters, not Bots... Anyone know how to do this?

Post by Shadow »

I said >>rather<< ...
Image
Isotoxin
Adept
Posts: 285
Joined: Tue Mar 15, 2011 5:01 pm
Personal rank: Mapper
Location: Belgium

Re: Block Monsters, not Bots... Anyone know how to do this?

Post by Isotoxin »

What about, the Blockmonster actor?:P
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Block Monsters, not Bots... Anyone know how to do this?

Post by JackGriffin »

zacman wrote: I *Tried* using BlockMonster actors at the doorway
I know this thread is old, but is it still a problem? It would be simple to script a monster specific blocker that only blocks certain types of monsters/pawns.
So long, and thanks for all the fish
DeathoX 8
Experienced
Posts: 109
Joined: Sun Mar 27, 2011 12:56 pm

Re: Block Monsters, not Bots... Anyone know how to do this?

Post by DeathoX 8 »

BlockMonsters does indeed block also bots, if you don't mind seeing a couple of Skaarj flying you can use a Kicker that will affect only ScriptedPawns to achieve the same effect. It isn't a very subtle solution but I found it to be the most reliable...
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Block Monsters, not Bots... Anyone know how to do this?

Post by JackGriffin »

Here's the entire code:

Code: Select all

class BlockMonsters extends Keypoint;

defaultproperties
{
     bCollideActors=True
     bBlockActors=True
}
BlockMonsters is really a mis-naming of this actor. It's a block everything but playerpawn. You want a fixed one?
So long, and thanks for all the fish
Post Reply