Skip to content

Release 11: API Changes

Emanuele Disco edited this page Jul 28, 2023 · 2 revisions

API Changes

SpawnSubMissile

Actor SpawnSubMissile(Class type, Actor target, int aimflags = 0, double angle = 1e37)

New parameters:

  • aimflags: the following flags are available:
    • ALF_ISOFFHAND - the weapon should be considered as offhand weapon.
  • angle: change the angle of the missile velocity vector (default to player angle).

SpawnPlayerMissile

Actor, Actor SpawnPlayerMissile(class type, double angle = 1e37, double x = 0, double y = 0, double z = 0, out FTranslatedLineTarget pLineTarget = null, bool nofreeaim = false, bool noautoaim = false, int aimflags = 0, double pitch = 1e37)

New parameters:

  • pitch: can be used to change the pitch of the missile, default to player pitch.

P_SpawnMissileAngleZSpeed

Removed aimflags parameter (this is not a player action, so we don't need to know the offhand flag). Restored the function and removed the overrideattackpos for vr weapon, this is an npc action.

P_AimLineAttack

The function will use the angle and pitch of the weapon to find a target, will still return the player angle when called by a weapon since we need this value when invoking the LineAttack function.

A_SpawnItemEx

New flags:

  • SXF_RELATIVETOWEAPON - the position and velocity vector or the spawned actor will be changed in relation to the weapon current position and rotation. The original behavior is retained when this new flag is not passed. When passing velocity and offset vectors with this flag you don't need to account for the caller pitch and roll, just pass absolutle values as if the weapon has roll and pitch 0.

A_ChangeVelocity

New flags:

  • CVF_RELATIVETOWEAPON - the velocity vector will be changed in relation to the weapon angle, yaw and roll. The original behavior is retained when this new flag is not passed.

New configuration options

r_weaphpos - Change the current weapon sprite's horizontal position.

Only affect sprite and the value is only valid for the current session

r_weapvpos - Change the current weapon sprite's vertical position.

Only affect sprite and the value is only valid for the current session

r_weapscale - Change the scale of the current weapon.

Only affect sprite and the value is only valid for the current session

vr_weaponOffsetX - Offset the current weapon's left/right location.

Affect model and sprite

vr_weaponOffsetY - Offset the current weapon's up/down location.

Affect model and sprite

vr_weaponOffsetZ - Offset the current weapon's forward/backward location.

Affect model and sprite

gl_light_wall_max_lights - Total number of lights affecting walls.

Can be tuned to improve performance

gl_light_flat_max_lights - Total number of lights affecting flat objects.

Can be tuned to improve performance

gl_light_range_limit - Limit the light contribution of a single light source to the overall illumination of the place surrounding the light source.

Greatly improve performance with many light sources positioned a short distance from each other.

gl_mirror_player - Toggle player visibility on mirrors

use_action_spawn_yzoffset - Use horizontal and vertical spawn offset for projectile, missile and hitscan attacks (default to false)