[not needed] A_JumpIfFarther

Moderator: Graf Zahl

User avatar
Zeg-Vok
Posts: 233
Joined: Wed Sep 21, 2005 18:04
Location: Up the creek without a paddle

[not needed] A_JumpIfFarther

Post by Zeg-Vok »

A_JumpIfFarther (int distance, int offset)

Something that seems like it could be easily implimented, and could be rather useful, ie and monster is firing off grenade rounds with SpidRefire or something like that, and when the target gets too far away, it will keep firing grenade rounds untill he either hits his pain state, loses its los, or dies.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany

Post by Graf Zahl »

Why don't you use A_JumpIfCloser?
User avatar
Zeg-Vok
Posts: 233
Joined: Wed Sep 21, 2005 18:04
Location: Up the creek without a paddle

Post by Zeg-Vok »

Well, say I had the Monster shooting grenade salvos at the player with a refire, and the player gets out of range of the grenade salvos, the monster wont stop shooting the grenade salovs unless he dies, loses the LOS, or hits his pain state. Wereas I could use A_JumpIfFarther to just simply call off the grenade salvos, and bring the monster back up to the see state, were I would use JumpIfClosers to decide which attack it would use next.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany

Post by Graf Zahl »

Since it is the exact opposite and it doesn't matter what you are doing in which branch I don't see your problem.
User avatar
chopkinsca
Posts: 183
Joined: Thu Dec 29, 2005 8:09

Post by chopkinsca »

Code: Select all

FRAM A 0 A_JumpIfCloser(256, 1)
goto see
//continue with attack

No need for jumpiffarther when you can just use the jumpifcloser logic in reverse, as Graf already pointed out.
User avatar
solarsnowfall
Persecution Complex
Posts: 363
Joined: Fri Aug 05, 2005 8:51

Post by solarsnowfall »

I think you need a jump offset of at least 2. Unless somethings changed in DECORATE...
User avatar
chopkinsca
Posts: 183
Joined: Thu Dec 29, 2005 8:09

Post by chopkinsca »

Jumping only once to skip a goto has always worked for me for years now.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany

Post by Graf Zahl »

solarsnowfall wrote:I think you need a jump offset of at least 2. Unless somethings changed in DECORATE...

You think wrong.

anyway, case closed.

Return to “Closed Feature Suggestions”