Forum

Enemy ignores you unless shot?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Enemy ignores you unless shot?

Postby Baker » Mon Jul 14, 2014 3:25 am

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 ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Enemy ignores you unless shot?

Postby Spike » Mon Jul 14, 2014 4:10 am

notarget.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Enemy ignores you unless shot?

Postby Baker » Mon Jul 14, 2014 5:07 am

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 ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Enemy ignores you unless shot?

Postby r00k » Fri Jul 18, 2014 5:16 pm

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.
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Re: Enemy ignores you unless shot?

Postby frag.machine » Sat Jul 19, 2014 12:26 am

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)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Re: Enemy ignores you unless shot?

Postby mankrip » Sat Jul 19, 2014 6:21 am

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
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Re: Enemy ignores you unless shot?

Postby r00k » Mon Jul 21, 2014 3:50 pm

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.
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Re: Enemy ignores you unless shot?

Postby qbism » Mon Jul 21, 2014 4:30 pm

IT_BADGE would have similarities to invisibility power up?
User avatar
qbism
 
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am

Re: Enemy ignores you unless shot?

Postby mankrip » Tue Jul 22, 2014 2:15 am

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
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest