Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPC Component (WIP) #916

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4377835
continue onReceive event calls if Recording component has failure
AmyrAhmady Apr 17, 2024
e930b1c
create NPCs component
AmyrAhmady Oct 18, 2024
949a40e
create pawn scripting api for current NPC functions
AmyrAhmady Apr 17, 2024
1d9bac3
force internal updates on position and rotation change
AmyrAhmady Apr 17, 2024
32331ff
calculate travelled distance once
AmyrAhmady Apr 17, 2024
3e9a7bc
add NPC_StopMove
AmyrAhmady Apr 17, 2024
a265c88
restart npc move when pos or rot is reset
AmyrAhmady Apr 17, 2024
43e64cd
only start npc move if move type is valid
AmyrAhmady Apr 17, 2024
8cb4005
set internal rot and pos values during move to avoid recursion
AmyrAhmady Apr 17, 2024
c1db6c9
use stopMove when npc move is finished
AmyrAhmady Apr 17, 2024
6582920
only send NPC foot sync if player is spawned
AmyrAhmady Apr 17, 2024
589a6cf
use underscore suffixed class variables for NPC class
AmyrAhmady Apr 17, 2024
07b1d16
fix formatting
AmyrAhmady Apr 17, 2024
6ee33c1
rename npc connect events to entity create and destroy
AmyrAhmady Apr 20, 2024
3417285
mark to be destroyed npcs to be process next tick
AmyrAhmady Apr 20, 2024
95d5522
destroy NPCs safely
AmyrAhmady Apr 20, 2024
de9320f
use NPC ref instead of ptr in emulate functions
AmyrAhmady Apr 20, 2024
4c7916c
store footSyncRate config value in npc component
AmyrAhmady Apr 23, 2024
2b94508
calculate estimated arrival time and use it to detect finish move
AmyrAhmady Apr 23, 2024
84b176c
fix velocity calculation
AmyrAhmady Apr 23, 2024
827d3e6
add NPC_SetFacingAngle and GetFacingAngle
AmyrAhmady Apr 23, 2024
c474539
another attempt to fix npc movements
AmyrAhmady Apr 24, 2024
13daf56
add NPC_SetSkin
AmyrAhmady May 8, 2024
7c369e8
add streamed in check natives for NPCs
AmyrAhmady May 13, 2024
e686725
add NPC_GetAll native
AmyrAhmady May 13, 2024
10599d5
npc interior natives
AmyrAhmady May 18, 2024
eb1a3f4
proper class variable initialization in constructor
AmyrAhmady May 18, 2024
4bf88e5
add set/get velocity for NPCs
AmyrAhmady May 18, 2024
5ad4db9
fix build
AmyrAhmady Oct 18, 2024
5980d0f
fix NPC_SetFacingAngle
AmyrAhmady Oct 18, 2024
3e101db
add health, armour and animation natives
AmyrAhmady Oct 20, 2024
0ee0f1a
validity check for setHealth and setArmour
AmyrAhmady Oct 20, 2024
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
Prev Previous commit
Next Next commit
force internal updates on position and rotation change
AmyrAhmady committed Oct 18, 2024
commit 1d9bac3c407edbabd5d23e43c0bfdef642383046
6 changes: 6 additions & 0 deletions Server/Components/NPCs/NPC/npc.cpp
Original file line number Diff line number Diff line change
@@ -68,6 +68,9 @@ Vector3 NPC::getPosition() const
void NPC::setPosition(Vector3 pos)
{
footSync.Position = pos;

// Let it update for all players and internally in open.mp
sendFootSync();
}

GTAQuat NPC::getRotation() const
@@ -78,6 +81,9 @@ GTAQuat NPC::getRotation() const
void NPC::setRotation(GTAQuat rot)
{
footSync.Rotation = rot;

// Let it update for all players and internally in open.mp
sendFootSync();
}

int NPC::getVirtualWorld() const