Friendliness condition for A_JumpIfTargetInLOS

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: Friendliness condition for A_JumpIfTargetInLOS

Re: Friendliness condition for A_JumpIfTargetInLOS

by FDARI » Wed Mar 23, 2011 10:48 am

I've had a look at the possibilities. JLOSF_TEAMNOJUMP might be a better word. The engine has a test called "IsFriend" that one monster can call on another. If either of the monsters is not FRIENDLY at all, the function will return false (not friend). This means monsters that are not friendly to a player, are nobody's friends. The IsFriend-function looks like it takes teams into account wherever teamplay is possible.

A second flag would be needed to make one unfriendly monster avoid another unfriendly monster. (As mentioned, monsters without FRIENDLY-flag are enemies to everyone.) All it would do is prevent the jump if neither monster is friendly. Together, the two flags would work as the originally proposed JLOSF_FRIENDNOJUMP.

But what's a good name for the second flag?

JLOSF_TEAMNOJUMP: Prevents the jump if both monsters are associated with the same team. Does not prevent the jump if either monster is not associated with a team.
JLOSF_...NOJUMP: Prevents the jump if both monsters are non-friendly/hostile.

Re: Friendliness condition for A_JumpIfTargetInLOS

by Major Cooke » Tue Mar 22, 2011 8:05 pm

It'd also be handy if we could get something to measure DesignatedTeam.

Friendliness condition for A_JumpIfTargetInLOS

by FDARI » Tue Mar 22, 2011 4:51 pm

Included in http://forum.zdoom.org/viewtopic.php?f=34&t=29292 (using either patch 2 or patch 3)

I wish to discuss a possible feature. I'll readily write the code for it later, if there is any chance that it will be accepted. (Provided that it does not turn out to be overly difficult afterall.)

You might want infighting to be fully enabled, and still be able to make an actor distinguish between being shot by a friend and being shot by an enemy. Damage-type hacks are possible. A more explicit way of doing it, without using damage type to represent faction (unnatural use), would be to extend A_JumpIfTargetInLOS with a flag: JLOSF_FRIENDNOJUMP. It should also apply to A_JumpIfInTargetLOS, and may be possible to combine with JLOSF_CHECKMASTER and/or JLOSF_PROJECTILE.

Keep in mind, though, that not jumping is not proof that you're targeting a friend. It could also imply that your target is not in sight, not alive, or that you have no target.

Some consideration of the originating actor might be required. It is possible that the flag FRIENDNOJUMP will have effect only if both actors are qualified as players or monsters.

Top