A_CustomMissile pitch without CMF_AIMDIRECTION

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: Developers

A_CustomMissile pitch without CMF_AIMDIRECTION

Postby Xtyfe » Sat Jun 18, 2011 4:05 pm

I would like to propose the ability to use the pitch arguement of A_CustomMissile without CMF_AIMDIRECTION. As it stands with that flag, a monster will not aim up or down to me if on a lower or higher floor but is perfect on one that is the same height.
Last edited by Xtyfe on Mon Jun 20, 2011 11:51 pm, edited 1 time in total.
Xtyfe
 
Joined: 14 Dec 2007
Location: Kitchener, Ontario

Re: A_CustomMissile pitch without CMF_AIMDIRECTION

Postby FDARI » Sun Jun 19, 2011 3:56 pm

Currently, pitch argument does nothing no matter its value, unless CMF_AIMDIRECTION is passed. Changing this without adding a new flag would technically be a compatibility break. Also, it would be hard to tell if a value of 0 meant to set pitch to 0, or to leave the pitch be (but it would have to mean "leave the pitch be".)

The solution to these issues would be more flags, of course. Perhaps CMF_APPLYPITCH to change pitch to whatever is in the pitch parameter, and CMF_OFFSETPITCH to add the pitch parameter to the naturally determined pitch.

Would something like that be useful?
User avatar
FDARI
Bronies eunt domus
 
Joined: 03 Nov 2009

Re: A_CustomMissile pitch without CMF_AIMDIRECTION

Postby XutaWoo » Sun Jun 19, 2011 4:21 pm

CMF_OFFSETPITCH seems just like CMF_AIMDIRECTION. But CMF_APPLYPITCH does sound useful, yes.
User avatar
XutaWoo
one day when going to see the rabbit, there was a previous visitor ...
 
Joined: 30 Dec 2006
Location: beautiful hills of those who are friends

Re: A_CustomMissile pitch without CMF_AIMDIRECTION

Postby Xtyfe » Sun Jun 19, 2011 4:26 pm

If that's what needs to be done then ya, I just want monsters to be able to use aim and use the pitch just like a player would with A_FireCustomMissile like this example:

Code: Select allExpand view
Actor XtShotgun : Shotgun replaces Shotgun
{
+NOAUTOAIM
Weapon.KickBack 150
States
   {
   Deselect:
      SHTG A 0 A_Lower
      SHTG A 1 A_Lower
      Loop
   Select:
      SHTG A 0 A_Raise
      SHTG A 1 A_Raise
      Loop
   Fire:
      PKSG A 3
      TNT1 A 0 A_GunFlash
      TNT1 A 0 A_PlaySound ("weapons/shotgf")
      TNT1 A 0 A_FireCustomMissile ("XtShotgunTracer", FRandom(-11.2, 11.2), 1, 0, 0, 0, FRandom(-7.1, 7.1))
      TNT1 AAAAAAA 0 A_FireCustomMissile ("XtShotgunTracer", FRandom(-11.2, 11.2), 0, 0, 0, 0, FRandom(-7.1, 7.1))
      PKSG A 5
      PKSG B 2
      PKSG C 1
      PKSG D 2
      PKSG E 3
      PKSG F 4
      PKSG G 1
      PKSG H 3
      PKSG GFEDCB 2
      PKSG A 1
      PKSG A 7 A_ReFire
      Goto Ready
   Flash:
      SHTF B 3 Bright A_Light2
      SHTF A 2 Bright A_Light1
      Goto LightDone
   }
}
Xtyfe
 
Joined: 14 Dec 2007
Location: Kitchener, Ontario

Re: A_CustomMissile pitch without CMF_AIMDIRECTION

Postby FDARI » Sun Jun 19, 2011 4:44 pm

XutaWoo wrote:CMF_OFFSETPITCH seems just like CMF_AIMDIRECTION. But CMF_APPLYPITCH does sound useful, yes.
Like aimdirection? Unexpected assessment.

No flags: Angle = aim + angle parameter; Pitch = aim (if parameter were added here, pitch and angle handling would be consistent)
CMF_AIMDIRECTION: Angle = facing + angle parameter; Pitch = pitch parameter
CMF_OFFSETPITCH: Angle = aim + angle parameter; Pitch = aim + pitch parameter (offset pitch like angle)
CMF_APPLYPITCH: Angle = aim + angle parameter; Pitch = pitch parameter

