Revamp Developer Changes¶
Developer changes in VJ Base Revamp, version 3.0.0.
Important Notes
- Most existing
VJ_*functions and enums have all been converted to theVJlibrary! - Most
CustomOn*functions have been renamed & merged, check below or the corresponding base file for the new names! - Many removed/renamed functions and variables have backwards compatibility though it's highly recommended to update them!
New Plugin Loading
Dummy repository Official Addon Example
Plugin autoruns have been completely revamped, here is how to update them:
- Create the following directory in your addon's
luafoldervj_base/plugins. - Create a lua file inside it with a unique name, example:
lua/vj_base/plugins/addon_name.lua. - Navigate to your addon's existing
autorunfolder. - Copy the actual content excluding VJ Base check, and codes that are included in the old dummy file.
- Paste it in
lua/vj_base/plugins/addon_name.lua. - At the top of the file add
VJ.AddPlugin("", "")where the first string is the addon name and second is the type, example:VJ.AddPlugin("Zombie SNPCs", "NPC"). - Go back to the existing autorun file and delete it.
- Copy and paste the
vj_base_check.luafile found in the dummy repository inside your addon'sautorunfile just like the dummy repository.
Globals & Misc¶
- Added:
VJ.GetMoveVelocity(ent)VJ.GetMoveDirection(ent, ignoreZ)VJ.TraceDirections(ent, trType, maxDist, requireFullDist, returnAsDict, numDirections, excludeForward, excludeBack, excludeLeft, excludeRight)VJ.GetNearestPositions(ent1, ent2, centerEnt1)VJ.GetNearestDistance(ent1, ent2, centerEnt1)VJ.AddKillIcon(class, name, texture, data)
- Added AI tasks:
TASK_VJ_PLAY_ACTIVITYTASK_VJ_PLAY_SEQUENCE
- Added to entity meta table:
ENTITY:CanBeEngaged(otherEnt, distance),ENTITY:HandlePerceivedRelationship(otherEnt, distance, isFriendly)
- Added
VJ.CalculateTrajectory()which is a newer version ofENTITY:CalculateProjectile() - Added global enum:
D_VJ_INTERESTVJ.DMG_*VJ.ALERT_STATE_*VJ.DANGER_TYPE_*VJ.WEP_ATTACK_STATE_*VJ.MEM_*VJ.ANIM_TYPE_*VJ.BLOOD_COLOR_*VJ.PROJ_TYPE_*VJ.PROJ_COLLISION_*VJ.KILLICON_*VJ.COLOR_*
- Added global objects:
VJ_RecipientFilterVJ_Nodegraph
- Added
vj_ai_nodegraphmodule - Moved
ENTITY:DecideAnimationLength()from entity meta table to VJ library →VJ.AnimDurationEx(ent, anim, override, decrease) - Default Half-Life 1 & 2 NPCs now respect
self.AlliedWithPlayerAllies - Added
versionparameter toVJ.AddPlugin - Deprecated:
ENTITY:CalculateProjectile() - Renamed module
ai_vj_schedule→vj_ai_schedule - Renamed module
ai_vj_task→vj_ai_task - Renamed
VJ.AddAddonProperty→VJ.AddPlugin - Removed unused module
sound_vj_track - Removed
self:CustomOnInitialize()fromprop_vj_animatable - Removed
VJ_CreateBoneFollowerand the associated entityobj_vj_bonefollower - Removed global functions:
VJ_PICKRANDOMTABLEVJ_GetSequenceNameVJ_FindInConeVJ_RemoveAnimExtensionsGetTaskList
All Bases¶
- Renamed
self:CustomOnPreInitialize()→self:PreInit() - Renamed
self:CustomOnInitialize()→self:Init() - Renamed
self:CustomOnThink()→self:OnThink()
NPC Bases¶
- Added:
self:CheckRelationship(ent)self:SetRelationshipMemory(ent, memoryName, memoryValue)self:OnFollow(status, ent)self:SetTurnTarget(target, faceTime, stopOnFace, visibleOnly)self:GetAimPosition(target, aimOrigin, predictionRate, projectileSpeed)self:GetAimSpread(target, goalPos, modifier)self:SetPhysicsDamageScale(scale)self:IsScheduleFinished(schedule)self:UpdateAnimationTranslations(wepHoldType)self:SetAnimationTranslations(wepHoldType)self:ResolveAnimation(tbl)self:MeleeAttackTraceDirection()self.JumpParamsself.AnimationTranslationsself.CurrentAttackAnimationTimeself.LastAnimationTypeself.CanReceiveOrdersself.GibOnDeathFilterself.DeathAllyResponseself.DeathAllyResponse_MoveLimitself.DamageResponse
- Added (Humans):
self:OnDangerDetected(dangerType, data)self:OnGrenadeAttack(status, overrideEnt, landDir)self:OnGrenadeAttackExecute(status, grenade, overrideEnt, landDir, landingPos)self.Weapon_AimTurnDiffself.GrenadeAttackBoneself.NextAnyAttackTime_Grenadeself.WeaponAttackState
- Added (Creatures):
self.EatCooldown
- Added Client side functions:
self:CustomOnInitialize()self:Controller_CalcView(ply, origin, angles, fov, camera, cameraMode)
- Renamed
self:VJ_ACT_PLAYACTIVITY()→self:PlayAnim() - Changes to
self:PlayAnim():- Added new returns (in order):
anim,animDur,animType - Added
"LetAttacks"option forstopActivities, makes the animation interruptible by attacks - Added
"Visible"option forfaceEnemy, only faces the enemy while it's visible - Added fail safe if wrong input is given for
stopActivitiesTime - Will now translate the animation if there is one
- Now correctly calculates the playback rate
- Extra option
PlayBackRateis now per-animation! - Removed extra parameters:
SequenceInterruptible,SequenceDuration - Fixed returning nil in certain cases for the creature base
- Added new returns (in order):
- Added parameters
moveTypeandsdFiletoself:OnFootstepSound() - Grenade attack is now seeded and supports events similar to other attacks
self.RangeAttackProjectilesandself.GrenadeAttackEntitycan now be a tablesself.MeleeAttackDistanceandself.MeleeAttackDamageDistancecan now be set tofalseto let the base auto calculate the distance based on the NPC's collision boundsself:GetShootPos()is now defaulted toVector(0, 0, 55)instead of the NPC's originself:Follow()now has a second return valueself:IsBusy()now has a parametercheckTypewhich can be used to only check behaviors or activitiesself.FootstepSoundTimerWalkandself.FootstepSoundTimerRuncan now acceptfalse, which will disable themself.BecomeEnemyToPlayernow accepts a number, which determines the level to become enemyself.NextGrenadeAttackTimenow works the same way as other attacksself.MeleeAttackStopOnHitandself.LeapAttackStopOnHitnow work much better- All attack timer variables starting with
Nextcan now acceptVJ.SETto randomize them - Following animation variables can now be set to
falseto disable them:self.AnimTbl_MeleeAttackself.AnimTbl_RangeAttackself.AnimTbl_LeapAttackself.AnimTbl_GrenadeAttackself.AnimTbl_WeaponAttackGestureself.AnimTbl_CallForHelpself.AnimTbl_Medic_GiveHealthself.AnimTbl_DamageAllyResponse
self.CanFlinchnow usesfalse,true, and"DamageTypes"instead of numbersself.FlinchHitGroupMapcan now accept a non-table value for the hitgroup name- Renamed
self:CustomOnThink_AIEnabled()→self:OnThinkActive() - Renamed
self:CustomOnAcceptInput()→self:OnInput() - Renamed
self:CustomOnHandleAnimEvent()→self:OnAnimEvent() - Renamed
self:CustomOnTakeDamage_OnBleed()→self:OnBleed() - Renamed
self:CustomOnAlert()→self:OnAlert() - Renamed
self:CustomOnInvestigate()→self:OnInvestigate() - Renamed
self:CustomOnCallForHelp()→self:OnCallForHelp() - Renamed
self:CustomOnPlayerSight()→self:OnPlayerSight() - Renamed
self:CustomOn_PoseParameterLookingCode()→self:OnUpdatePoseParamTracking() - Renamed
self:CustomOnDeath_AfterCorpseSpawned()→self:OnCreateDeathCorpse() - Renamed
self:CustomOnDoKilledEnemy()→self:OnKilledEnemy() - Renamed
self:CustomOnTouch()→self:OnTouch() - Renamed
self:CustomOnWeaponReload()→self:OnWeaponReload() - Renamed
self:CustomOnWeaponAttack()→self:OnWeaponAttack() - Renamed
self:CustomOnMoveRandomlyWhenShooting()→self:OnWeaponStrafe() - Renamed
self:CustomOnDropWeapon()→self:OnDeathWeaponDrop() - Renamed
self:CustomOnFootStepSound()→self:OnFootstepSound() - Renamed
self:FootStepSoundCode()→self:PlayFootstepSound() - Renamed
self:VJ_DecideSoundPitch()→self:GetSoundPitch() - Renamed
self:VJ_DoSetEnemy()→self:ForceSetEnemy() - Renamed
self:DoChaseAnimation()→self:MaintainAlertBehavior() - Renamed
self:VJ_GetDifficultyValue()→self:ScaleByDifficulty() - Renamed
self:OnCreateSound(sdFile)→self:OnPlaySound(sdFile) - Renamed
self:RangeAttackCode_OverrideProjectilePos(projectile)→self:RangeAttackProjPos(projectile) - Renamed
self:RangeAttackCode_GetShootPos(projectile)→self:RangeAttackProjVel(projectile) - Renamed
self:GetMeleeAttackDamageOrigin()→self:MeleeAttackTraceOrigin() - Renamed
self:SetUpGibesOnDeath()→self:HandleGibOnDeath() - Renamed
self:MeleeAttackCode()→self:ExecuteMeleeAttack() - Renamed
self:RangeAttackCode()→self:ExecuteRangeAttack() - Renamed
self:LeapDamageCode()→self:ExecuteLeapAttack() - Renamed
self:CustomAttack()→self:OnThinkAttack(isAttacking, enemy) - Renamed
self.LatestEnemyDistance→self.EnemyData.Distance - Renamed
self.NearestPointToEnemyDistance→self.EnemyData.DistanceNearest - Renamed
self.SoundTbl_MoveOutOfPlayersWay→self.SoundTbl_YieldToPlayer - Renamed
self.CustomBlood_Decal→self.BloodDecal - Renamed
self.CustomBlood_Particle→self.BloodParticle - Renamed
self.CustomBlood_Pool→self.BloodPool - Renamed
self.HasShootWhileMoving→self.Weapon_CanMoveFire - Renamed
self.WeaponBackAway_Distance→self.Weapon_RetreatDistance - Renamed
self.NextFlinchTime→self.FlinchCooldown - Renamed
self.HitGroupFlinching_Values→self.FlinchHitGroupMap - Renamed
self.HitGroupFlinching_DefaultWhenNotHit→self.FlinchHitGroupPlayDefault - Renamed
self.NextCallForHelpTime→self.CallForHelpCooldown - Renamed
self.CallForHelpAnimationFaceEnemy→self.CallForHelpAnimFaceEnemy - Renamed
self.NextCallForHelpAnimationTime→self.CallForHelpAnimCooldown - Renamed
self.InvestigateSoundDistance→self.InvestigateSoundMultiplier - Renamed
self.CanThrowBackDetectedGrenades→self.CanRedirectGrenades - Renamed
self.AttackStatus→self.AttackState - Renamed
self.CombatFaceEnemy→self.CanTurnWhileMoving - Renamed
self.GrenadeAttackFussTime→self.GrenadeAttackFuseTime - Renamed
self.ThrowGrenadeChance→self.GrenadeAttackChance - Renamed
self.NoWeapon_UseScaredBehavior→self.Weapon_UnarmedBehavior - Renamed
self.WeaponSpread→self.Weapon_Accuracy - Renamed
self.AnimTbl_WeaponAttackFiringGesture→self.AnimTbl_WeaponAttackGesture - Renamed
self.CanUseSecondaryOnWeaponAttack→self.Weapon_CanSecondaryFire - Renamed
self.WeaponAttackSecondaryTimeUntilFire→self.Weapon_SecondaryFireTime - Renamed
self.AllowWeaponReloading→self.Weapon_CanReload - Renamed
self.WeaponReload_FindCover→self.Weapon_FindCoverOnReload - Renamed
self.MoveRandomlyWhenShooting→self.Weapon_Strafe - Renamed
self.WaitForEnemyToComeOut→self.Weapon_OcclusionDelay - Renamed
self.WaitForEnemyToComeOutTime→self.Weapon_OcclusionDelayTime - Renamed
self.WaitForEnemyToComeOutDistance→self.Weapon_OcclusionDelayMinDist - Renamed
self.CanCrouchOnWeaponAttack→self.Weapon_CanCrouchAttack - Renamed
self.CanCrouchOnWeaponAttackChance→self.Weapon_CrouchAttackChance - Renamed
self.MoveOutOfFriendlyPlayersWay→self.YieldToAlliedPlayers - Renamed
self.UsePlayerModelMovement→self.UsePoseParameterMovement - Renamed
self.SoundTbl_OnKilledEnemy→self.SoundTbl_KilledEnemy - Renamed
self.HasOnKilledEnemySounds→self.HasKilledEnemySounds - Renamed
self.OnKilledEnemySoundChance→self.OnKilledEnemySoundChance - Renamed
self.NextSoundTime_OnKilledEnemy→self.NextSoundTime_KilledEnemy - Renamed
self.OnKilledEnemySoundLevel→self.KilledEnemySoundLevel - Renamed
self.OnKilledEnemySoundPitch→self.KilledEnemySoundPitch - Renamed
self.OnlyDoKillEnemyWhenClear→self.KilledEnemySoundLast - Renamed
self.HasOnReceiveOrderSounds→self.HasReceiveOrderSounds - Renamed
self.SoundTbl_OnReceiveOrder→self.SoundTbl_ReceiveOrder - Renamed
self.OnReceiveOrderSoundChance→self.ReceiveOrderSoundChance - Renamed
self.OnReceiveOrderSoundLevel→self.ReceiveOrderSoundLevel - Renamed
self.OnReceiveOrderSoundPitch→self.ReceiveOrderSoundPitch - Renamed
self.SoundTbl_OnDangerSight→self.SoundTbl_DangerSight - Renamed
self.SoundTbl_OnGrenadeSight→self.SoundTbl_GrenadeSight - Renamed
self.NoChaseAfterCertainRange→self.LimitChaseDistance - Renamed
self.NoChaseAfterCertainRange_CloseDistance→self.LimitChaseDistance_Min - Renamed
self.NoChaseAfterCertainRange_FarDistance→self.LimitChaseDistance_Max - Renamed
self.AlertedToIdleTime→self.AlertTimeout - Renamed
self.IsMedicSNPC→self.IsMedic - Renamed
self.Medic_HealthAmount→self.Medic_HealAmount - Renamed
self.Medic_CanBeHealed→self.VJ_ID_Healable - Renamed
self.SoundTbl_MedicAfterHeal→self.SoundTbl_MedicOnHeal - Renamed
self.MedicAfterHealSoundChance→self.MedicOnHealSoundChance - Renamed
self.BeforeHealSoundLevel→self.MedicBeforeHealSoundLevel - Renamed
self.AfterHealSoundLevel→self.MedicOnHealSoundLevel - Renamed
self.BeforeHealSoundPitch→self.MedicBeforeHealSoundPitch - Renamed
self.AfterHealSoundPitch→self.MedicOnHealSoundPitch - Renamed
self.HasDeathRagdoll→self.HasDeathCorpse - Renamed
self.AllowedToGib→self.CanGib - Renamed
self.HasGibOnDeath→self.CanGibOnDeath - Renamed
self.HasGibDeathParticles→self.HasGibOnDeathEffects - Renamed
self.HasItemDropsOnDeath→self.DropDeathLoot - Renamed
self.ItemDropsOnDeathChance→self.DeathLootChance - Renamed
self.ItemDropsOnDeath_EntityList→self.DeathLoot - Renamed
self.WaitBeforeDeathTime→self.DeathDelayTime - Renamed
self.GrenadeAttackThrowDistance→self.GrenadeAttackMaxDistance - Renamed
self.GrenadeAttackThrowDistanceClose→self.GrenadeAttackMinDistance - Renamed
self.NextThrowGrenadeTime→self.NextGrenadeAttackTime - Renamed
self.TimeUntilGrenadeIsReleased→self.GrenadeAttackThrowTime - Renamed
self.CallForBackUpOnDamage→self.DamageAllyResponse - Renamed
self.CallForBackUpOnDamageAnimation→self.AnimTbl_DamageAllyResponse - Renamed
self.NextCallForBackUpOnDamageTime→self.DamageAllyResponse_Cooldown - Renamed
self.VJC_Data→self.ControllerParams - Renamed
self.FriendsWithAllPlayerAllies→self.AlliedWithPlayerAllies - Renamed
self.UseTheSameGeneralSoundPitch→self.MainSoundPitchStatic - Renamed
self.AllowMovementJumping→self.JumpParams.Enabled - Renamed
self.MaxJumpLegalDistance→self.JumpParams.MaxRise - Renamed
self.MoveOrHideOnDamageByEnemy→self.CombatDamageResponse - Renamed
self.MoveOrHideOnDamageByEnemy_HideTime→self.CombatDamageResponse_CoverTime - Renamed
self.Immune_AcidPoisonRadiation→self.Immune_Toxic - Renamed
self.Immune_Blast→self.Immune_Explosive - Renamed
self.StopMeleeAttackAfterFirstHit→self.MeleeAttackStopOnHit - Renamed
self.MeleeAttackDSPSoundType→self.MeleeAttackDSP - Renamed
self.RangeAttackEntityToSpawn→self.RangeAttackProjectiles - Renamed
self.RangeDistance→self.RangeAttackMaxDistance - Renamed
self.RangeToMeleeDistance→self.RangeAttackMinDistance - Renamed
self.StopLeapAttackAfterFirstHit→self.LeapAttackStopOnHit - Renamed
self.LeapDistance→self.LeapAttackMaxDistance - Renamed
self.LeapToMeleeDistance→self.LeapAttackMinDistance - Renamed
self.DisableWeapons→self.Weapon_Disabled - Renamed
self.Weapon_FiringDistanceClose→self.Weapon_MinDistance - Renamed
self.Weapon_FiringDistanceFar→self.Weapon_MaxDistance - Renamed
self.DisableFindEnemy→self.EnemyDetection - Renamed
self.DisableTouchFindEnemy→self.EnemyTouchDetection - Renamed
self.FindEnemy_CanSeeThroughWalls→self.EnemyXRayDetection - Renamed
self.HasFootStepSound→self.HasFootstepSounds - Renamed
self.FootStepPitch→self.FootstepSoundPitch - Renamed
self.FootStepSoundLevel→self.FootstepSoundLevel - Renamed
self.FootStepTimeWalk→self.FootstepSoundTimerWalk - Renamed
self.FootStepTimeRun→self.FootstepSoundTimerRun - Renamed
self.SlowPlayerOnMeleeAttack→self.MeleeAttackPlayerSpeed - Renamed
self.SlowPlayerOnMeleeAttack_WalkSpeed→self.MeleeAttackPlayerSpeedWalk - Renamed
self.SlowPlayerOnMeleeAttack_RunSpeed→self.MeleeAttackPlayerSpeedRun - Renamed
self.SlowPlayerOnMeleeAttackTime→self.MeleeAttackPlayerSpeedTime - Renamed
self.HasMeleeAttackSlowPlayerSound→self.HasMeleeAttackPlayerSpeedSounds - Renamed
self.SoundTbl_MeleeAttackSlowPlayer→self.SoundTbl_MeleeAttackPlayerSpeed - Renamed
self.MeleeAttackSlowPlayerSoundLevel→self.MeleeAttackPlayerSpeedSoundLevel - Renamed
self.PropAP_MaxSize→self.PropInteraction_MaxScale - Merged
self.AttackPropsandself.PushProps→self.PropInteraction - Merged
self:CustomOnMeleeAttack_BeforeStartTimer(), andself:CustomOnMeleeAttack_AfterStartTimer()→self:OnMeleeAttack(status, enemy) - Merged
self:CustomAttackCheck_MeleeAttack(),self:CustomOnMeleeAttack_BeforeChecks(),self:CustomOnMeleeAttack_AfterChecks(), andself:CustomOnMeleeAttack_Miss()→self:OnMeleeAttackExecute(status, ent, isProp) - Merged
self:CustomAttackCheck_RangeAttack(),self:CustomOnRangeAttack_BeforeStartTimer(), andself:CustomOnRangeAttack_AfterStartTimer()→self:OnRangeAttack(status, enemy) - Merged
self:CustomRangeAttackCode(),self:CustomRangeAttackCode_BeforeProjectileSpawn(), andself:CustomRangeAttackCode_AfterProjectileSpawn()→self:OnRangeAttackExecute(status, enemy, projectile) - Merged
self:CustomAttackCheck_LeapAttack(),self:CustomOnLeapAttackVelocityCode(),self:CustomOnLeapAttack_BeforeStartTimer(), andself:CustomOnLeapAttack_AfterStartTimer()→self:OnLeapAttack(status, enemy) - Merged
self:CustomOnLeapAttack_BeforeChecks(),self:CustomOnLeapAttack_AfterChecks(), andself:CustomOnLeapAttack_Miss()→self:OnLeapAttackExecute(status, ent) - Merged
self:CustomOnMedic_BeforeHeal(),self:CustomOnMedic_OnHeal(), andself:CustomOnMedic_OnReset()→self:OnMedicBehavior(status, statusData) - Merged
self:CustomOnTakeDamage_BeforeImmuneChecks(),self:CustomOnTakeDamage_BeforeDamage(), andself:CustomOnTakeDamage_AfterDamage()→self:OnDamaged(dmginfo, hitgroup, status) - Merged
self:CustomOnFlinch_BeforeFlinch(), andself:CustomOnFlinch_AfterFlinch()→self:OnFlinch(dmginfo, hitgroup, status) - Merged
self:CustomOnInitialKilled(),self:CustomOnPriorToKilled(),self:CustomDeathAnimationCode(),self:CustomOnKilled(), andself:CustomOnDeath_BeforeCorpseSpawned()→self:OnDeath(dmginfo, hitgroup, status) - Merged
self.NextMoveRandomlyWhenShootingTime1andself.NextMoveRandomlyWhenShootingTime2→self.Weapon_StrafeCooldown - Merged
self.NextMoveOrHideOnDamageByEnemy1andself.NextMoveOrHideOnDamageByEnemy2→self.CombatDamageResponse_Cooldown - Merged
self.MeleeAttackDSPSoundUseDamageandself.MeleeAttackDSPSoundUseDamageAmount→self.MeleeAttackDSPLimit - Merged
self.HasBeforeRangeAttackSound, andself.HasRangeAttackSound→self.HasRangeAttackSounds - Merged
self.HasMedicSounds_BeforeHeal,self.HasMedicSounds_AfterHealandself.HasMedicSounds_ReceiveHeal→self.HasMedicSounds - Merged
self.GuardingPosition, andself.GuardingDirection→self.GuardData - Merged
self.GeneralSoundPitch1andself.GeneralSoundPitch2→self.MainSoundPitch - Merged
self.HasOnDangerSightSoundsandself.HasOnGrenadeSightSounds→self.HasDangerSightSounds - Merged
self.OnDangerSightSoundChanceandself.OnGrenadeSightSoundChance→self.DangerSightSoundChance - Merged
self.OnDangerSightSoundLevelandself.OnGrenadeSightSoundLevel→self.DangerSightSoundLevel - Merged
self.OnDangerSightSoundPitchandself.OnGrenadeSightSoundPitch→self.DangerSightSoundPitch - Merged
self.HasHealthRegeneration,self.HealthRegenerationAmount,self.HealthRegenerationDelay, andself.HealthRegenerationResetOnDmg→self.HealthRegenParams - Merged
self.Medic_Status,self.Medic_Target,self.Medic_PropEnt, andself.Medic_NextHealT→self.MedicData - Renamed all the existing timers
- Removed
entparameter fromself:OnFireBullet()as it was pointless sinceentisself - Removed
interruptible,useDuration,duration,playbackRateparameters fromself:PlaySequence() - Deprecated:
self:VJ_GetNearestPointToEntity()self:VJ_GetNearestPointToEntityDistance()self:FaceCertainEntity()self:FaceCertainPosition()self:BusyWithActivity()self:IsBusyWithBehavior()self:DoRelationshipCheck()self:VJ_CheckAllFourSides()
- Removed:
self:MultipleLeapAttacks()self:MultipleRangeAttacks()self:MultipleMeleeAttacks()self:CustomOnDamageByPlayer()self:SetSightDistance()self:CustomOnCondition()self:CustomOnIsJumpLegal()self:GetDynamicOrigin()self:CustomOnFollowPlayer()self:CustomOnUnFollowPlayer()self:CustomOnChangeMovementType()self:CustomOnWorldShakeOnMove()self:CustomOnDropWeapon_AfterWeaponSpawned()self:IdleDialogueAnswerSoundCode()self:RunAIMoveJump()self:VJ_SetSchedule(schedID)self:VJ_Controller_InitialMessage()self:CustomOnFootStepSound_Run()self:CustomOnFootStepSound_Walk()self:CustomOnChangeActivity(newAct)self:ThrowGrenadeCode()self:CustomOnGrenadeAttack_BeforeStartTimer()self:CustomOnGrenadeAttack_SpawnPosition()self:CustomOnWeaponReload_AfterRanToCover()self:CustomOnGrenadeAttack_ThrowVelocity()self:CustomOnGrenadeAttack_OnThrow()self:StopAllCommonSpeechSounds()self:VJ_GetNearestPointToVector()self:DoRunCode_OnFinish()self:DoRunCode_OnFail()self:SetInitializeCapabilities()self:WeaponAimPoseParameters()self:CustomRareDropsOnDeathCode(dmginfo, hitgroup)self:SetNearestPointToEntityPosition()self:VJ_TASK_GOTO_PLAYER()self:CustomOnDraw()self:Controller_IntMsg()self:SetMeleeAttackDamagePosition()self:CustomOnSchedule()self:SetIdleAnimation()self:TranslateToWeaponAnim()self:DoWeaponAttackMovementCode()self:SetupWeaponHoldTypeAnims()self:CustomOnSetupWeaponHoldTypeAnims()self:IdleDialogueFindEnt()self:PlayGibOnDeathSounds()self:CustomGibOnDeathSounds()self.AnimTbl_IdleStandself.AnimTbl_Walkself.AnimTbl_Runself.WeaponAnimTranslationsself.AnimTbl_WeaponAimself.CurrentIdleAnimationself.PlayingAttackAnimationself.DropWeaponOnDeathAttachmentself.TheDroppedWeaponself.HasEntitiesToNoCollideself.BloodPoolSizeself.GetNumberOfTasksVJ_PlayingSequenceself.VJ_PlayingInterruptSequenceself.CallForHelpAnimationPlayBackRateself.CallForHelpAnimationDelayself.NextIdleStandTimeself.FlinchAnimationDecreaseLengthAmountself.CurIdleStandMoveself.SoundTrackFadeOutTimeself.GrenadeAttackAnimationStopAttacksself.GrenadeAttackAnimationStopAttacksTimeself.WeaponReloadAnimationDecreaseLengthAmountself.FacingStatusself.WeaponUseEnemyEyePosself.HasLostWeaponSightAnimationself.DisableSelectScheduleself.Stationary_UseNoneMoveTypeself.HasHullself.DisableInitializeCapabilitiesself.HullSizeNormalself.WeaponReloadAnimationDelayself.ThrowingGrenadeself.LeapAttackingself.RangeAttackingself.MeleeAttackingself.AnimTbl_AlertFriendsOnDeathself.WeaponInventory_AntiArmorself.WeaponInventory_Meleeself.DeathCorpseSetBodyGroupself.DeathCorpseBodyGroupself.AnimTbl_ScaredBehaviorStandself.AnimTbl_ScaredBehaviorMovementself.MeleeAttackAnimationAllowOtherTasksself.AnimTbl_ShootWhileMovingRunself.AnimTbl_ShootWhileMovingWalkself.WeaponReloadAnimationFaceEnemyself.HasWeaponBackAwayself.AlertSounds_OnlyOnceself.UnFollowPlayerPitchself.UnFollowPlayerSoundChanceself.UnFollowPlayerSoundLevelself.HasFollowPlayerSounds_Followself.HasFollowPlayerSounds_UnFollowself.NextSoundTime_WeaponReloadself.BeforeMeleeAttackSounds_WaitTimeself.DisableMakingSelfEnemyToNPCsself.FindEnemy_UseSphereself.AnimationPlaybackRateself.CallForHelpStopAnimationsself.CallForHelpStopAnimationsTimeself.AnimTbl_CallForBackUpOnDamageTimeself.DisableFootStepOnWalkself.DisableFootStepOnRunself.NextSoundTime_OnGrenadeSightself.NextSoundTime_OnDangerSightself.NextSoundTime_DamageByPlayerself.Immune_Physicsself.DeathCorpseSkinself.RangeUseAttachmentForPosself.RangeUseAttachmentForPosIDself.RangeAttackPos_Upself.RangeAttackPos_Forwardself.RangeAttackPos_Rightself.LeapAttackVelocityForwardself.LeapAttackVelocityUpself.LeapAttackVelocityRightself.HasWorldShakeOnMoveself.WorldShakeOnMoveAmplitudeself.WorldShakeOnMoveRadiusself.WorldShakeOnMoveDurationself.WorldShakeOnMoveFrequencyself.ImmuneDamagesTableself.GibOnDeathDamagesTableself.DeathCorpseFadeTimeself.BecomeEnemyToPlayerLevelself.FollowingPlayerself.VJ_AddCertainEntityAsEnemyself.VJ_AddCertainEntityAsFriendlyself.AngerLevelTowardsPlayerself.NextFollowUpdateTself.NextCallForHelpSoundTself.NextSoundTime_Painself.Weapon_DoingCrouchAttackTself.DoingWeaponAttackself.DoingWeaponAttack_Standingself.DoingWeaponOcclusionDelayself.WeaponAttackAnimIsAimself.NextNoWeaponTself.NextWeaponReloadSoundTself.PlayerFriendlyself.IdleDialogueAnswerSoundPitchself.IdleDialogueAnswerSoundLevelself.Passive_NextRunOnDamageTimeself.Passive_NextRunOnTouchTimeself.Passive_AlliesRunOnDamageDistanceself.HasSetSolidself.HasCallForHelpAnimationself.Medic_DisableAnimationself.DisableAnimTbl_CallForBackUpOnDamageself.NoChaseAfterCertainRange_Typeself.BringFriendsOnDeathself.BringFriendsOnDeathDistanceself.BringFriendsOnDeathLimitself.AlertFriendsOnDeathself.AlertFriendsOnDeathDistanceself.AlertFriendsOnDeathLimitself.NextMoveAfterFlinchTimeself.CallForBackUpOnDamageLimitself.MoveOrHideOnDamageByEnemy_OnlyMoveself.HideOnUnknownDamageself.DisableTakeDamageFindEnemyself.Passive_RunOnDamageself.CallForBackUpOnDamageDistanceself.FollowUpdateTimeself.DisableWeaponFiringGestureself.DisableGrenadeAttackAnimationself.DisableMeleeAttackAnimationself.DisableRangeAttackAnimationself.DisableLeapAttackAnimationself.GrenadeAttackAnimationDelayself.MeleeAttackAnimationDelayself.LeapAttackAnimationDelayself.NextAnyAttackTime_Melee_DoRandself.NextMeleeAttackTime_DoRandself.NextAnyAttackTime_Leap_DoRandself.NextLeapAttackTime_DoRandself.NextRangeAttackTime_DoRandself.NextAnyAttackTime_Range_DoRandself.MeleeAttackSlowPlayerSoundFadeOutTimeself.HasDamageByPlayerself.DamageByPlayerTimeself.NextDamageByPlayerTself.DisableDefaultRangeAttackCodeself.RangeAttackAnimationStopMovementself.DisableDefaultMeleeAttackCode
- Removed timers:
timer_act_playingattacktimer_act_seqreset
Weapon Base¶
- Added:
self:SetDrawWorldModel(bool)self:GetDrawWorldModel()self.ReplacementWeapon
self.Primary.TakeAmmonow works for both NPCs and players- Removed network variable
VJ_CurBulletPos, instead useself:GetBulletPos() - Removed network variable
VJ_WorldModel_Invisible, instead use the new world model functions - Removed:
self:CustomOnNPC_ServerThink()self:CustomOnIdle()self:CustomOnPrimaryAttackEffects(owner)self.NPC_SecondaryFirePerformingself.WorldModel_NoShadowself.WorldModel_Invisible
Spawner Base¶
- Added a queue system
SpawnPositioninself.EntitiesToSpawnnow takes a Vector instead of a table- Now sets the creator of the spawned entities to the player that created the spawner
- Renamed
self:CustomOnEntitySpawn()→self:OnSpawnEntity() - Renamed
self.VJBaseSpawnerDisabled→self.PauseSpawning - Renamed
self.TimedSpawn_Time→self.RespawnCooldown - Fixed position changing on spawn which sometimes caused respawned NPCs to be created stuck
- Removed:
self:DoSingleSpawn()self:CustomOnInitialize_AfterNPCSpawn()self:CustomOnThink_AfterAliveChecks()self:PlayIdleSound()self:PlaySpawnEntitySound()self.HasIdleSoundsself.HasSpawnEntitySoundself.OverrideDisableOnSpawnself.TimedSpawn_OnlyOne
Projectile Base¶
- Added:
self:InitPhys()self:PlaySound(sdSet)self:Destroy(data, phys)self.CollisionDecalself.CollisionBehaviorself.ProjectileTypeself.CollisionFilter
- Renamed
self:CustomOnPhysicsCollide(data, phys)→self:OnCollision(data, phys) - Renamed
self:CustomOnCollideWithoutRemove(data, phys)→self:OnCollisionPersist(data, phys) - Renamed
self:CustomOnTakeDamage(dmginfo)→self:OnDamaged(dmginfo) - Renamed
self:DeathEffects(data, phys)→self:OnDestroy(data, phys) - Renamed
self.DelayedRemove→self.RemoveDelay - Merged
self:CustomOnDoDamage(data, phys, hitEnts)andself:CustomOnDoDamage_Direct(data, phys, hitEnt)→self:OnDealDamage(data, phys, hitEnts) - Deprecated:
self:OnCollideSoundCode()self:SetDeathVariablesTrue(data, phys, runOnDestroy)
- Removed:
self:CustomOnInitializeBeforePhys()self:CustomPhysicsObjectOnInitialize(phys)self:PlayIdleSound()self:StartupSoundCode()self:OnRemoveSoundCode()self.PhysicsInitTypeself.MoveTypeself.CollideCodeWithoutRemovingself.MoveCollideTypeself.CollisionGroupTypeself.RemoveOnHitself.PaintDecalOnDeathself.PaintDecalOnCollideself.CollideCodeWithoutRemovingself.NextCollideWithoutRemoveself.RemoveOnHitself.SolidTypeself.DecalTbl_DeathDecalsself.DecalTbl_OnCollideDecals
NPC Controller¶
- Added:
self.VJC_Bullseye_RefreshPosself.VJC_NPC_CanTurnself.VJC_Player_CanChatMessage
- Added
keyPressedparameter toself:OnStopControlling() - Renamed
self:CustomOnKeyPressed(key)→self:CustomOnKeyPressed(key) - Renamed
self:CustomOnKeyBindPressed(key)→self:OnKeyBindPressed(key) - Renamed
self:CustomOnStopControlling(keyPressed)→self:OnStopControlling(keyPressed) - Renamed player tag
self.IsControlingNPC→self.VJ_IsControllingNPC - Removed:
self:CustomOnSetControlledNPC()self:CustomOnRemove()
Entity Tags¶
- Replaced global enums with entity variables:
VJ_TAG_HEALING→self.VJ_ST_HealingVJ_TAG_EATING→self.VJ_ST_EatingVJ_TAG_BEING_EATEN→self.VJ_ST_BeingEatenVJ_TAG_SD_PLAYING_MUSIC→self.VJ_SD_PlayingMusicVJ_TAG_HEADCRAB→self.VJ_ID_HeadcrabVJ_TAG_POLICE→self.VJ_ID_PoliceVJ_TAG_CIVILIAN→self.VJ_ST_HealingVJ_TAG_TURRET→self.VJ_ID_TurretVJ_TAG_VEHICLE→self.VJ_ID_VehicleVJ_TAG_AIRCRAFT→self.VJ_ID_Aircraft
- Added:
self.IsVJBaseBullseyeself.IsVJBaseProjectileself.VJ_ID_Livingself.VJ_ID_Destructibleself.VJ_ID_Healable
- Renamed
self.IsVJBase_Gib→self.IsVJBaseCorpse_Gib - Renamed
self.VJ_IsHugeMonster→self.VJ_ID_Boss - Renamed
self.VJ_IsDetectableDanger→self.VJ_ID_Danger - Renamed
self.VJ_IsDetectableGrenade→self.VJ_ID_Grenade - Renamed
self.VJ_IsPickupableDanger→self.VJ_ID_Grabbable - Renamed
self.VJ_IsPickedUpDanger→self.VJ_ST_Grabbed - Renamed
self.VJ_AddEntityToSNPCAttackList→self.VJ_ID_Attackable - Renamed
self.VJ_LastInvestigateSd→self.VJ_SD_InvestTime - Renamed
self.VJ_LastInvestigateSdLevel→self.VJ_SD_InvestLevel - Removed:
self:VJTags_Add()self.VJTagsVJ_TAG_VJ_FRIENDLY