Enemy ignores you unless shot?

Discuss programming in the QuakeC language.
Post Reply
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Enemy ignores you unless shot?

Post by Baker »

Anyway to have a monster ignore you unless shot via QuakeC?
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Enemy ignores you unless shot?

Post by Spike »

notarget.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Enemy ignores you unless shot?

Post by Baker »

That made it sink in. Since I don't QuakeC much I can be a little "slow".
For anyone else else:

Added in defs.qc: float .peaceful; < ---- added that to end

Added in ai.qc @ FindTarget()

Code: Select all

	if (client == self.enemy)
		return FALSE;

	if (self.peaceful) // <---------------------- ADDED
		return FALSE; // <---------------------- ADDED

	if (client.flags & FL_NOTARGET)
		return FALSE;
And then in the entity:

{
"classname" "monster_army"
"origin" "0 576 24"
"angle" "0"
"peaceful" "1" // <------------------------- added
}
Such a grunt minds own business unless you attack him.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: Enemy ignores you unless shot?

Post by r00k »

you can edit the entity within QuakeC in soldier.qc

Code: Select all

void() monster_army =
{	
...
   self.peaceful = TRUE;
no need for .ent support or modified maps.
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Re: Enemy ignores you unless shot?

Post by frag.machine »

OTOH, maybe he wants only SOME of the soldiers to ignore the player.
Both methods work, but with different results.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: Enemy ignores you unless shot?

Post by mankrip »

Baker wrote:That made it sink in. Since I don't QuakeC much I can be a little "slow".
For anyone else else:

[...]
Such a grunt minds own business unless you attack him.
You forgot to code the "unless you attack him" part.

IIRC I've coded this as a feature in the Cheats Menu of my JoyMenu mod.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: Enemy ignores you unless shot?

Post by r00k »

mankrip wrote: You forgot to code the "unless you attack him" part.

IIRC I've coded this as a feature in the Cheats Menu of my JoyMenu mod.
in combat.qc, T_Damage

Code: Select all

	if ( (self.flags & FL_MONSTER) && attacker != world)
	{
		if (self.classname == "monster_army")
			self.peaceful = FALSE;

I was trying to think of a way to do this in the opposite way, where like if the player picks up a badge and soldiers would ignore the player if they had IT_BADGE for instance.
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: Enemy ignores you unless shot?

Post by qbism »

IT_BADGE would have similarities to invisibility power up?
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: Enemy ignores you unless shot?

Post by mankrip »

qbism wrote:IT_BADGE would have similarities to invisibility power up?
I don't think so. Sounds more like a way to scare monsters.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
Post Reply