Offsetpitch could be the default behaviour with no flag, but even though it is unlikely that previous modders have passed pitches without specifying CMF_AIMDIRECTION, that is a compatibility-breaking change.

The suggested and seemingly most anticipated capability is that of specifying pitch without otherwise disturbing aim. I'm sure we can manage that.
User avatar
FDARI
Bronies eunt domus
 
Joined: 03 Nov 2009

Re: A_CustomMissile pitch without CMF_AIMDIRECTION

Postby Xtyfe » Sun Jun 19, 2011 4:47 pm

Why not have the actor aim from the center of it's firing offset? Then apply the angle and pitch instead of aiming the missiles themselves.
Xtyfe
 
Joined: 14 Dec 2007
Location: Kitchener, Ontario

Re: A_CustomMissile pitch without CMF_AIMDIRECTION

Postby FDARI » Sun Jun 19, 2011 5:02 pm

Aim from the centre of its firing offset? What is its "firing offset"?

I take it the "firing offset" for a default use of A_CustomMissile would be the angle and pitch to aim at the target.
The "firing offset" for a function with CMF_AIMDIRECTION would be the angle the caller is facing, and pitch 0.

Then apply the angle: To offset the angle by the parameter? (Increase or decrease the angle according to the parameter value.)

If I understand "apply the angle" correctly, all existing and proposed versions of A_CustomMissile would do just that.

Then apply the pitch: To offset the pitch by the parameter?

Doing that to CMF_AIMDIRECTION would make no difference, since the starting point would be 0 and the pitch is already applied.

Doing that without CMF_AIMDIRECTION would make sense, but breaks compatibility in a way that may be trivial. There is no reason why a mod today should have passed a non-0 value to pitch without specifying CMF_AIMDIRECTION. If we don't care about that possibility, the change may be made.

If we let the default behaviour take pitch into account as an offset, we could use the following flags for flexibility:

No flags: Angle (aim + parameter) ; Pitch (aim + parameter)
CMF_AIMDIRECTION: Angle (facing + parameter) ; Pitch (parameter)
CMF_ABSOLUTEPITCH: Pitch (parameter) [overrides other flags]

Note (not a feature suggestion, already in): If for any reason, you'd want to fire at an absolute angle, you'd pass "X - angle" as the angle parameter, where "X" is the absolute angle, and "angle" is the decorate expression.
User avatar
FDARI
Bronies eunt domus
 
Joined: 03 Nov 2009

Re: A_CustomMissile pitch without CMF_AIMDIRECTION

Postby Xtyfe » Sun Jun 19, 2011 5:06 pm

By firing offsets I meant the spawnheight and spawnofs_horiz arguments from A_CustomMissile
Xtyfe
 
Joined: 14 Dec 2007
Location: Kitchener, Ontario

Re: A_CustomMissile pitch without CMF_AIMDIRECTION

Postby FDARI » Mon Jun 20, 2011 1:22 am

Ok, I get it now. But doesn't A_CustomMissile for zdoom already aim the projectile from the firing offset? At least for pitch, where you need a special pitch to make it aim from the standard offset instead of the actual offset.

I still only see an offset to pitch (add the pitch parameter, offset from original aim) and an absolute pitch (apply the pitch parameter, disregarding original aim) as missing options.
User avatar
FDARI
Bronies eunt domus
 
Joined: 03 Nov 2009

Re: A_CustomMissile pitch without CMF_AIMDIRECTION

Postby Xtyfe » Mon Jun 20, 2011 2:04 am

Yes, I suppose that is true :P I think that will be fine. I can give it a test spin if need be
Xtyfe
 
Joined: 14 Dec 2007
Location: Kitchener, Ontario

Re: A_CustomMissile pitch without CMF_AIMDIRECTION

Postby FDARI » Wed Jul 13, 2011 10:21 am

Proposed solution: viewtopic.php?f=34&t=30291
User avatar
FDARI
Bronies eunt domus
 
Joined: 03 Nov 2009

Re: A_CustomMissile pitch without CMF_AIMDIRECTION

Postby Xtyfe » Wed Jul 13, 2011 6:06 pm

Sweet :D thanks FDARI

Just need the A_SkullAttack extension and I can release my gameplay mod
Xtyfe
 
Joined: 14 Dec 2007
Location: Kitchener, Ontario


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests