Skip to content
Merged
Show file tree
Hide file tree
Changes from 175 commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
e37329e
continue onReceive event calls if Recording component has failure
AmyrAhmady Apr 17, 2024
cc04361
create NPCs component
AmyrAhmady Oct 18, 2024
46759c4
create pawn scripting api for current NPC functions
AmyrAhmady Apr 17, 2024
7ad704a
force internal updates on position and rotation change
AmyrAhmady Apr 17, 2024
120955d
calculate travelled distance once
AmyrAhmady Apr 17, 2024
6edef7e
add NPC_StopMove
AmyrAhmady Apr 17, 2024
7e0f21d
restart npc move when pos or rot is reset
AmyrAhmady Apr 17, 2024
49e9b94
only start npc move if move type is valid
AmyrAhmady Apr 17, 2024
bc6c6eb
set internal rot and pos values during move to avoid recursion
AmyrAhmady Apr 17, 2024
a833cbb
use stopMove when npc move is finished
AmyrAhmady Apr 17, 2024
5b2078f
only send NPC foot sync if player is spawned
AmyrAhmady Apr 17, 2024
3f36a9f
use underscore suffixed class variables for NPC class
AmyrAhmady Apr 17, 2024
2ac25b2
fix formatting
AmyrAhmady Apr 17, 2024
39d97dd
rename npc connect events to entity create and destroy
AmyrAhmady Apr 20, 2024
0396713
mark to be destroyed npcs to be process next tick
AmyrAhmady Apr 20, 2024
c2213b5
destroy NPCs safely
AmyrAhmady Apr 20, 2024
e0dd2f7
use NPC ref instead of ptr in emulate functions
AmyrAhmady Apr 20, 2024
65c333a
store footSyncRate config value in npc component
AmyrAhmady Apr 23, 2024
b3cecb4
calculate estimated arrival time and use it to detect finish move
AmyrAhmady Apr 23, 2024
4f386f3
fix velocity calculation
AmyrAhmady Apr 23, 2024
d57501b
add NPC_SetFacingAngle and GetFacingAngle
AmyrAhmady Apr 23, 2024
d1c7818
another attempt to fix npc movements
AmyrAhmady Apr 24, 2024
690c8bf
add NPC_SetSkin
AmyrAhmady May 8, 2024
85dc27b
add streamed in check natives for NPCs
AmyrAhmady May 13, 2024
4097909
add NPC_GetAll native
AmyrAhmady May 13, 2024
63d2fac
npc interior natives
AmyrAhmady May 18, 2024
c3a9237
proper class variable initialization in constructor
AmyrAhmady May 18, 2024
8f7790a
add set/get velocity for NPCs
AmyrAhmady May 18, 2024
b5d527d
fix NPC_SetFacingAngle
AmyrAhmady Oct 18, 2024
564e565
add health, armour and animation natives
AmyrAhmady Oct 20, 2024
34e9e7d
validity check for setHealth and setArmour
AmyrAhmady Oct 20, 2024
ed73b1e
update SDK
AmyrAhmady Jan 28, 2025
2c00264
add set and get weapon
AmyrAhmady Jan 28, 2025
80d1ae5
add set and get ammo
AmyrAhmady Jan 29, 2025
245c997
add get and set weapon skill level
AmyrAhmady Jan 29, 2025
935b8dc
fix typo, wepaon to weapon
AmyrAhmady Jan 29, 2025
2210754
handle keys properly, add pawn functions for it
AmyrAhmady Jan 30, 2025
21f502c
handle death and damage, base of weapon stuff
AmyrAhmady Jan 30, 2025
4bf94be
fix formatting
AmyrAhmady Jan 30, 2025
6920a1c
fix getTickCount issue
AmyrAhmady Jan 30, 2025
a763ece
change damagerId to damager in onNPCTakeDamage
AmyrAhmady Jan 30, 2025
5e462c1
call pawn events
AmyrAhmady Jan 31, 2025
be4fb35
fix packet structure and ready for external usage too
AmyrAhmady Feb 1, 2025
5fda946
add melee attack functionality
AmyrAhmady Feb 1, 2025
488646c
fix typo in removeKey
AmyrAhmady Feb 1, 2025
4164bf9
add set and get fighting style
AmyrAhmady Feb 2, 2025
00c0103
a lot of wepaon and ammo stuff, weapon shot feature
AmyrAhmady Feb 3, 2025
54c4458
isDead :infinilul:
AmyrAhmady Feb 3, 2025
2e77462
fix build error on linux
AmyrAhmady Feb 3, 2025
dda02e2
fix formatting
AmyrAhmady Feb 3, 2025
38bfd8b
send bullet sync with NPC_Shoot
AmyrAhmady Feb 3, 2025
491614e
add pawn callback OnNPCGiveDamage
AmyrAhmady Feb 3, 2025
bbaa160
fix move stop issue, removes up key
AmyrAhmady Feb 4, 2025
2969574
add IsReloading and IsShooting
AmyrAhmady Feb 4, 2025
b79f747
add aiming feature and finish shooting mechanism
AmyrAhmady Feb 4, 2025
b000574
add npc.globalUpdareRate config
AmyrAhmady Feb 4, 2025
629aa4e
fix formatting
AmyrAhmady Feb 4, 2025
7463ba3
add aiming pawn natives
AmyrAhmady Feb 4, 2025
7a79654
fix NPC_AimAtPlayer definition
AmyrAhmady Feb 4, 2025
970eaa9
add OnNPCSpawn pawn callback
AmyrAhmady Feb 4, 2025
b55565b
fix typo and update time indicator issue
AmyrAhmady Feb 4, 2025
b29015b
set ipv6 to false for npcs
AmyrAhmady Feb 4, 2025
f4e9095
add set and get weapon accuracy
AmyrAhmady Feb 5, 2025
e1b2a63
add moveSpeed to npc move
AmyrAhmady Feb 5, 2025
bbe006d
check if npc is valid in damage callbacks
AmyrAhmady Feb 5, 2025
d035b35
enter and exit vehicle
AmyrAhmady Feb 7, 2025
d092f09
NPC_IsMoving, NPC_EnterVehicle, NPC_ExitVehicle
AmyrAhmady Feb 8, 2025
a5e60d3
fix destroyed NPC IDs not being able to be used again
AmyrAhmady Mar 4, 2025
45bf1fd
update SDK
AmyrAhmady Mar 4, 2025
7c505c6
use setWeaponState in updateWeaponState
AmyrAhmady Mar 4, 2025
7a57ac7
fix player rotation when aiming
AmyrAhmady Mar 4, 2025
a27c282
fix shooting, still weird it's not hitting, but at least it shoots
AmyrAhmady Mar 5, 2025
5e8d1b0
small changes in update counter, sending aimsync (maybe broken)
AmyrAhmady Apr 11, 2025
e611cba
return id and no hit pos in getClosestEntityInBetween
AmyrAhmady Jun 23, 2025
e782e27
fix shooting, fix damage, fix bulelt sync
AmyrAhmady Jun 23, 2025
d807c46
fix player aim sync packet
AmyrAhmady Jun 23, 2025
277d4cb
change in my comment
AmyrAhmady Jul 12, 2025
408a97d
do not set foot sync if an update is not needed
AmyrAhmady Jul 18, 2025
f646de7
skip regular updates if there's no change in npc
AmyrAhmady Jul 18, 2025
7cab24e
fix sync value checks for NPC packets
AmyrAhmady Jul 18, 2025
a447e79
more accurate and better NPC move handling
AmyrAhmady Jul 18, 2025
029c2e4
rename from quaternion ro rotation
AmyrAhmady Jul 18, 2025
9cd652b
fix issue with angle when moving stops
AmyrAhmady Jul 18, 2025
c08f802
allow vehicle movement, driver npcs
AmyrAhmady Aug 5, 2025
87ca21b
fix NPC/player damage recusrsion
AmyrAhmady Aug 6, 2025
f4488b7
fix OnNPCTakeDamage
AmyrAhmady Aug 7, 2025
d0c0a87
fix windows github runner version
AmyrAhmady Jul 12, 2025
60311ac
get rid of using global footsync rate value
AmyrAhmady Aug 19, 2025
6bb3dd9
add lots of more config for fine tuning npc settings
AmyrAhmady Aug 19, 2025
320b045
fix put-in and remove-from vehicle functions
AmyrAhmady Aug 19, 2025
0c681dc
check if vehicleid is invalid for onfoot sync
AmyrAhmady Aug 19, 2025
1ebaf9b
properly handle sync and use new config vars
AmyrAhmady Aug 19, 2025
3bd0abd
finish player entering vehicle task
AmyrAhmady Aug 19, 2025
b028056
implement driver and passenger sync
AmyrAhmady Aug 19, 2025
2a41e2d
add NPC_PutInVehicle and NPC_RemoveFromVehicle
AmyrAhmady Aug 19, 2025
5365a19
add stopRange parameter for npc move
AmyrAhmady Aug 22, 2025
c4dd214
add path implementation and moveByPath (no pawn)
AmyrAhmady Aug 22, 2025
5c9fc58
add NPC::respawn and NPC_Respawn for pawn
AmyrAhmady Aug 22, 2025
ba9fd34
add per npc path functions to sdk
AmyrAhmady Aug 22, 2025
94cabdf
add moveToPlayer, properly handle entity release checks
AmyrAhmady Aug 22, 2025
065b9cb
add NPC_MoveToPlayer pawn native
AmyrAhmady Aug 22, 2025
bfdc495
add NPC path pawn natives
AmyrAhmady Aug 22, 2025
67687a5
add NPC_MoveByPath pawn native
AmyrAhmady Aug 22, 2025
7770005
reverse search for NPC id in player pool
ksenonadv Apr 12, 2025
4dd3689
Fixed "reverse search for NPC id in player pool" (#1088)
NoPressF Jul 18, 2025
c4a0dba
NPC_PathHasNextPoint & NPC_GetPathNextPoint
AmyrAhmady Aug 22, 2025
5a3a3e5
preallocations and some code optimizations
AmyrAhmady Aug 24, 2025
5d9bcea
get rid of path's point manager and make it per npc
AmyrAhmady Aug 24, 2025
11530ce
add reverse path movement in MoveByPath
AmyrAhmady Aug 24, 2025
238280f
add npc weapon modifiers
AmyrAhmady Aug 25, 2025
6749bce
npc remove from vehicle if move triggered by in vehicle
AmyrAhmady Aug 25, 2025
0ed4a4e
add npc vehicle death handling
AmyrAhmady Aug 26, 2025
e485ae0
add lots of vehicle related functions
AmyrAhmady Aug 26, 2025
92afbec
add npc animation functions
AmyrAhmady Aug 26, 2025
314aef0
deprecate ConnectNPC
AmyrAhmady Aug 26, 2025
c6137df
add OnNPCWeaponShot
AmyrAhmady Aug 26, 2025
af33b3b
add playback features and pawn functions
AmyrAhmady Aug 26, 2025
afbba49
fix exiting vehicle
AmyrAhmady Aug 26, 2025
1429028
fix formatting
AmyrAhmady Aug 26, 2025
20d2c49
fix npc enterVehicle seat checks
AmyrAhmady Aug 26, 2025
b611f58
fix server close crash for npcs
AmyrAhmady Aug 26, 2025
bc4f683
implement npc node management and playing
AmyrAhmady Aug 27, 2025
866b00e
remove debug print
AmyrAhmady Aug 27, 2025
ae5ad2b
make sure npc goes to vehicle if it's within the range
AmyrAhmady Aug 27, 2025
9085790
add npc special action functions
AmyrAhmady Aug 27, 2025
ca43630
add entering vehicle information functions
AmyrAhmady Aug 27, 2025
d113398
fix SDK submodule
AmyrAhmady Aug 27, 2025
1dd567d
fix driver not having UP key set
AmyrAhmady Aug 27, 2025
93bf67a
npc component validity check in natives to prevent crash
AmyrAhmady Aug 28, 2025
b0af254
fix NPC facing angle when following players
AmyrAhmady Aug 28, 2025
a2e93ad
set NPC final pos to where they are instead of target
AmyrAhmady Aug 28, 2025
467aeaf
fix facing angle issue for aiming NPCs
AmyrAhmady Aug 29, 2025
d2f2a00
add OnNPCFinishMovePath
AmyrAhmady Aug 29, 2025
dcfa217
add NPC_SetInvulnerable and NPC_IsInvulnerable
AmyrAhmady Aug 29, 2025
37a28ef
add npc surfing
AmyrAhmady Aug 30, 2025
4dbcef6
prevent early stopMove in path movement
AmyrAhmady Sep 1, 2025
9b6d723
send weapon state in aim sync
AmyrAhmady Sep 1, 2025
a0dc6cf
fix stopAim logic if it's not aiming at player
AmyrAhmady Sep 1, 2025
cd03a73
add NPC_HasPathPointInRadius (#1115)
NoPressF Sep 1, 2025
5ccfc01
rename to NPC_HasPointInRange
AmyrAhmady Sep 1, 2025
a97b5ee
fix NPC_HasPathPointInRange name
AmyrAhmady Sep 1, 2025
6e7b89b
fix npc record playback
AmyrAhmady Sep 1, 2025
3fb7487
add special action and animation to npc playback
AmyrAhmady Sep 1, 2025
13620ee
fix npc invulnerablility check
AmyrAhmady Sep 1, 2025
fd2f49b
sync packets only if needed in Recordings comp
AmyrAhmady Sep 1, 2025
034dd78
fix setVelocity issue in npcs
AmyrAhmady Sep 1, 2025
f24e5c4
strcut size validity and weapons in npc playback
AmyrAhmady Sep 1, 2025
3e639ce
attempt to process playbacks better
AmyrAhmady Sep 1, 2025
96e4202
attempt to fix paused playbacks
AmyrAhmady Sep 7, 2025
17143f3
add GetVehicleRotation
AmyrAhmady Sep 8, 2025
5ed6150
implement OnNPCFinishMovePathPoint
AmyrAhmady Sep 8, 2025
98d6495
set vw, interior, and health default values
AmyrAhmady Sep 8, 2025
0181112
fix NPC_IsAnyStreamedIn
AmyrAhmady Sep 9, 2025
d235006
avoid crashing if somehow NPC is not in a vehicle anymroe
AmyrAhmady Sep 9, 2025
8a7c77d
stop movements when playback starts
AmyrAhmady Sep 9, 2025
8d7b6a1
use animation values in onfoot recordings
AmyrAhmady Sep 10, 2025
3d617de
use a map for record IDs
AmyrAhmady Sep 10, 2025
0b81cdd
fix onfoot sync immediate update check
AmyrAhmady Sep 11, 2025
e607025
store anim data as proper values, fix onfoot anim
AmyrAhmady Sep 11, 2025
93ed7bc
fix vehicle health
AmyrAhmady Sep 13, 2025
055ceff
protection against accidentally destroying a carriage
AmyrAhmady Sep 13, 2025
185787a
fix npc melee attack typo
AmyrAhmady Sep 20, 2025
db50635
add stopRange usage to NPC_Move
AmyrAhmady Sep 23, 2025
f15df3a
fix kicking NPCs crashing in certain situations
AmyrAhmady Sep 24, 2025
67ddb51
update sdk submodule to dev branch
AmyrAhmady Sep 25, 2025
b245e3a
resolve conflicts and fix formatting
AmyrAhmady Sep 25, 2025
eb13392
fix weapon shoot positions
AmyrAhmady Oct 1, 2025
e222d0c
fix npc shooting when stopped in event
AmyrAhmady Oct 1, 2025
1408d65
Revert "fix weapon shoot positions"
AmyrAhmady Oct 1, 2025
b876feb
a shallow copy of NPCs for tick
AmyrAhmady Oct 2, 2025
dbec732
fix OnNPCSpawn infinite loop
AmyrAhmady Oct 11, 2025
ce18204
stop processing npc actions if marked for kick
AmyrAhmady Oct 11, 2025
e5f526e
clear NPC component data on reset
AmyrAhmady Oct 11, 2025
44e754f
fix NPC OnPlayerDisconnect double call
AmyrAhmady Oct 13, 2025
a3579ff
emulate interior change rpc
AmyrAhmady Oct 21, 2025
82e6cd6
test NPCs in test component
AmyrAhmady Oct 21, 2025
7ad5f5b
Merge branch 'master' into amir/NPCs
AmyrAhmady Oct 22, 2025
db325ae
use omp version numbers for NPCs component
AmyrAhmady Oct 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ on:
jobs:
build-windows:
name: Windows build
runs-on: windows-2019
runs-on: windows-latest

strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions Server/Components/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ add_subdirectory(TextLabels)
add_subdirectory(Timers)
add_subdirectory(Variables)
add_subdirectory(Vehicles)
add_subdirectory(NPCs)

# Pawn
if(BUILD_PAWN_COMPONENT)
Expand Down
26 changes: 25 additions & 1 deletion Server/Components/LegacyConfig/config_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const FlatHashMap<StringView, ParamType> types = {
{ "timestamp", ParamType::Bool },
{ "logtimeformat", ParamType::String },
{ "logqueries", ParamType::Bool },
{ "chatlogging", ParamType::Bool },
{ "chatlogging", ParamType::Custom },
{ "db_logging", ParamType::Bool },
{ "db_log_queries", ParamType::Bool },
{ "onfoot_rate", ParamType::Int },
Expand Down Expand Up @@ -209,6 +209,30 @@ class LegacyConfigComponent final : public ILegacyConfigComponent, public Consol
return true;
}

if (name.find("chatlogging") == 0)
{
auto it = dictionary.find("chatlogging");

Impl::String lower(right);
std::transform(lower.begin(), lower.end(), lower.begin(), [](unsigned char c)
{
return std::tolower(c);
});

if (lower == "true" || lower == "1")
{
config.setBool(it->second, true);
config.setBool("logging.log_deaths", true);
}
else if (lower == "false" || lower == "0")
{
config.setBool(it->second, false);
config.setBool("logging.log_deaths", false);
}

return true;
}

return false;
}

Expand Down
7 changes: 7 additions & 0 deletions Server/Components/NPCs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
get_filename_component(ProjectId ${CMAKE_CURRENT_SOURCE_DIR} NAME)
include_directories(${CMAKE_SOURCE_DIR}/lib/cpp-httplib)
add_server_component(${ProjectId})

target_link_libraries(${ProjectId} PRIVATE
CONAN_PKG::ghc-filesystem
)
Loading