A_Chase flag; wandering movement

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: A_Chase flag; wandering movement

Re: A_Chase flag; wandering movement

by Demolisher » Sun Aug 22, 2010 7:37 pm

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
	}
}

Re: A_Chase flag; wandering movement

by Xaser » Sun Aug 22, 2010 7:10 pm

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

Re: A_Chase flag; wandering movement

by Demolisher » Sun Aug 22, 2010 5:31 pm

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.

Re: A_Chase flag; wandering movement

by DavidPH » Sun Aug 22, 2010 12:35 pm

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. :|

Re: A_Chase flag; wandering movement

by Ceeb » Sun Aug 22, 2010 12:20 pm

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.

Re: A_Chase flag; wandering movement

by NeuralStunner » Sun Aug 22, 2010 3:55 am

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

(Take out one zero. :P )

Re: A_Chase flag; wandering movement

by Gez » Sun Aug 22, 2010 3:47 am

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.

Re: A_Chase flag; wandering movement

by Xaser » Sat Aug 21, 2010 7:36 pm

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.

Re: A_Chase flag; wandering movement

by NeuralStunner » Sat Aug 21, 2010 6:14 pm

Skultlag's riuned youu. :P

Re: A_Chase flag; wandering movement

by Ghastly » Sat Aug 21, 2010 6:01 pm

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.

Re: A_Chase flag; wandering movement

by NeuralStunner » Sat Aug 21, 2010 4:36 pm

Ghastly may mean for that to be Skulltag compat, which for some reason doesn't always have named constants. :P

Re: A_Chase flag; wandering movement

by Graf Zahl » Sat Aug 21, 2010 1:51 pm

Because some people apparently still don't understand what a predefined constant is! :twisted:

Re: A_Chase flag; wandering movement

by Zippy » Sat Aug 21, 2010 1:06 pm

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

Re: A_Chase flag; wandering movement

by Ghastly » Sat Aug 21, 2010 7:44 am

Isham, quite a bump.

@Cutman: A_Stop wouldn't affect movement from A_Chase, since A_Chase movement is more akin to teleporting (it moves the actor's Speed every time it's called). Also, this would work better:

Code: Select all

  See:
    POSS A 0 A_Chase("", "Missile", 16)
    POSS A 4 A_Wander
    POSS A 0 A_Chase("", "Missile", 16)
    POSS A 4 A_Wander
    POSS B 0 A_Chase("", "Missile", 16)
    POSS B 4 A_Wander
    POSS B 0 A_Chase("", "Missile", 16)
    POSS B 4 A_Wander
    POSS C 0 A_Chase("", "Missile", 16)
    POSS C 4 A_Wander
    POSS C 0 A_Chase("", "Missile", 16)
    POSS C 4 A_Wander
    POSS D 0 A_Chase("", "Missile", 16)
    POSS D 4 A_Wander
    POSS D 0 A_Chase("", "Missile", 16)
    POSS D 4 A_Wander
    Loop
The 16 in the A_Chase is the CHF_DONTMOVE flag. This gives the wandering movement, but should attack as normal.

Re: A_Chase flag; wandering movement

by Ishiam » Fri Aug 20, 2010 9:35 pm

I agree it would allow for much smoother movement. :D

Top