A_Chase flag; wandering movement

Moderator: GZDoom Developers

User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Re: A_Chase flag; wandering movement

Post by Zippy »

Ghastly_dragon wrote:

Code: Select all

  See:
    POSS A 0 A_Chase("", "Missile", 16)
    POSS A 4 A_Wander
The 16 in the A_Chase is the CHF_DONTMOVE flag. This gives the wandering movement, but should attack as normal.
Why not just use the flag name to make it more readable?

Code: Select all

  See:
    POSS A 0 A_Chase("", "Missile", CHF_DONTMOVE)
    POSS A 4 A_Wander
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_Chase flag; wandering movement

Post by Graf Zahl »

Because some people apparently still don't understand what a predefined constant is! :twisted:
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: A_Chase flag; wandering movement

Post by NeuralStunner »

Ghastly may mean for that to be Skulltag compat, which for some reason doesn't always have named constants. :P
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: A_Chase flag; wandering movement

Post by Ghastly »

NeuralStunner wrote:Ghastly may mean for that to be Skulltag compat, which for some reason doesn't always have named constants. :P
That and out of personal habit. I always manage to typo the flags, somehow.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: A_Chase flag; wandering movement

Post by NeuralStunner »

Skultlag's riuned youu. :P
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: A_Chase flag; wandering movement

Post by Xaser »

Heh, I succumb to the (probably bad) habit of using the numbers when combining flags, since I hate having incredibly long lines of (albeit easily readable) pipe-delimited flag names. :P

It sure is a good thing I don't write software.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: A_Chase flag; wandering movement

Post by Gez »

Even numbers won't help you when you have to use A_SpawnItemEx("Blah", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1). :p

Yes I'm dissing the non-optimal order of the parameters here.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: A_Chase flag; wandering movement

Post by NeuralStunner »

Oh come on. There aren't that many parameters!

(Take out one zero. :P )
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: A_Chase flag; wandering movement

Post by Ceeb »

I'm an easyfag when it comes to code. I always use proper flag names split up by |, although I guess it doesn't matter, heh.
User avatar
DavidPH
Posts: 382
Joined: Fri Aug 28, 2009 1:46 pm

Re: A_Chase flag; wandering movement

Post by DavidPH »

Ceeb wrote:I guess it doesn't matter
Well yeah, except in the ways that actually matter. Specifically, maintainability of the code. Even simple things like using true/false for boolean fields can make a huge difference when quickly scanning over big chunks of code. I guess I'm one of the few people who writes DECORATE/ACS/DDL(omgshamelessplug)/TEXTURES/whatever to be re-used and maintained. :|
User avatar
Demolisher
Posts: 1749
Joined: Mon Aug 11, 2008 12:59 pm
Graphics Processor: nVidia with Vulkan support
Location: Winchester, VA
Contact:

Re: A_Chase flag; wandering movement

Post by Demolisher »

Ceeb wrote:I'm an easyfag when it comes to code. I always use proper flag names split up by |, although I guess it doesn't matter, heh.
Hell, I define my own constants.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: A_Chase flag; wandering movement

Post by Xaser »

Demolisher wrote:Hell, I define my own constants.
LONG_VALUE_ZEARO? :P
User avatar
Demolisher
Posts: 1749
Joined: Mon Aug 11, 2008 12:59 pm
Graphics Processor: nVidia with Vulkan support
Location: Winchester, VA
Contact:

Re: A_Chase flag; wandering movement

Post by Demolisher »

Xaser wrote:
Demolisher wrote:Hell, I define my own constants.
LONG_VALUE_ZEARO? :P

Code: Select all

Actor "Weapon_Pistol" : "Weapon_Base"
{
	Obituary "$OB_MPPISTOL"
	Tag "Pistol"
	Weapon.AmmoType "Ammo_Clip"
	Weapon.AmmoUse 1
	Weapon.SelectionOrder 5
	Weapon.SlotNumber 2
	+Weapon.Wimpy_Weapon
	States
	{
	Spawn:
		TNT1 A 0
		Stop
	Ready:
		PISG A 1 A_WeaponReady
		Loop
	Deselect:
		PISG A 1 A_Lower
		Loop
	Select:
		PISG A 1 A_Raise
		Loop
	Fire:
		PISG A 4
		TNT1 A 0 A_PlaySound("weapons/pistol", Chan_Weapon)
		TNT1 A 0 A_GunFlash
		TNT1 A 0 ACS_ExecuteAlways(Script_DamageWeapon, 0, Weapon_Pistol)
		TNT1 A 0 A_FireCustomMissile("WeaponProj_SmallBullet", ACS_ExecuteWithResult(Script_Accuracy, WeaponAccuracy_Pistol) / 2, True, 0, 0, 0, ACS_ExecuteWithResult(Script_Accuracy, WeaponAccuracy_Pistol) / 2)
		
		PISG BBBBBB 1 ACS_ExecuteAlways(Script_Recoil, 0, 3, 1, RecoilType_Up)
		
		PISG CCCC 1 ACS_ExecuteAlways(Script_Recoil, 0, 4, 1, RecoilType_Down)
		
		PISG B 5 A_ReFire
		Goto Ready
	Flash:
		PISF A 7 Bright A_Light1
		Goto LightDone
	}
}
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”