Property: maxtargetrange [range]
Moderator: GZDoom Developers
-
ant1991331
- Posts: 598
- Joined: Fri Jun 24, 2005 3:19 am
- Location: Makin tracks with jetboots
Property: maxtargetrange [range]
The monster's target must be within [range] in order to start attacking. (Good for monsters with short-range weapons...)
- Osiris Kalev
- Posts: 290
- Joined: Sun Aug 20, 2006 11:06 pm
- Location: Australia, Elsewhere Within
- Contact:
-
ant1991331
- Posts: 598
- Joined: Fri Jun 24, 2005 3:19 am
- Location: Makin tracks with jetboots
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Why wouldn't it work? Did it look something like
?
Code: Select all
Missile:
MNST E 0 A_JumpIfCloser (512, 1)
goto See
MSNT E 8 A_FaceTarget
...-
ant1991331
- Posts: 598
- Joined: Fri Jun 24, 2005 3:19 am
- Location: Makin tracks with jetboots
More like...Vaecrius wrote:Why wouldn't it work? Did it look something like?Code: Select all
Missile: MNST E 0 A_JumpIfCloser (512, 1) goto See MSNT E 8 A_FaceTarget ...
Code: Select all
Missile:
NOD6 EF 10 A_FaceTarget
NOD6 G 0 A_JumpIfCloser(156,2)
NOD6 G 0 A_PlaySound("grenade/fire")
NOD6 G 4 Bright A_CustomMissile("NODGrenade", 38, 10, 0, 0, 64)
NOD6 F 4 A_FaceTarget
goto See
-
ant1991331
- Posts: 598
- Joined: Fri Jun 24, 2005 3:19 am
- Location: Makin tracks with jetboots
-
ant1991331
- Posts: 598
- Joined: Fri Jun 24, 2005 3:19 am
- Location: Makin tracks with jetboots
Code: Select all
Fire:
TIBR B 1
TIBR C 0 A_PlaySound("mantis/fire")
TIBR C 1 BRIGHT A_FireCustomMissile("ToxinShell",1,1,1)
TIBR D 1 A_GiveInventory("MantisClip",1)
TIBR E 2
TIBR A 2 A_JumpIfInventory("MantisClip",50,2) <--- this will jump the next frame and the goto bit.
TIBR A 1 A_Refire
goto Ready
TIBR A 4 A_PlayWeaponSound("mantis/reload")
TIBR FGFFFAAHIJIH 5
TIBR A 5 A_TakeInventory("MantisClip",50)
Goto Ready
-
ant1991331
- Posts: 598
- Joined: Fri Jun 24, 2005 3:19 am
- Location: Makin tracks with jetboots
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Let's say you've got the following:
Here, the jump would go three frames: the jump call would skip A, B, and C, landing on D.
Without the jump, the actor would execute frames ABC first before it can do anything with D.
Now let's say we had this:
Here, the jump would go three frames: the jump call would skip A, B, and C, landing on D. It then executes D which is already past the goto and therefore doesn't execute the goto.
Without the jump, the actor would go through frames ABC, then encounter the goto, then go to its see state without hitting D.
The way I think about it is that the jump number should be the number of frames before the frame you want to jump to, including the frame that calls the jump and excluding the frame you want to jump to.
Code: Select all
MNST A 1 A_JumpIfHealthLower (20, 3)
MNST B 1
MNST C 1 A_AlertMonsters
MNST D 1Without the jump, the actor would execute frames ABC first before it can do anything with D.
Now let's say we had this:
Code: Select all
MNST A 1 A_JumpIfHealthLower (20, 3)
MNST B 1
MNST C 1 A_AlertMonsters
goto See
MNST D 1Without the jump, the actor would go through frames ABC, then encounter the goto, then go to its see state without hitting D.
The way I think about it is that the jump number should be the number of frames before the frame you want to jump to, including the frame that calls the jump and excluding the frame you want to jump to.
