Guild icon
Ark Server Api
── ( General | Chat ) ── / 【👓】ᴘʟᴜɢɪɴ-ᴛᴏᴘɪᴄꜱ
Avatar
Static_cast shows up as invalid type conversion
10:16 AM
Avatar
as long as it builds your good, turn build sense off (edited)
10:20 AM
on error list tab
10:20 AM
youll notice a combo box
10:20 AM
select Build only
10:20 AM
10:21 AM
it might prevent showing errors over stuff thats not ment to have them
Avatar
its shows build order/build
Avatar
your in the output tab
10:21 AM
not error tab
10:21 AM
"Error List Tab"
10:22 AM
oh you dont have it open
10:22 AM
click at top View -> Error List
10:22 AM
then you should see the option to select build only
Avatar
ah okay got it
10:23 AM
ye its not conmiling
Avatar
yeah i hate god damn intelligence build
Avatar
maybe you have a extra { or }
10:23 AM
somewhere where its not suppose to be
10:23 AM
or my function name differs from yours
Avatar
WeaponName ?
Avatar
float Hook_APrimalStructure_TakeDamage
10:25 AM
maybe that part
10:25 AM
can you show me your full code?
10:25 AM
copy it to pastebin.com
10:25 AM
or soemthing
Avatar
its defined when i highlight it
10:25 AM
sure just a sec
Avatar
you added
10:26 AM
Hook_APrimalStructure_TakeDamage
10:26 AM
twice
10:26 AM
try just comment out the one you made
10:26 AM
with /* and */
10:26 AM
around it
10:27 AM
you cant have 2x the same hook well you can but would have to be named differently its pointless to use 2 hooks just combine the 2 functions
Avatar
well ye but i'm trying to prevent damage to structures from 2 different entities
10:28 AM
that is players and dinos
10:29 AM
oh wait nvm i get what you're saying
10:30 AM
do it in the same hook
Avatar
just combine both ye ?
Avatar
ACharacter* character = EventInstigator->CharacterField(); if (character != nullptr && character->IsA(APrimalDinoCharacter::GetPrivateStaticClass())) {
10:32 AM
did this part work yeah
10:32 AM
?
10:32 AM
cause might be easier
10:32 AM
, AActor* DamageCauser
10:32 AM
to cast the actor
Avatar
that part works fine though
10:34 AM
missing a { or } somewhere...
Avatar
also you know you have
10:35 AM
all those ifs
10:35 AM
checking dino names
10:35 AM
you can use ||
10:35 AM
it means or
Avatar
ye dunno its more tidy like this 😄
10:36 AM
no its not
10:37 AM
check my pastebin out
10:37 AM
if (descr.Contains(L"") descr.Contains(L"") descr.Contains(L"") descr.Contains(L"") descr.Contains(L"") || descr.Contains(L"")) return 0;
10:37 AM
how is this not more tidy then what you had ?
10:37 AM
i dint actually add the dino names you can fill those 😃
10:38 AM
oh i made a mistake i dint try compile thats why
Avatar
you must have things set differently as i'm unable to build your code 😄
Avatar
nah i made a typo i think
10:40 AM
i havent tried compiling it as of yet
10:40 AM
DECLARE_HOOK(APrimalStructure_TakeDamage, float, APrimalStructure, float, FDamageEvent, AController, AActor, AShooterPlayerController*);
10:40 AM
your hook
Avatar
damn i missing something somwhere and it cant compile
Avatar
why did you add
10:40 AM
AShooterPlayerController
10:40 AM
at the end?
Avatar
i copied it from KIllFeed
Avatar
you cant do that
10:41 AM
you gotta follow the declartation
10:42 AM
of
10:42 AM
APrimalStructure
10:42 AM
then it takes you to Actor.h
10:42 AM
then you find the TakeDamage Function
10:42 AM
and grab the arguments
10:42 AM
from there
10:42 AM
float TakeDamage(float Damage, FDamageEvent * DamageEvent, AController * EventInstigator, AActor * DamageCauser) { return NativeCall<float, float, FDamageEvent *, AController *, AActor *>(this, "APrimalStructure.TakeDamage", Damage, DamageEvent, EventInstigator, DamageCauser); }
10:42 AM
^^ see
10:42 AM
it doesnt have AShooterPlayerController
10:42 AM
change
10:42 AM
DECLARE_HOOK(APrimalStructure_TakeDamage, float, APrimalStructure, float, FDamageEvent, AController, AActor, AShooterPlayerController*);
10:42 AM
to
10:43 AM
DECLARE_HOOK(APrimalStructure_TakeDamage, float, APrimalStructure*, float, FDamageEvent*, AController*, AActor*); (edited)
10:43 AM
now it should compile
10:44 AM
having issues with _This
10:45 AM
replace your hole page
10:45 AM
with that
10:46 AM
obviously you need to add the dino names again
10:46 AM
but it should compile now
Avatar
it does for me
Avatar
also what is the L before the dino names ?
Avatar
makes it unicode
Avatar
oh damn
10:46 AM
awesome
Avatar
to get a Fstring in unicode u can do this
10:47 AM
so if u had FString WeaponName;
10:47 AM
and you wanted to format that into a string
10:47 AM
FString NewStr = FString::Format(L"my string: {}", *WeaponName); (edited)
10:48 AM
adding * infront of a FString like i did to WeaponName
10:48 AM
will make it return it in wchar type instead of FString to easier use it with formatting (edited)
10:50 AM
also when ark server crashs if you read the errors you will find one with the same class file as your file and it shows a number after : this relates to what line in your source caused ark server to crash it may help you with tracing crash's
10:51 AM
ShooterGame\Saved\Logs
10:51 AM
if you go here
10:51 AM
and open the .crashstack file
10:51 AM
it gives you full info
10:51 AM
10:52 AM
example of a crash in InitWorld in AdvancedChat Plugin
10:52 AM
10:52 AM
notice the highlighted line at the end is the line number relating to my class
Avatar
is that the line inside the plugin itself ?
10:53 AM
it helps to easier find what function caused the crash
10:54 AM
also there are .dmp files
10:54 AM
you can directly run these
10:54 AM
and it may even take you directly to the line that caused it
Avatar
wait what, what's incorrect about this ?
11:03 AM
nvm
Avatar
btw they dotnt have to be in 1 huge long line
11:05 AM
before 1 of the || you can hit enter
11:05 AM
to take it to a new line
11:05 AM
example
Avatar
too late haha
Avatar
if(lol lol asda lol lol || hello) return 0; (edited)
11:06 AM
you can always do at a later date if you plan on adding more npc's it might be easier
11:06 AM
as you can read them all 😃 on 1 page w/o scroll then
11:06 AM
you're right this looks much better
Avatar
see i wouldnt do 1 line per 1
11:07 AM
i would of put all them in about 2-3 lines
11:07 AM
but its personal preference
11:07 AM
it wont effect performance
11:08 AM
i can see why its easier 1 line each cause you just press down on the keyboard to enter the next text 😃 after a copy and paste (edited)
Avatar
yeah 😄
11:10 AM
btw quick question have you had cases where stuff on your server magically does structure damage
11:10 AM
like on my server there is a turret that does structure damage
11:10 AM
how is that even possible ?
11:15 AM
time to take this plugin on a test spin 😄
Avatar
not sure havent had reports of it but i have decay enabled so that my servers automatically clears old buildings (edited)
11:29 AM
maybe you just have decay enabled
11:29 AM
and thats whats doing it
11:29 AM
not sure
Avatar
no for example there is a tek turret on my server and when it shoots a dino near a structure it damages the structure with the dino
11:32 AM
(even on friendly fire)
Avatar
id say thats because it shot the projectile and it just happened to collide with the structure theirs not much you can do about that
11:40 AM
unless you find the function for targetting
11:41 AM
and check if the dino is on friendly mode and if so dont fire
Avatar
ye i just added this
11:43 AM
Avatar
if(!ArkApi::GetApiUtils().IsRidingDino(player)) player->Suicide();
11:43 AM
i made that function for the api btw
11:43 AM
the IsRidingDino
11:43 AM
i had to before find out weather a player was riding a dino so i got it added to the api
Avatar
now that would additionally require a chat command right
Avatar
aight gotta figure out how to id the player casting it...
Avatar
i dont think any casts
11:45 AM
are required
Avatar
by cast i men using it my bad
Avatar
ah i thought you meant you would have to cast like you did earlier
11:46 AM
with static_cast
Avatar
which hook would that require APrimalCharacter_takeDamage && APrimalCharacter_takeDamageOriginal ?
Avatar
for what?
12:03 PM
to do the sucidie you dont need a hook just a command
12:03 PM
and paste that bit of code in the command i posted above
Avatar
oh and thats it ?
Avatar
add the suicide code near the command ?
Avatar
how would i define the command for suicide
12:46 PM
like what would be the identification method for killing the player that executes that command
Avatar
void SuicideCMD(AShooterPlayerController* player, FString* message, int mode) { if (!player || !player->PlayerStateField() || !player->GetPlayerCharacter() || player->GetPlayerCharacter()->IsDead()) return; if (!ArkApi::GetApiUtils().IsRidingDino(player)) player->Suicide(); } (edited)
2:50 PM
ArkApi::GetCommands().AddChatCommand("/suicide", &SuicideCMD); (edited)
2:51 PM
ArkApi::GetCommands().RemoveChatCommand("/suicide");
2:51 PM
all commands are done with same function arguments
Avatar
thx i will add that once i’m near my pc again
Avatar
yeah Michidu made adding commands and hooks super easy
6:23 PM
and no problem enjoy
Avatar
any hook for a dinos breath radius ?, have a dragon on my server that has a super long breath range (it even goes through caves)
Avatar
dumb question but is suicide a function of arkapi or do i have to define it 😄
Avatar
i believe that already exists (edited)
5:36 AM
ah
5:36 AM
i see the issue
5:36 AM
its meant to be GetPlayerCharacter()->Suicide();
5:36 AM
void SuicideCMD(AShooterPlayerController* player, FString* message, int mode) { if (!player || !player->PlayerStateField() || !player->GetPlayerCharacter() || player->GetPlayerCharacter()->IsDead()) return; if (!ArkApi::GetApiUtils().IsRidingDino(player)) player->GetPlayerCharacter()->Suicide(); } (edited)
Avatar
Okay, manage to fix my VS. And managed to build a already made plugin. Now i just need to understand what all functions for each structure means and can do. So i know what's possible or not. (Though mostly function is pretty self explanatory.) (edited)
Avatar
Rogue Leader 11/26/2018 2:38 PM
That's the hard part. Figuring out when an objects functions are called
2:38 PM
Or what they do
Avatar
Guess it's lot's of try and error ! 😉
Avatar
And apparently a lot of serverrestarts :=
2:40 PM
So wildcard have no information they want to share about this?
Avatar
Rogue Leader 11/26/2018 2:42 PM
I know Michidus and OwnProxs Githubs have a lot of good material for popular hooks, timers, and commands
2:43 PM
Most of my plugins are derived from those. However, implementing a timer tripped me up at first
Avatar
Okay, will take a look, thx! 😃
Avatar
hi, i'm trying to prevent the damage from dinos to structures from both wild and tamed dinos, this is what my plugin looks like now however it does not seem to prevent the damage from tamed dinos only wild ones, any mistakes in the code ?
Avatar
Not sure, but i think you need to check if the dino have a team id
Avatar
@Toma use cheat plugins.unload PluginName
5:14 AM
no restarts needed
5:14 AM
then cheat plugins.load PluginName
5:15 AM
just make sure you make DisableHook functions
5:15 AM
and RemoveCommand
5:15 AM
functions to support unloading of the dll during runtime
5:15 AM
i never restart my server to test my new dll builds
5:16 AM
this is actually a feature i worked on then passed it to Michidu, and he worked on it and made it a bit different but with the same outcome and command based (edited)
5:18 AM
@WETBATMAN @Foppa nah he wants to prevent all damage so he doesnt need to check team id my guess is when a character is riding a dino maybe its acting as if a character class hit the structure and your type checking for a dino could be the issue maybe
5:19 AM
try put another else and then check type is a AShooterCharacter or something
5:19 AM
and put a log and try attack with a dino
Avatar
i already put a long in the second IF ELSE part
6:25 AM
it only outputs log if dino is wild
6:25 AM
if its tamed i get no log and it does damage
Avatar
Rogue Leader 11/27/2018 6:58 AM
@OwnProx do timers need to be removed on unload as well?
Avatar
yes if you want to unload your plugin and reload it during runtime
8:20 AM
it doesnt matter if you have no plans of unloading it
Avatar
if (_this && EventInstigator && !EventInstigator->IsLocalController() && EventInstigator->IsA(AShooterPlayerController::StaticClass())) { AShooterPlayerController* AttackerShooterController = static_cast<AShooterPlayerController*>(EventInstigator); if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()) { FString WeaponName; AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr); if (WeaponName.Contains(L"Flamethrower")) return 0; } }
1:03 PM
this seems to be the problem code @OwnProx
1:03 PM
my dirty solution for now 🤷 (edited)
1:06 PM
any solution to check if a player is knocked out sitting on a chair or has handcuffs on ?
Avatar
see a state for being conscious but what about being unconscious 😄
Avatar
add !
2:19 PM
at the start of it
2:20 PM
!player->GetPlayerCharacter()->IsConscious()
2:20 PM
its a bool btw or you can do this
2:20 PM
player->GetPlayerCharacter()->IsConscious() == false
2:20 PM
your choice
2:21 PM
bool has 2 states
Avatar
true or false
Avatar
true or false
Avatar
ye
Avatar
yeah
2:21 PM
when you put the ! at the start
Avatar
anyway to check if the player has handcuffs on ?
Avatar
it will act as if false is true and true is false
Avatar
so invert basically
Avatar
yeah
Avatar
got it
Avatar
i prefer using ! instead of typing == false
Avatar
also trying to check if the player is on a chair but it needs more arguments
Avatar
maybe
2:23 PM
this is fucking with damage
2:23 PM
from ridden dino's
2:23 PM
!EventInstigator->IsLocalController() (edited)
2:23 PM
try remove that from your checks btw
2:23 PM
im pretty sure thats what i added to be sure it was a non controlled npc
2:23 PM
this could be why your damage prevent script is not working
2:23 PM
for tamed npcs
Avatar
once i straight up copied the wild dino names into the first if argument it started wokring
2:24 PM
will try that
2:24 PM
though
Avatar
yeah pretty sure its that causing it
2:25 PM
->GetPlayerCharacter()->IsSitting(false)
2:25 PM
i used isSitting
Avatar
what is LocalController though
Avatar
like that
Avatar
player ?
Avatar
i believe it means if the dino is being controlled
Avatar
ohhhhh
Avatar
EventInstigator->IsLocalController() == true
2:26 PM
^^ means controlled by player
2:26 PM
its a guess but yeah
2:26 PM
and in that if i gave u
2:26 PM
its checking if its false
2:26 PM
to continue
2:27 PM
hence why its only preventing damage from non controlled dino's
Avatar
that explains it
2:28 PM
...
2:28 PM
one last thing 😄
2:28 PM
anyway to check if a player has handcuffs on ?
2:28 PM
trying to prevent /suicide if the player is caged basically haha
Avatar
Rogue Leader 11/27/2018 2:31 PM
@WETBATMAN keep in mind that the API functions for the basic ark classes have no documentation, so a lot of your development is going to be hunting for this or that function and debugging values to see if it's what you're looking for.
Avatar
maybe
2:31 PM
GetPlayerCharacter()->bIsImmobilized()()
2:31 PM
its a guess
Avatar
well yes we're literally injecting into a game
2:31 PM
😄
Avatar
Rogue Leader 11/27/2018 2:31 PM
I usually search keywords in the relevant header files
2:32 PM
also if you start typing a name
2:33 PM
it filters the results
2:33 PM
helping you to find a function
2:33 PM
if you cant be asked to look in headers
2:33 PM
might help you wetbatman if you dont already know this
Avatar
Rogue Leader 11/27/2018 2:33 PM
Ooo I have a question. What does the double parenthesis do? I saw it in a lot of the other sources and I saw it for getting player and dino stats.
Avatar
ye i found nothing for handcuffs exactly
2:34 PM
however there appears to be a function for checking a certain inventory slot
Avatar
double as in the variable
2:34 PM
?
2:34 PM
its a numeric variable that supports decimals (edited)
2:35 PM
or do you mean something different?
Avatar
Rogue Leader 11/27/2018 2:35 PM
So in your example with bIsMobilized()() I would have thought to use bIsImobilized().Get()
2:35 PM
ye its like a getter
2:35 PM
a quicker way instead of doing .Get()
2:36 PM
Michidu added it
2:36 PM
he removed a lot of stuff with ()()
2:36 PM
a while back
Avatar
Rogue Leader 11/27/2018 2:36 PM
Oh shit. I didn't know you could overload ()
Avatar
before loads more stuff required it
2:36 PM
nor did i (edited)
2:36 PM
also u know you can put *
2:36 PM
infront of a fstring
2:36 PM
to return a wchar value
Avatar
Rogue Leader 11/27/2018 2:37 PM
I noticed that the other night when I was trying to fix crazy characters in my recon commands
Avatar
you may need to use Michidu's unicode support
2:37 PM
for rcon
Avatar
Rogue Leader 11/27/2018 2:37 PM
He told me to put a * and FString::Format them and it fixed them
Avatar
if it is in unicode
2:38 PM
yeah
2:39 PM
2:39 PM
you can see how he did it here
2:39 PM
its mainly for bitfields
2:40 PM
RT operator()() const { return GetNativeBitField<RT, T>(parent, field_name); }
Avatar
getting a build error with this line, i assume i dont need all the arguments with a bool ?
Avatar
you actually failed to copy and paste
2:41 PM
hahaha
2:41 PM
i included 2x ()
2:41 PM
at the end of the function
2:41 PM
bIsImmobilized
2:41 PM
should be like this
2:41 PM
bIsImmobilized()()
Avatar
i typed it in myself 🤷‍♂️ (edited)
2:42 PM
add another ()
2:42 PM
and your good
2:42 PM
those are bitfields btw
2:42 PM
well the bIsImmobilized
2:43 PM
oh
2:43 PM
i remember how i checked for handcuffs
2:43 PM
i think
2:43 PM
all you do is check the current weapon
2:43 PM
of the player
2:43 PM
and scan the name for handcuff
Avatar
yeah that sounds like that might work ?
2:54 PM
but arent handcuffs placed into the accessory slot ?
Avatar
i dont think so
2:57 PM
i believe i checked it before
2:57 PM
and it is the current weapon
Avatar
hmm alright
2:58 PM
AShooterPlayerController* AttackerShooterController = static_cast<AShooterPlayerController*>(EventInstigator); if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()) { FString WeaponName; AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr); if (WeaponName.Contains(L"Flamethrower")) return 0; } (edited)
Avatar
yeah just make a command
2:58 PM
place that if into it
2:58 PM
then you dont need that static cast at the top
2:58 PM
and output WeaponName
2:58 PM
in the log
2:59 PM
then get handcuffs put on yourself or someone
2:59 PM
and type the command
2:59 PM
and see what the value of WeaponName is
Avatar
if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()) { FString WeaponName; AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr); if (WeaponName.Contains(L"Flamethrower")) return 0; }
3:01 PM
so this and then check for weaponname ? (edited)
3:02 PM
Log::GetLog()->warn("Weapon Name: {}, WeaponName.ToString());
Avatar
no static cast ?
Avatar
no need
3:02 PM
when you add it to the command function
3:03 PM
void MyCommand(AShooterPlayerController* AttackerShooterController, FString* message, int mode) { if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()) { FString WeaponName; AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr); Log::GetLog()->warn("Weapon Name: {}", WeaponName.ToString()); } } (edited)
3:03 PM
it already has a pointer to the player
3:04 PM
ArkApi::GetCommands().AddChatCommand("/test", &MyCommand);
3:04 PM
^^ add that to Init / Load function
3:05 PM
ArkApi::GetCommands().RemoveChatCommand("/test");
Avatar
!player is undefined
Avatar
because you named it AttackerShooterController
Avatar
so replace Player with AttackerShooterController ?
Avatar
or AttackerShooterController with player 😃
Avatar
void MyCommand(AShooterPlayerController* AttackerShooterController, FString* message, int mode) { if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()) { FString WeaponName; AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr); Log::GetLog()->warn("Weapon Name: {}", WeaponName.ToString()); } } (edited)
3:16 PM
like that will do
3:17 PM
ArkApi::GetCommands().AddChatCommand("/test", &MyCommand);
Avatar
alright loading up my testserver now
Avatar
if (!AttackerShooterController || !AttackerShooterController->PlayerStateField() || !AttackerShooterController->GetPlayerCharacter() || AttackerShooterController->GetPlayerCharacter()->IsSitting(true)) return;
3:37 PM
using this but still dying when sitting and using /suicide
3:41 PM
@OwnProx i've removed !EventInstigator->IsLocalController() from my checks and tamed dinos now do structure damage
Avatar
hmm it kills me when knocked out too 😄 (edited)
4:05 PM
void SuicideCMD(AShooterPlayerController* AttackerShooterController, FString* message, int mode) { if (!AttackerShooterController || !AttackerShooterController->PlayerStateField() || !AttackerShooterController->GetPlayerCharacter() || AttackerShooterController->GetPlayerCharacter()->IsDead()) return; if (!ArkApi::GetApiUtils().IsRidingDino(AttackerShooterController)) AttackerShooterController->GetPlayerCharacter()->Suicide(); if (!AttackerShooterController || !AttackerShooterController->PlayerStateField() || !AttackerShooterController->GetPlayerCharacter() || !AttackerShooterController->GetPlayerCharacter()->IsConscious()) return; if (!AttackerShooterController || !AttackerShooterController->PlayerStateField() || !AttackerShooterController->GetPlayerCharacter() || AttackerShooterController->GetPlayerCharacter()->IsSitting(false)) return; if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()) { FString WeaponName; AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr); if (WeaponName.Contains(L"Flamethrower")) return; Log::GetLog()->warn("Weapon Name: {}", WeaponName.ToString()); } }
Avatar
AttackerShooterController->GetPlayerCharacter()->IsSitting(false))
4:27 PM
i have false here
Avatar
tried it with both didn't work with either
Avatar
void SuicideCMD(AShooterPlayerController* AttackerShooterController, FString* message, int mode) { if (!AttackerShooterController || !AttackerShooterController->PlayerStateField() || !AttackerShooterController->GetPlayerCharacter() || AttackerShooterController->GetPlayerCharacter()->IsDead()) return; if (!ArkApi::GetApiUtils().IsRidingDino(AttackerShooterController)) AttackerShooterController->GetPlayerCharacter()->Suicide(); if (!AttackerShooterController || !AttackerShooterController->PlayerStateField() || !AttackerShooterController->GetPlayerCharacter() || !AttackerShooterController->GetPlayerCharacter()->IsConscious()) return; if (!AttackerShooterController || !AttackerShooterController->PlayerStateField() || !AttackerShooterController->GetPlayerCharacter() || AttackerShooterController->GetPlayerCharacter()->IsSitting(false)) return; if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()) { FString WeaponName; AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr); if (WeaponName.Contains(L"Flamethrower")) return; Log::GetLog()->warn("Weapon Name: {}", WeaponName.ToString()); } }
10:44 AM
having trouble detecting if a player is sitting and if the character is knocked out
10:44 AM
if (_this && EventInstigator && EventInstigator->IsA(AShooterPlayerController::StaticClass())) { AShooterPlayerController* AttackerShooterController = static_cast<AShooterPlayerController*>(EventInstigator); if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()) { FString WeaponName; AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr); if (WeaponName.Contains(L"Flamethrower")) return 0; } }
10:45 AM
also is there anything other than AShooterPlayer controller that can be used to detect players ?, as it seems to detect tamed dinos as players and thus breaks the code preventing damage from dinos to structures (if the dino is tamed that is)
10:46 AM
or is there a way to integrate wild dino detection to that part too so there is no need for 2 if statements ?
Avatar
tamed dinos as players?
Avatar
yeah that seems the issue 😄
10:57 AM
wait lemme send something
10:57 AM
in here it fails to detect tamed dinos and prevent structure damage
10:58 AM
if i simply paste the dino detection code into the first statement (AshooterPlayerController) it now detects tamed dinos
10:58 AM
but only tamed
Avatar
figured it out !!!!
11:09 AM
was able to place everything into 1 IF statement
Avatar
finally got knocked out detection and sitting detection to work
12:29 PM
cant test handcuffs solo 😦
Avatar
what function have you used?
Avatar
void SuicideCMD(AShooterPlayerController* AttackerShooterController, FString* message, int mode) { if (!AttackerShooterController || !AttackerShooterController->PlayerStateField() || !AttackerShooterController->GetPlayerCharacter() || AttackerShooterController->GetPlayerCharacter()->IsDead() || !AttackerShooterController->GetPlayerCharacter()->IsConscious() || AttackerShooterController->GetPlayerCharacter()->IsSitting(false)) return; if (!ArkApi::GetApiUtils().IsRidingDino(AttackerShooterController)) AttackerShooterController->GetPlayerCharacter()->Suicide(); if (AttackerShooterController && AttackerShooterController->PlayerStateField() && AttackerShooterController->GetPlayerCharacter() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField() && AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()) { FString WeaponName; AttackerShooterController->GetPlayerCharacter()->CurrentWeaponField()->AssociatedPrimalItemField()->GetItemName(&WeaponName, false, true, nullptr); if (WeaponName.Contains(L"Handcuffs")) return; } }
Avatar
ah, so IsSitting works
Avatar
yeah it does not kill me
Avatar
eh got everything to work but not the handcuff detection 😥
Avatar
Isn't Handcuffed realized as a PrimalBuff ?
Avatar
is it ?
Avatar
I start devkit and look what i can get :)
Avatar
Only thing i can find so far: Baseclass Hatchet, but overrides ItemType from Weapon to Equiment, and EquimentType to Shield, and to Offhand Perhaps you can go with GetShieldItem() instead of CurrentWeaponField
Avatar
when i remember testing it
10:05 PM
it was the current item
10:05 PM
as if you were holding a sword
10:05 PM
same with handcuff's (edited)
10:05 PM
i did it a few months back 99% sure its as a weapon (edited)
10:06 PM
i think im not 100% certain though was a few months back
10:07 PM
i was making something and preventing teleport when handcuffed
10:11 PM
i know how you can launch 2 copy's of ark (edited)
10:11 PM
to test
10:12 PM
on the same pc if it can handle it (edited)
Avatar
2 copies of ark ?
4:37 AM
why would you want to do that ?
4:37 AM
oh for joining the same server 2 acting as 2 persons ?
Avatar
I surely would like to know how to do this. It's hard to do testing where you require another player in the game. Do please share. (edited)
Avatar
you can run 2 steam copies using Sandboxie, just disable BE
Avatar
does it hurt to have nullptr checks in every IF argument 😄
3:06 PM
?
Avatar
A little, but i doubt you need it
Avatar
ye checking EventInstigator for it as i had crashes with it before
3:29 PM
was wondering if i needed to check other stuff too
3:30 PM
also finally got handcuff detection to work
3:30 PM
😃
Avatar
Rogue Leader 11/29/2018 4:33 PM
That's awesome!
4:35 PM
Just a side note, if you are ever sending notifications or messages to players on events, always make sure it's an actual player and not a dino. I had a plugin I was testing crash everytime a wild dino did damage because it was trying to send them messages 😂
Avatar
Rogue Leader 11/29/2018 6:48 PM
@here has anyone heard of weapon or turret mods breaking plugins in any way. I have a player saying that my npp plugin is breaking his turrets by making them not fire. He uses weapons plus and sentry turrets. My plugin doesn't modify any objects, just takes the damage hook on structures and them makes it normal or 0. (edited)
Avatar
use weapons + have no issues
6:49 PM
in fact i'm watching a raid go down right now as people are tanking AP turrets 😄
6:51 PM
also if they were firing but not doing damage that could be related to the plugin but not firing at all is just not something that can be related to this plugin
Avatar
Rogue Leader 11/29/2018 6:52 PM
That's what I was thinking
Avatar
also photon sentry has a super long targeting time
6:56 PM
not only that but some modded dinos dont get shot by any turret
6:57 PM
there are a lot of variables in that scenario it would be hard to narrow the blame down to the plugin
Avatar
Is there any plugin that has a source code that I can achieve the following?
  • When someone uses a command, I want to detect if they are within a certain raidus/range from a given cordinate. If any of you have any snippet for this, would really appreciate if you could share it.
Avatar
hmm maybe arkhomes ?
2:59 PM
Server Plugins for ARK: Server API. Contribute to Michidu/Ark-Server-Plugins development by creating an account on GitHub.
2:59 PM
i think it has a check to not teleport you when nearby an enemy structure
Avatar
get the player pos, calculate distance
Avatar
Ok, great thanx 😃
Avatar
Is it even possible to make a command to be used by a plugin when the command is normally used on what the player is looking at/targeting? (edited)
Avatar
so do command when player targets something?
Avatar
well, that's not gonna work. Since the wish is to be used by rcon 😛 (edited)
3:37 PM
3:37 PM
Talking about this one
Avatar
you mean add this command to rcon?
Avatar
yeah i have been looking into your extended rcon
3:50 PM
and tried to make it. And using this function: UpdateImprintingDetails_Implementation
Avatar
if you have a player, you can get his target
Avatar
is it need though? if i specify the dino id and such?
Avatar
no, probably i misunderstood you
Avatar
APrimalDinoCharacter_UpdateImprintingDetails_Implementation, void, FString *, unsigned __int64 Though the function will probably ignore that since it's only what's a string and a player id
Avatar
so what problems you have?
3:53 PM
hm, let me look
Avatar
I can send the whole void instead 😛
3:55 PM
or more like this is the line i'm having trouble with: dino->UpdateImprintingDetails_Implementation(FString *ImprinterName, steam_id);
Avatar
you can't send FString?
Avatar
you need to pass the address, FString ImprinterName = "some name"; dino->UpdateImprintingDetails_Implementation(&ImprinterName , steam_id);
3:59 PM
SetImprintedPlayer uses this function: APrimalDinoCharacter::UpdateImprintingDetails
3:59 PM
ok, it's same 😄
4:01 PM
But the ImprinterName should be addressed from the parsing (edited)
Avatar
FString ImprinterName = Parsed[1];
4:03 PM
Finally i can test the build 😛
4:04 PM
Thanks Michidu
Avatar
Trying to add a new command to the Extended RCON: SetImprintToPlayer The command is suppose to work as any else of the commands. To run it should be: SetImprintToPlayer <DinoID1> <DInoID2> <SteamID> And i tried to make use of the steamID to look up the PlayerID so you don't need type when running the command. But i can't make it work. And i'm stuck 😦 (edited)
11:27 PM
void SetImprintToPlayer(RCONClientConnection* rcon_connection, RCONPacket* rcon_packet, UWorld*) { FString msg = rcon_packet->Body; TArray<FString> parsed; msg.ParseIntoArray(parsed, L" ", true); if (parsed.IsValidIndex(4)) { int dino_id1; int dino_id2; uint64 steam_id; FString playerName; try { dino_id1 = std::stoi(*parsed[1]); dino_id2 = std::stoi(*parsed[2]); steam_id = std::stoull(*parsed[3]); playerName = parsed[4]; } catch (const std::exception&) { SendRconReply(rcon_connection, rcon_packet->Id, "Request has failed"); Log::GetLog()->info("error.1"); return; } APrimalDinoCharacter* dino = APrimalDinoCharacter::FindDinoWithID(ArkApi::GetApiUtils().GetWorld(), dino_id1, dino_id2); if (!dino) { SendRconReply(rcon_connection, rcon_packet->Id, "Can't find dino"); Log::GetLog()->info("error.2"); return; } AShooterPlayerController* shooter_pc = ArkApi::GetApiUtils().FindPlayerFromSteamId(steam_id); if (!shooter_pc) { SendRconReply(rcon_connection, rcon_packet->Id, "Can't find player from the given steam id"); Log::GetLog()->info("error.3"); return; } shooter_pc->GetPlayerCharacterName(&playerName); Log::GetLog()->info("error.4"); dino->UpdateImprintingDetails(&playerName, shooter_pc->LinkedPlayerIDField()); SendRconReply(rcon_connection, rcon_packet->Id, "Successfully changed Imprint on dino"); Log::GetLog()->info("error.5"); } else { SendRconReply(rcon_connection, rcon_packet->Id, "Not enough arguments"); } }
11:32 PM
ehm.. notice one thing i have missed trying..
Avatar
nvm i got it working!! 😄 (edited)
Avatar
i won't say what i missed.... I'm to embarrassed to say 😊
Avatar
GSH | MrOwlSky 12/4/2018 1:41 AM
Lol
Avatar
does preventing damage to a dino/player prevent torpor as well or does that need a different function ?
Avatar
also is there a hook to include both player and dino (tamed) that can be used instead of writing 2 hooks APrimaCharacter and APrimalDino ?
Avatar
@Foppa index started at 0
3:20 PM
thats what
3:20 PM
haha
3:20 PM
dino_id1 = std::stoi(*parsed[1]);
3:20 PM
would of been
3:20 PM
dino_id1 = std::stoi(*parsed[0]);
3:20 PM
i guess
3:21 PM
cause its not like the chat command as the input string of chat command
3:21 PM
includes the command itself i think
3:21 PM
thats why index 1 is used in that case
3:23 PM
but yeah dont worry every programmer overlooks something one time or another ive made a similar mistake and took like 5 mins to realise
Avatar
{ int dino_id1; int dino_id2; uint64 steam_id; - FString playerName; try {
3:28 PM
And changed the index to 3
3:28 PM
basically
3:28 PM
😄
8:36 PM
hmm getting this error for one of my servers
8:37 PM
nvm the dll was corrupted i think
Avatar
Rogue Leader 12/7/2018 2:46 AM
@WETBATMAN Did you get an answer on your torpor question?
2:47 AM
I think* torp is a percentage of damage depending on the damage causer. If you can't find a specific hook, you could allow damage in that situation and just heal the damage of the attack
Avatar
void DestroyStructuresForTeam(RCONClientConnection* rcon_connection, RCONPacket* rcon_packet, UWorld*) { FString msg = rcon_packet->Body; TArray<FString> parsed; msg.ParseIntoArray(parsed, L" ", true); if (parsed.IsValidIndex(1)) { uint64 team_id; try { team_id = std::stoi(*parsed[1]); } catch (const std::exception&) { SendRconReply(rcon_connection, rcon_packet->Id, "Request has failed"); return; } if (team_id < 999999999) { SendRconReply(rcon_connection, rcon_packet->Id, "You have enter the wrong TeamID"); return; } UWorld* world = ArkApi::GetApiUtils().GetWorld(); if (!world) { SendRconReply(rcon_connection, rcon_packet->Id, "Something must have gone terribly wrong?"); return; } TArray<AActor*>* FoundActors = new TArray<AActor*>(); UGameplayStatics::GetAllActorsOfClass(world, APrimalStructure::GetPrivateStaticClass(), FoundActors); std::stringstream ss; int num = 0; for (uint32_t i = 0; i == FoundActors->Num(); i++) { AActor* actor = (*FoundActors)[i]; APrimalStructure* structure = static_cast<APrimalStructure*>(actor); const int structure_team = structure->TargetingTeamField(); if (structure_team == team_id) { structure->Destroy(false, true); num++; } } ss << "Destroyed " << num << " structures belonging to team " << team_id; delete FoundActors; ArkApi::Tools::ConvertToWideStr(ss.str()); SendRconReply(rcon_connection, rcon_packet->Id, "Successfully Destroyed team structures!"); } else { SendRconReply(rcon_connection, rcon_packet->Id, "Not enough arguments"); } } (edited)
😮 1
4:00 AM
Trying to make the command to destroy a tribes structures (it's copy from Improved Commands)
4:00 AM
And i have tried to remake it
4:00 AM
But it never destroys anything, and i can't figure out why >_<
Avatar
GSH | MrOwlSky 12/7/2018 4:01 AM
Hmm
Avatar
though it print's out " Successfully Destroyed team structures! " 😛
4:03 AM
So that indicates it goes trough the whole code
Avatar
Rogue Leader 12/7/2018 5:05 AM
You can try using Log::GetLog()->warn("Some text"); in your loop to see what structures it's hitting
5:06 AM
Or use it in different places to see where it's messing up at
5:08 AM
I use a lamda expression to loop through my structures. Give me a minute to boot up my vm and open an old commit to when my plugin had a function similar.
Avatar
@Foppa
5:11 AM
figured it out yet ?
5:12 AM
cause i have already done this
5:12 AM
just not based on tribe id
5:16 AM
TArray<AActor*> AllStructures; UGameplayStatics::GetAllActorsOfClass(reinterpret_cast<UObject*>(ArkApi::GetApiUtils().GetWorld()), APrimalStructure::GetPrivateStaticClass(), &AllStructures); for (AActor* StructureActor : AllStructures) { if (StructureActor) { APrimalStructure* Structure = static_cast<APrimalStructure*>(StructureActor); Structure->Suicide(); } }
5:16 AM
thats it without tribe check
5:17 AM
also
5:17 AM
team_id = std::stoi(*parsed[1]);
Avatar
Rogue Leader 12/7/2018 5:17 AM
uint64 tribe_id = tribe_id_input; TArray<AActor*> AllStructures; UGameplayStatics::GetAllActorsOfClass(reinterpret_cast<UObject*>(ArkApi::GetApiUtils().GetWorld()), APrimalStructure::GetPrivateStaticClass(), &AllStructures); TArray<APrimalStructure*> FoundStructures; for (AActor* StructActor : AllStructures) { if (!StructActor || StructActor->TargetingTeamField() != tribe_id || !StructActor->IsA(APrimalStructure::GetPrivateStaticClass())) continue; FoundStructures.Add(static_cast<APrimalStructure*>(StructActor)); } for (APrimalStructure* st : FoundStructures) { //do something with found tribe structures } (edited)
Avatar
needs to be
5:17 AM
0
5:18 AM
barn you dont need to loop
5:18 AM
twice
Avatar
Rogue Leader 12/7/2018 5:18 AM
I know 😛 It is a really old example
Avatar
i gave a never one haha
5:18 AM
With Team Support: TArray<AActor*> AllStructures; UGameplayStatics::GetAllActorsOfClass(reinterpret_cast<UObject*>(ArkApi::GetApiUtils().GetWorld()), APrimalStructure::GetPrivateStaticClass(), &AllStructures); for (AActor* StructureActor : AllStructures) { if (StructureActor && StructureActor->TargetingTeamField() == team_id) { APrimalStructure* Structure = static_cast<APrimalStructure*>(StructureActor); Structure->Suicide(); } } (edited)
5:19 AM
his biggest issue
5:19 AM
is hes using index 1
5:19 AM
on parsed
5:19 AM
so what he uses his rcon command
5:19 AM
teamid is at index 0
Avatar
Rogue Leader 12/7/2018 5:19 AM
Debug your code 😛
Avatar
not index 1
5:20 AM
my guess thats why its not working for him
5:20 AM
haha
5:20 AM
uint64 team_id; try { team_id = std::stoi(*parsed[1]); } catch (const std::exception&) { SendRconReply(rcon_connection, rcon_packet->Id, "Request has failed"); return; }
5:20 AM
needs to be (edited)
5:20 AM
uint64 team_id; try { team_id = std::stoi(*parsed[0]); } catch (const std::exception&) { SendRconReply(rcon_connection, rcon_packet->Id, "Request has failed"); return; } (edited)
5:21 AM
thats why @Foppa code is not working at least hahaha (edited)
5:21 AM
i mentioned it earlier too
5:21 AM
its the second time i told him about this index haha
Avatar
Rogue Leader 12/7/2018 5:22 AM
you can always use Log::GetLog()->warn(someVar1); too to check if your variables are correct too, unless there's an easier way
Avatar
yeah
5:22 AM
as i remember rcon commands is not +1 on index
5:23 AM
like normal commands
Avatar
Rogue Leader 12/7/2018 5:23 AM
there's a debug function on the log, but i couldn't get it to work
Avatar
cause normal commands have the command
5:23 AM
in the actual parsed string
5:23 AM
where as rcon commands dont
5:23 AM
like if u did this command ingame
5:24 AM
/help lol
Avatar
Rogue Leader 12/7/2018 5:24 AM
using a lambda for loop will probably* give you better performance too
Avatar
index 0 = help
5:24 AM
index 1 = lol
5:24 AM
but now if you do a rcon command
5:24 AM
help lol
5:24 AM
index 0 = lol
5:24 AM
pretty sure it works like that
5:24 AM
yeah i gave him that example
5:25 AM
not sure why hes looping using .Num
5:25 AM
its extra work
5:25 AM
more typing haha
Avatar
Rogue Leader 12/7/2018 5:25 AM
yea, rcon is index 0 for the first argument after the command name
Avatar
yeah
5:25 AM
thats his issue then (edited)
Avatar
Rogue Leader 12/7/2018 5:25 AM
the command name itself triggers the function
5:26 AM
i even said it back here
5:26 AM
like a day ago
5:26 AM
it still went unnoticed by him haha
Avatar
Rogue Leader 12/7/2018 5:26 AM
i dont understand why the chat command starts at 1 though. Doesn't make sense to pass the command name if it's what triggers the function anyway
Avatar
because when u get chat input
5:27 AM
it will be 1 string like
5:27 AM
/lol hello erwerwe
5:27 AM
then we use a splitter class
Avatar
Rogue Leader 12/7/2018 5:27 AM
ooooh i see, it's how the game itself behaves
Avatar
to split by spaces
5:27 AM
then michidu will loop a array
5:27 AM
by the first arg
5:27 AM
which is the command
5:27 AM
if found he passes the hole string
5:27 AM
to the command callback (edited)
Avatar
Rogue Leader 12/7/2018 5:28 AM
I have something like a master chat function that handles my chat commands.
5:28 AM
inline void ChatCommand(AShooterPlayerController* player, FString* message, int mode) { TArray<FString> parsed; message->ParseIntoArray(parsed, L" ", true); if (parsed.IsValidIndex(1)) { FString input = parsed[1]; auto value = input.ToString(); if (value.compare("info") == 0) { Info(player, message, mode); } else if (value.compare("status") == 0) { Status(player, message, mode); } else if (value.compare("disable") == 0) { Disable(player, message, mode); } else { ArkApi::GetApiUtils().SendNotification(player, NewPlayerProtection::MessageColor, NewPlayerProtection::MessageTextSize, NewPlayerProtection::MessageDisplayDelay, nullptr, *NewPlayerProtection::NPPInvalidCommand); } } else { ArkApi::GetApiUtils().SendNotification(player, NewPlayerProtection::MessageColor, NewPlayerProtection::MessageTextSize, NewPlayerProtection::MessageDisplayDelay, nullptr, *NewPlayerProtection::NPPInvalidCommand); } }
5:29 AM
I'm considering sharing my paid plugin code on github sometime soon to get help for performance issues
Avatar
doesnt support unicode
5:29 AM
though
Avatar
Rogue Leader 12/7/2018 5:29 AM
Yea, that's been a big complaint so far, no unicode
Avatar
auto value = input.ToString();
5:29 AM
thats why
5:29 AM
as soon as you convert it to a string
5:30 AM
if (parsed[1].Equals(L"info")) { }
5:30 AM
^^ is a better way to do it
Avatar
Rogue Leader 12/7/2018 5:31 AM
thanks!
5:31 AM
Currently they are hard coded in, but I'm updating them when I have time
Avatar
also if your interested
5:32 AM
5:32 AM
thats how commands are handled in the api
Avatar
Rogue Leader 12/7/2018 5:33 AM
so strings dont support unicode?
Avatar
exacly
5:34 AM
FString does
Avatar
Rogue Leader 12/7/2018 5:34 AM
lol i just have to change value to input then in my code and delete the tostring line (edited)
Avatar
example of using FStrings in formatter
5:34 AM
FString Lol;
5:35 AM
FString::Format(L"{} test", *Lol); (edited)
5:35 AM
yeah
5:35 AM
try avoid using string as much as possible
5:35 AM
the FString class is easy any
5:35 AM
it has loads of sub functions
5:36 AM
and if you need more function insight (edited)
5:36 AM
full info about it ^
Avatar
Rogue Leader 12/7/2018 5:41 AM
Thanks. I have a lot of work left to do on my NPP plugin, I just havent had time between work and taking care of the baby
5:42 AM
I'm planning on giving it mysql support because it's causing performance issues using sqlite on clusters
5:42 AM
I need to add unicode support
5:43 AM
And I have two other plugins I have in the works, a passive protect plugin and a logging plugin that puts all relevant info in a database for easy admin support for admins that know sql (edited)
5:44 AM
I was writing plugins from work, but now I'm too busy to do it.
Rogue Leader 12/7/2018 5:50 AM
Avatar
what you can do
6:06 AM
instead of using mysql, load data to a array when the player loggs in then unload it when he logs out (edited)
6:06 AM
load it from sqllite
6:07 AM
i do it in many of my plugins, store data in array over mysql / sqllite
6:07 AM
just make sure you free it or you'd be creating a memory leak haha (edited)
6:08 AM
you will get atleast 2000% performance increase
6:08 AM
depending on how often your sql func was called obcourse
6:09 AM
if its called constantly it would be better to use a arrray to load the data to and retrieve from
Avatar
Rogue Leader 12/7/2018 6:28 AM
Currently I'm loading all the database data into a vector on server startup, then running another vector of online players. I sync online player changes with the all data vector and use the all data vector to calculate changes. But the issue arises when I write the all data vector data to the database on world saves. On a cluster, it's writing 2k records at one time across multiple servers on one system. Reports have been that large player base servers with 6 servers clustered are having cpu locks when the data saves to the db.
6:29 AM
I could potentially update the insert statements to only update or insert what changed. Currently it's doing an upsert like statement and uldatomg every record and adding more if it needs to. (edited)
Avatar
so wait the data you load
8:21 AM
does that actually change?
8:22 AM
or are u just inserting it back in for the sake of it
8:22 AM
cause maybe limit the update / inserts to only changed data
8:22 AM
and perhaps save on player loggout
8:22 AM
per player data
8:22 AM
instead of saving a hole array of data on srv save (edited)
8:23 AM
also dont load the full db into the array only load the players that logged in data to it and on loggout update db and remove it from the array (edited)
8:23 AM
also im not quite sure on what data your saving so maybe this will work or maybe not depends
8:25 AM
that way its no where near as big of a i/o task (edited)
8:26 AM
when its every so often when a player loggs in or out
8:28 AM
or you could make a db queue
8:28 AM
and only execute 1 per tick or something
8:28 AM
or 1 per second
8:29 AM
but the first method is better
Avatar
Just woke im gonna check soon! Ty for all help!
Avatar
Rogue Leader 12/7/2018 2:04 PM
So the reason I load all the data is because I need all the data, unless there's a way to get offline player tribe id and level
2:04 PM
And I have it all loading and saving at the same time be cause I was having issues with the database locking up when I first made it.
Avatar
@Rogue Leader Yeah i used "Log::GetLog()" but removed it so i could post it here in discord. And i have followed up with logs and it doesn't get stuck anywhere what i can find. @OwnProx In my experienced so far so it doesn't matter if it the parsing index is set to 1 or 0. it's just the order of how the arg is suppose to be parsed. Correct me if i'm wrong.
2:25 PM
And it's only rcon commands so no help is suppose to be given
2:25 PM
i could ofc.
Avatar
does anyone want to try
Avatar
async saveworld
2:30 PM
oh, async saveworld 😛
Avatar
it may cause a crash
2:30 PM
it may not
Avatar
that was fast answer 😄
Avatar
you have a player base ?
Avatar
I have a copy
2:30 PM
of a player base on my test server
Avatar
so you dont actually have ppl playing ah gutted
2:31 PM
the only way to know if it crash's or not
2:31 PM
is to have ppl logging in and out
2:31 PM
while its saving
Avatar
Does need to be more than 1-2 players?
Avatar
yeah
2:31 PM
to increase the chances
2:32 PM
if it doesnt crash with like 50 players
2:32 PM
it will improve saving to no lagg
2:32 PM
Well i could apply it on my live servers, lol
Avatar
very brave 😃
Avatar
Anything for science!
Avatar
thats what i dint want to do
2:34 PM
haha
Avatar
Well you need to sell it in
2:34 PM
😉
Avatar
let me test it is actually saving
2:34 PM
using another thread then ill send you the code
Avatar
it is scary stuff though cause i can imagine if a user loggs while its saving and if their is no null check
2:35 PM
it will crash
2:35 PM
within the SaveWorld
2:35 PM
function
Avatar
or it can corrupt saves..
Avatar
make backup
2:35 PM
change save timer
2:36 PM
to more frequent
2:36 PM
haha
Avatar
This can be a very ... interesting turning
Avatar
anyway, you agreed already 😃
Avatar
haha, well i guess i did 😄
2:37 PM
I am going to install it on my high rated server though, so it won't affect the hardcore ppl (edited)
2:38 PM
and push out a announcement so more ppl can join
Avatar
so i saved the world
2:39 PM
closed the server
2:39 PM
w/o logging out
2:39 PM
as i knew that would trigger a save on my character
2:39 PM
now if im still on a rock it worked
2:44 PM
2:44 PM
Source ^^
2:45 PM
Compiled ^^
Avatar
Oh well
2:46 PM
here goes nothing
2:46 PM
😄
2:47 PM
i already save like every 15 min is that enough or should i decrease the interval even more? 😛
Avatar
we will remember you 😉
2:48 PM
shut up 😛
Avatar
nah its good
2:50 PM
you can try run cheat saveworld manually (edited)
2:50 PM
every so often
2:51 PM
how many players do you have online ?
2:52 PM
dont run it too often
2:52 PM
otherwise you might get i/o crash
2:52 PM
like 2 concurrent save operations haha
2:53 PM
make sure to atleast leave 5-10 seconds before trying each save world
2:53 PM
if this does not crash which is quite unlikely, it would make saving so much smoother (edited)
Avatar
atm not many expecting more to come now
2:54 PM
ppl have school and working atm
Avatar
ah you might not notice a crash for hours then
2:55 PM
its just may happen if the world is saving and someone loggs out at the same time
2:56 PM
im interested to know, michidu tried this in the past but never tested it on a live server haha so though wed find someone who was willing to try it (edited)
Avatar
No worries 😃
2:59 PM
Btw, tried changing uint64 team_id; try { team_id = std::stoi(*parsed[1]); } TO uint64 team_id; try { team_id = std::stoi(*parsed[0]); } It didn't work.
Avatar
0 is string most of the time
3:00 PM
since you split it by spaces
Avatar
Where ?
Avatar
what exactly are you all testing 😄
Avatar
Btw, i think the world save is already corrupt (edited)
3:05 PM
😄
3:05 PM
from 104mb to 75mb
Avatar
in parsed
3:09 PM
maybe this code also optimizes save size 😃
3:15 PM
added some better exception handling
3:15 PM
should be able to catch null pointers
3:16 PM
See Project Properties -> C/C++ -> Code Generation -> Modify the Enable C++ Exceptions to "Yes With SEH Exceptions"
3:17 PM
if you wanna compile it yourself that is
Avatar
Thank you!
Avatar
maybe i shouldn't have taken a Server that isn't that heavy modded 😛 (edited)
Avatar
wait why do you run cs with Primal fear ?
Avatar
classic flyers
Avatar
Oh yeah
3:30 PM
it works like a charm
Avatar
cf
3:30 PM
i mean
3:30 PM
btw what wourkaround are you using for upgrade station
3:30 PM
no crafting skill ?
Avatar
No it's heavy increase so everything cost much more
Avatar
yeah but you know they can just augment the weapon and then use crafting skill to upgrade it further...
3:32 PM
i'd recommend disabling the crafting skill bonus as the upgrade station acts like the crafting skill itself
Avatar
[UpgradeStation] UpgradeMultiplier=100 UpgradeExponentialMultiplier=1.25 MaxUpgradeQualityIndex=5 UpgradeDisallowedItems= UpgradeStatIncreaseMin=2000 UpgradeStatIncreaseMax=10000 FortuneQualitySkipChance=10 FortuneReducedResourcesChance=10 FortuneReducedResourcesMultiplier=0.25 FortuneIncreasedSalvageChance=10 FortuneIncreasedSalvageMultiplier=2 FortuneUpgradeFailedChance=5 FortuneUpgradeFailedResourcesMultiplier=0.10 DisableSalvage=False SalvageMultiplier=.25
3:33 PM
These are settings i use
Avatar
the blueprint station is a bigger issue
3:34 PM
you can just blueprint an item
3:34 PM
upgrade it with crafting skill
3:34 PM
blueprint it again
3:34 PM
etc...
Avatar
hmmm...
Avatar
yeah...
3:37 PM
no fix unless you remove the blueprint station or crafting skill
Avatar
Rogue Leader 12/10/2018 5:38 PM
Question: is there a way to add an icon/graphic over a dino in the world using plugins? Like if it meets certain criteria, put an admin icon star thingy above it's Name Plate (edited)
😍 1
Avatar
GSH | MrOwlSky 12/10/2018 8:06 PM
That'd be amazing
Avatar
Hmmm... @OwnProx looks like the first related crash to it now 😛
11:34 PM
ShooterGameServer.exe!UObjectSerializer::SerializeObject() (0x00007ff70e3f8283) + 41 bytes [f:\build\trunk\projects\shootergame\source\shootergame\private\objectserializer.cpp:60] ShooterGameServer.exe!AShooterGameMode::SaveTribeData() (0x00007ff70e718e24) + 0 bytes [f:\build\trunk\projects\shootergame\source\shootergame\private\shootergamemode.cpp:3139] ShooterGameServer.exe!AShooterGameMode::AddToTribeLog() (0x00007ff70e7367e0) + 28 bytes [f:\build\trunk\projects\shootergame\source\shootergame\private\shootergamemode.cpp:6671] ShooterGameServer.exe!APrimalDinoCharacter::TryMultiUse() (0x00007ff70e4d2d00) + 0 bytes [f:\build\trunk\projects\shootergame\source\shootergame\private\primaldinocharacter.cpp:8717] ShooterGameServer.exe!AShooterPlayerController::ServerMultiUse_Implementation() (0x00007ff70e7ad015) + 18 bytes [f:\build\trunk\projects\shootergame\source\shootergame\private\shooterplayercontroller.cpp:5635] ShooterGameServer.exe!AShooterPlayerController::execServerMultiUse() (0x00007ff70ed9b345) + 325 bytes [f:\build\trunk\projects\shootergame\source\shootergame\classes\shooterplayercontroller.h:113]
Avatar
Rogue Leader 12/12/2018 3:48 PM
@deleted-roles, I opened both of my plugins as open source last night in #【💻】ᴘʟᴜɢɪɴꜱ. If anyone is interested in forking, contributing, or just offering optimizations, feel free to browse them!
Avatar
Awesome @Rogue Leader really nice of you and great work!
Avatar
@Rogue Leader see #【🤹】ʀᴇꜰᴇʀᴇɴᴄᴇꜱ tough i would help out ^^
Avatar
Rogue Leader 12/12/2018 9:28 PM
Thanks for sharing!
Avatar
np i might release everything someday xD
Avatar
Is there currently only one chat to discord plugin
Avatar
Rogue Leader 12/13/2018 2:22 AM
Anyone know if there is a unicode supported altrernative to this? std::ifstream file(ArkApi::Tools::GetCurrentDir() + "/ArkApi/Plugins/NewPlayerProtection/config.json"); FString NewPlayerDoingDamageMessage = FString(ArkApi::Tools::Utf8Decode(NewPlayerProtection::config["General"]["NewPlayerDoingDamageMessage"]).c_str()); (edited)
2:23 AM
is .c_str() breaking the unicode?
1:04 PM
cause your utf8 decoding it
1:05 PM
it will keep unicode
1:06 PM
Data = PermColours["Permission"]; Permission = ArkApi::Tools::Utf8Decode(Data).c_str(); Data = PermColours["Tag"]; Tag = ArkApi::Tools::Utf8Decode(Data).c_str(); Data = PermColours["ImagePath"]; ImagePath = ArkApi::Tools::Utf8Decode(Data).c_str(); (edited)
1:06 PM
example of what i do
1:07 PM
its essentially the same thing, for loading Unicode from json i had to add Utf8Decode, Utf8Encode functions to the api haha, when i came here there was no way to get Unicode from a json file (edited)
Avatar
if you want to use time/date its better to use this lib https://www.boost.org/doc/libs/1_62_0/doc/html/date_time.html
Avatar
yeah boost is cool but i dont use it in ark plugins (edited)
1:21 PM
just simply because ark does not use it as far as im aware (edited)
1:21 PM
and unreal has classes for its own stuff
Avatar
Rogue Leader 12/13/2018 2:58 PM
I'm a little confused. So my code example above should keep Unicode?
3:40 PM
how are you outputting
3:40 PM
NewPlayerDoingDamageMessage
3:40 PM
make sure to do it like this *NewPlayerDoingDamageMessage
3:41 PM
not on log though
3:41 PM
are you trying to print it to chat
3:41 PM
or what i can give you a better example
3:41 PM
or are u using FString::Format
3:42 PM
also
3:42 PM
is your config file encoding set to utf8 ?
3:42 PM
because if you dont manually set the config file to utf8 the actual file wont support it
3:43 PM
Avatar
Rogue Leader 12/13/2018 3:53 PM
3:53 PM
It looks like the file it encoded correctly
3:54 PM
the lines i posted above are the same for all strings
3:54 PM
but they are giving a error 1114 when there's a character with a ` above it
3:55 PM
And I did confirm it was the special characters themselves in the config that was causing the issue (edited)
3:56 PM
this in in my first header file: int PlayerUpdateIntervalInMins; bool AllowNewPlayersToDamageEnemyStructures; bool AllowPlayersToDisableOwnedTribeProtection; FString NPPCommandPrefix; FString NewPlayerDoingDamageMessage; FString NewPlayerStructureTakingDamageMessage; FString NewPlayerStructureTakingDamageFromUnknownTribemateMessage; FString NPPInvalidCommand; FString NewPlayerProtectionDisableSuccess; FString NotANewPlayerMessage; FString NotTribeAdminMessage; FString NPPRemainingMessage; FString AdminNoTribeExistsMessage; FString AdminTribeProtectionRemoved; FString AdminTribeNotUnderProtection; FString AdminResetTribeProtectionSuccess; FString AdminResetTribeProtectionLvlFailure; FString NPPInfoMessage; int MessageIntervalInSecs; float MessageTextSize; float MessageDisplayDelay; FLinearColor MessageColor; int MaxLevel; int HoursOfProtection; (edited)
Avatar
1 second lemme try put a unicode string in my config
3:58 PM
i just had confirmations that it was working
3:58 PM
never tried putting one there myself
3:59 PM
ÕÕÕÕÕÕÕÕÕÕÕÕ
3:59 PM
i guess that will do
Avatar
Rogue Leader 12/13/2018 3:59 PM
I was gonna paste all the methods in my dll load, but it's a lot
3:59 PM
Here's the source:
3:59 PM
Contribute to barnwellrd/New-Player-Protection development by creating an account on GitHub.
3:59 PM
If you don't mind a quick bbrowse
Avatar
mine loaded fine
4:00 PM
strange
4:00 PM
haha
Avatar
Rogue Leader 12/13/2018 4:00 PM
maybe it's in the hook or command loading
Avatar
maybe its cause
4:00 PM
im doing this
4:00 PM
Data = PermColours["Permission"]; Permission = ArkApi::Tools::Utf8Decode(Data).c_str();
4:00 PM
Data is a std::string
4:00 PM
Permission is a FString
4:01 PM
try like that
4:01 PM
maybe its the difference your looking for
4:01 PM
NewPlayerProtection::NewPlayerDoingDamageMessage = FString(ArkApi::Tools::Utf8Decode(NewPlayerProtection::config["General"]["NewPlayerDoingDamageMessage"]).c_str());
4:01 PM
to
4:01 PM
std::string Data; Data = NewPlayerProtection::config["General"]["NewPlayerDoingDamageMessage"]; NewPlayerProtection::NewPlayerDoingDamageMessage = ArkApi::Tools::Utf8Decode(Data).c_str(); (edited)
4:02 PM
thats how i do it
4:02 PM
maybe its why
Avatar
Rogue Leader 12/13/2018 4:02 PM
Would this break it where NPPCommandPrefixis initialized the same? inline void InitChatCommands() { FString cmd1 = NewPlayerProtection::NPPCommandPrefix; cmd1 = cmd1.Append("npp"); ArkApi::GetCommands().AddChatCommand(cmd1, &ChatCommand); }
4:02 PM
well nevermind
4:02 PM
there was no special character there
4:03 PM
heres a example of me loading strings
4:03 PM
my plugin loaded
4:03 PM
"CrossChatMapNameOverride":"ÕÕÕÕÕÕÕÕÕÕÕÕ",
4:04 PM
also tried it on "Tag":"ÕÕÕÕÕÕÕÕÕÕÕÕ",
4:04 PM
confirmed working
4:04 PM
12/13/18 15:04 [API][info] Loading plugins.. 12/13/18 15:04 [Advanced Chat][info] UserID(OwnProx) Hwid: B0608E6EBFE1 Authed, Loaded Advanced Chat 2.9! 12/13/18 15:04 [API][info] Loaded plugin AdvancedChat V2.9 (Setup chat colours, name colours, tags and Vip or donator) 12/13/18 15:04 [API][info] Loaded plugin Anti Flyer Carry V1.1 (Prevents flyers to pick up enemy players/dinos) 12/13/18 15:04 [API][info] Loaded plugin Ark Shop V2.4 (Shop, Currency & Kits)
4:05 PM
i think i also tried it your way at first
4:05 PM
i was the one who added support for unicode
4:05 PM
with json
4:06 PM
i think the way you do it doesnt work i think i had that issue
4:06 PM
i found out using utf8 decode supported loading unicode from the json 😃 (edited)
4:06 PM
it baffled me for awhile till i figured out we needed to decode
4:07 PM
try with 1 string as a test i guess
4:07 PM
i am curious to know the result if it is the way you do it lemme know
Avatar
Rogue Leader 12/13/2018 4:09 PM
I still get 1114 with std::string data = NewPlayerProtection::config["General"]["NewPlayerDoingDamageMessage"]; NewPlayerProtection::NewPlayerDoingDamageMessage = ArkApi::Tools::Utf8Decode(data).c_str();
4:10 PM
"NewPlayerDoingDamageMessage": "ÕÕÕÕÕÕÕÕÕÕÕÕ",
4:10 PM
those are the only changed lines
Avatar
Rogue Leader 12/13/2018 4:17 PM
i looked through the code and these are all the places I use the one variable: "NewPlayerDoingDamageMessage": "ÕÕÕÕÕÕÕÕÕÕÕÕ" FString NewPlayerDoingDamageMessage; std::string data = NewPlayerProtection::config["General"]["NewPlayerDoingDamageMessage"]; NewPlayerProtection::NewPlayerDoingDamageMessage = ArkApi::Tools::Utf8Decode(data).c_str(); ArkApi::GetApiUtils().SendNotification(player, NewPlayerProtection::MessageColor, NewPlayerProtection::MessageTextSize, NewPlayerProtection::MessageDisplayDelay, nullptr, *NewPlayerProtection::NewPlayerDoingDamageMessage);
Avatar
weird
Avatar
Rogue Leader 12/13/2018 4:19 PM
Here's the config file loading: nlohmann::json config; std::ifstream file(ArkApi::Tools::GetCurrentDir() + "/ArkApi/Plugins/NewPlayerProtection/config.json"); if (!file.is_open()) { return; } file >> NewPlayerProtection::config; file.close(); (edited)
Avatar
nlohmann::json MuteConfigData; std::ifstream file = std::ifstream(ArkApi::Tools::GetCurrentDir() + "/ArkApi/Plugins/AdvancedChat/config.json"); if (!file.is_open()) return; file >> MuteConfigData; file.close();
4:20 PM
doing the same pretty much (edited)
4:20 PM
the only difference i can see is im not using a namespace (edited)
Avatar
Rogue Leader 12/13/2018 4:25 PM
I figured out my issue
4:25 PM
when you open the file in VS2017 it changes the encoding
4:26 PM
so when i added the unicode characters there, it changed the file
4:26 PM
it changes it to ISO 8859-5
Avatar
ah i was making you a test project
4:26 PM
as we were speaking
4:27 PM
which may of got you to realise the same issue ahha
4:27 PM
4:27 PM
glad you solved it
4:27 PM
Contribute to barnwellrd/New-Player-Protection development by creating an account on GitHub.
4:27 PM
i dont think you need to add
4:27 PM
FString(
4:27 PM
infront of all of those
4:28 PM
does not really matter but for the sake of future config less typing 😃
Avatar
Rogue Leader 12/13/2018 4:28 PM
😃 Thanks! I had followed yours or Michs implementation of FStrings from another plugin (edited)
Avatar
i used to do the same haha
Avatar
Rogue Leader 12/13/2018 4:29 PM
Most of it probably came from the ArkShop on GitHub
Avatar
thats the way
4:29 PM
its how i learnt from the start reading headers / michidu's plugins
4:29 PM
/ advice from him
4:30 PM
but its mostly self explanatory once you deal with learning a few things hahaa
4:30 PM
pretty sure your already getting to the point
4:30 PM
where your needing to reference other plugins less and less
4:30 PM
because its just coming second nature 😃
4:31 PM
knowing the structures is the hard part haha
4:31 PM
spent many hours looking over them finding stuff haha
Avatar
Rogue Leader 12/13/2018 4:32 PM
I usually on reference other plugins now if I'm trying to implement something that they may have already done
4:33 PM
Like my newer Dino Passive Protection mod uses ArkHomes implementation of Kismet to get structures in a radius from the dino
Avatar
nice
Avatar
Rogue Leader 12/13/2018 4:33 PM
the older version check ALL structures on the map
Avatar
but yeah your getting better for sure
4:34 PM
i dont notice any memory leaks at a quick glace
4:34 PM
and everything seems good
4:34 PM
your doing a good job on your plugins
Avatar
Rogue Leader 12/13/2018 4:35 PM
I need to update NPP. It uses sqlite now and the easiest way I could find to keep the db from locking up is to load all the data from the db on load and use it at runtime, but then it updates all the records in the db on world save. Causes a huge issue with clusters that have thousands of players over the cluster lifetime because sqlite is having thousands of records written at the same time
4:35 PM
nice
Avatar
Rogue Leader 12/13/2018 4:35 PM
Lol no! it's a horrible implementation
Avatar
i read the first words atm
Avatar
Rogue Leader 12/13/2018 4:35 PM
It maxes out cpu usage
Avatar
the npp
4:36 PM
i guess you have to load
4:36 PM
the full db
4:36 PM
into array
Avatar
Rogue Leader 12/13/2018 4:36 PM
It's bad because I have to rewite all the records since i don't query the db suring run time
Avatar
right?
4:36 PM
to check if the player is protected when offline
Avatar
Rogue Leader 12/13/2018 4:36 PM
yea, I load it into a vector
4:36 PM
correct
Avatar
i have a idea
Avatar
Rogue Leader 12/13/2018 4:37 PM
and I need them all so it doesn't miscalculate a tribes protection
Avatar
maybe dont load everything
4:37 PM
but the people online
4:37 PM
but also have a caching system
4:37 PM
so what happens when a offline players base or something gets hit
4:37 PM
it selects from db
4:37 PM
adds to array with a delete cooldown
4:37 PM
so for the next 5 minutes it will stay in the array
4:38 PM
while getting attacked
4:38 PM
to prevent many calls to the db
4:38 PM
u can update the delete cooldown on each damage
4:38 PM
then have a check that loops the array checking the delete cooldown
4:38 PM
to unload that data from the array
4:38 PM
so when you save your server its updating less rows
4:38 PM
at the db
4:39 PM
because the array wont hold all the data
4:39 PM
about startup issue with locking
4:39 PM
i noticed this with my advanced chat plugin
4:39 PM
when it uses permissions
4:39 PM
its why i added mysql to permissions
4:39 PM
i think u can change some options with sql lites
4:39 PM
modes
4:40 PM
did you try that?
4:40 PM
have a look at permissions plugin
4:40 PM
he enables wal mode
4:40 PM
or something in config
Avatar
Rogue Leader 12/13/2018 4:40 PM
Thats a good idea. I have a lot of requests for mysql, so I'm thinking I'm just gonna run with that in the 2.0 update
4:40 PM
I'll have to look at sqlite options. I hadn't thought of that
Avatar
i did a really good implementation of sqlilite / mysql
4:40 PM
using a interface class
4:41 PM
in permissions
Avatar
Rogue Leader 12/13/2018 4:41 PM
I'll definitely be following that example then lol
Avatar
Server Plugins for ARK: Server API. Contribute to Michidu/Ark-Server-Plugins development by creating an account on GitHub.
4:41 PM
Server Plugins for ARK: Server API. Contribute to Michidu/Ark-Server-Plugins development by creating an account on GitHub.
4:41 PM
Server Plugins for ARK: Server API. Contribute to Michidu/Ark-Server-Plugins development by creating an account on GitHub.
4:41 PM
just so you dont have to if check
4:42 PM
like everywhere
4:42 PM
if your useing 1 or the other db
4:42 PM
IDatabase* database; auto connection_config = std::make_shared<mysql::connection_config>(); connection_config->host = config.value("MysqlHost", ""); connection_config->user = config.value("MysqlUser", ""); connection_config->password = config.value("MysqlPass", ""); connection_config->database = config.value("MysqlDB", ""); connection_config->port = port; connection_config->debug = false; connection_config->auto_reconnect = true; database = new MySql(connection_config); or sql lite: database = new SqlLite(config.value("DbPathOverride", "")); (edited)
4:44 PM
so that way to use sql lite or mysql
4:44 PM
u can just
4:44 PM
database ->Function
4:44 PM
and it will execute what either a sql lite or mysql one depending on what u set database =
Avatar
Rogue Leader 12/13/2018 4:52 PM
I like that implementation a lot!
4:52 PM
That will definitely make the transition a little easier
4:53 PM
I'll still have to either completely restructure how it interacts with the sqlite db or do a check for what's being used though. I'll have to think on it
4:53 PM
If I use mysql, I want it to start checking the db on an action instead of using data in a vector
4:56 PM
Hmmm... I don't really understand what this means: The WAL journaling mode uses a write-ahead log instead of a rollback journal to implement transactions. The WAL journaling mode is persistent; after being set it stays in effect across multiple database connections and after closing and reopening the database.
5:01 PM
nevermind, they have a link there: There are advantages and disadvantages to using WAL instead of a rollback journal. Advantages include: WAL is significantly faster in most scenarios. WAL provides more concurrency as readers do not block writers and a writer does not block readers. Reading and writing can proceed concurrently. Disk I/O operations tends to be more sequential using WAL. WAL uses many fewer fsync() operations and is thus less vulnerable to problems on systems where the fsync() system call is broken.
5:05 PM
So if I use WAL journaling, if I have two updates hit the database at the same time, is one blocked?
Avatar
could you give me the code you use for structure detection
5:09 PM
want to make byebyecorrupted detect if corrupted dinos are near an orbital drop
5:09 PM
then disable the structure protection if they are
Avatar
Rogue Leader 12/13/2018 5:14 PM
//check for enemy structures nearby UWorld* world = ArkApi::GetApiUtils().GetWorld(); TArray<AActor*> new_actors; TArray<AActor*> actors_ignore; TArray<TEnumAsByte<enum EObjectTypeQuery>> types; UKismetSystemLibrary::SphereOverlapActors_NEW(world, _this->RootComponentField()->RelativeLocationField(), static_cast<float>((DinoPassiveProtection::MinimumEnemyStructureDistanceInFoundations * 300)), &types, APrimalStructure::GetPrivateStaticClass(), &actors_ignore, &new_actors); for (const auto& actor : new_actors) { APrimalStructure* structure = static_cast<APrimalStructure*>(actor); //Log::GetLog()->warn(FVector::Distance(_this->RootComponentField()->RelativeLocationField(), actor->RootComponentField()->RelativeLocationField())); if (structure->TargetingTeamField() != _this->TargetingTeamField()) { isNotNearEnemyStructures = false; break; } else { isNotNearEnemyStructures = true; } } (edited)
Avatar
isNotNearEnemyStructures is an arkapi function ?
Avatar
Rogue Leader 12/13/2018 5:15 PM
Contribute to barnwellrd/Dino-Passive-Protection development by creating an account on GitHub.
5:15 PM
no, that's just a bool in my code
5:16 PM
I got it from ArkHomes, but idr where
Avatar
whoops
Avatar
Rogue Leader 12/13/2018 5:16 PM
Server Plugins for ARK: Server API. Contribute to Michidu/Ark-Server-Plugins development by creating an account on GitHub.
5:17 PM
Server Plugins for ARK: Server API. Contribute to Michidu/Ark-Server-Plugins development by creating an account on GitHub.
5:17 PM
There's two implementations from @Michidu from ArkHomes and PersonalOwnership (edited)
Avatar
UWorld* world = ArkApi::GetApiUtils().GetWorld(); TArray<AActor*> new_actors; TArray<AActor*> actors_ignore; TArray<TEnumAsByte<enum EObjectTypeQuery>> types; UKismetSystemLibrary::SphereOverlapActors_NEW(world, ArkApi::IApiUtils::GetPosition(player_controller), static_cast<float>(radius), &types, APrimalStructure::GetPrivateStaticClass(), &actors_ignore, &new_actors); for (const auto& actor : new_actors) { APrimalStructure* structure = static_cast<APrimalStructure*>(actor); if (structure->TargetingTeamField() != player_controller->TargetingTeamField()) return true; } return false; (edited)
5:26 PM
hmm this should do i guess
5:26 PM
except how would i read the structure name ?
Avatar
If it's the Hook_APrimalStructure_TakeDamage you are using FString damagedStructureDescription; _this->GetHumanReadableName(&damagedStructureDescription); You can then use StartsWith or Contains on it to see if it's a corrupted dino. That's how I did it.
Avatar
i know i have the check working
7:01 PM
i just want to make it so it does not prevent damage if the dino is near an orbital drop
Avatar
Rogue Leader 12/13/2018 7:11 PM
You can just check if a structure is within a certain radius of a drop when hit, and if it's too close to a drop, allow regular damage. (edited)
7:11 PM
Instead of checking for corrupted
7:13 PM
Pseudo code: Get all structures in radius of attacked structure If drop is in that list Return normal damage
Avatar
WoolyPenguin 12/14/2018 4:21 PM
I'm having an issue locating the Dino's base stats. i've managed to get original stats when tamed. (before it's been leveled) But i'm trying to find the basestats shown in Tobias' plugin with /mydinostats. (Improved Commands plugin) Does anyone have an idea where the absolute base stat variable is? (edited)
Avatar
@WoolyPenguin check in #【🤹】ʀᴇꜰᴇʀᴇɴᴄᴇꜱ might get more stats from there
Avatar
WoolyPenguin 12/14/2018 5:03 PM
i found out the plugin improved commands is open source
5:03 PM
so i've wasted maany hours to figure it out on my own xD
5:04 PM
the basestat i already found is just divided by level points applied when tamed
5:04 PM
not the points u put in ur self
5:04 PM
i just never found the variable containing base level points applied
Avatar
@OwnProx your mute plugin works with playername ?
Avatar
yes
Avatar
well atm some playeres are muted but they have not speak
3:12 PM
strange
3:13 PM
nvm just sentance which are muted does not display
3:16 PM
but seems mreload command oes not work, i have updated json but black list is not updated
3:16 PM
Avatar
are you trying to reload it from rcon ?
Avatar
rcon or ingame
3:17 PM
same stuff
Avatar
no sometimes plugins only support in game console
6:44 AM
rcon != ingame console
Avatar
So how does the Mute plugin work if a player is named "Human", but there's 10 Humans on the map?
Avatar
no idea tbh
Avatar
I think it works with steamid @Kamio
Avatar
mute <Mins> <Hours> <CharacterName> - Mute a Character for a certain amount of minutes and hours ipban <Mins> <Hours> <CharacterName> - IP Ban a Character for a certain amount of minutes and hours and also kicks them from the server unmute <CharacterName> - UnMute a Character ipunban <CharacterName> - IP UnBan a Character clearall - UnMute &IP UnBan Everybody mreload - Reload Config
Avatar
Features: Mute Steam id or ip from global chat
Avatar
is quest plugin public?
Avatar
GSH | MrOwlSky 12/20/2018 2:24 PM
Not currently @Omni
Avatar
WoolyPenguin 12/23/2018 5:21 PM
Anyone familiar with doing http post requests using ArkApi::Request ? Can't seem to get it to successfully execute. FString PostUrl = "127.0.0.1/test.php"; FString type = "POST"; FString Content = "name=test"; if (ArkApi::Requests::Get().CreateRequest(PostUrl, type, &HttpPostReturnFunc, Content, true)) Log::GetLog()->info("Request success"); else Log::GetLog()->info("Request fail");
Avatar
WoolyPenguin 12/23/2018 6:44 PM
well. the solution was too simple... 😃 Changing FString PostUrl = "127.0.0.1/test.php"; to FString PostUrl = "http://127.0.0.1/test.php"; makes it work 😃 (edited)
Avatar
if (DamageCauser) { FString descr; DamageCauser->GetHumanReadableName(&descr); Log::GetLog()->info(descr.ToString()); if (descr.Contains(L"Turret")) { return 0; } }
11:59 AM
having trouble getting this to work
11:59 AM
it does not detect it in the logs either
11:59 AM
(want to prevent a turret from breaking structures)
Avatar
hmm looks like moving that code up in the plugin fixed the issue
Avatar
Mustacila 🐢 1/19/2019 2:46 PM
Heyy people, I'm trying to fix this issue but making slow progress so far, I made this plugin which loads just fine but as soon as I build it with any kind of Ark API it just crashes when loaded with error code 1114...I'm out of ideas atm so open for suggestions if any
Avatar
you mean you made a plugin without ark api? 😃
Avatar
Mustacila 🐢 1/19/2019 2:48 PM
yeah..
Avatar
so how your code looks?
Avatar
Mustacila 🐢 1/19/2019 2:50 PM
void Load() { std::cout << "Loaded a plugin"; } void Unload() { std::cout << "Unloaded the plugin"; } BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: Load(); break; case DLL_PROCESS_DETACH: Unload(); break; } return TRUE; } like this
2:50 PM
all that's left from the debugging process
Avatar
and when it stops working?
Avatar
Mustacila 🐢 1/19/2019 2:52 PM
this one works fine and loads
2:53 PM
but as soon as I add anything from Ark
2:53 PM
it doesn't load anymore
2:53 PM
at server startup
Avatar
example?
Avatar
Mustacila 🐢 1/19/2019 2:54 PM
Also tested other plugins and they load well
2:55 PM
something like ArkApi::GetCommands().AddChatCommand("/newcommand", &Function);
Avatar
that should be fine, are you sure you use latest lib/headers?
Avatar
Mustacila 🐢 1/19/2019 2:57 PM
I got the libs from your repos , could it be the header files then ?
Avatar
could you share whole project?
Avatar
Mustacila 🐢 1/19/2019 3:02 PM
sure, wait a bit
Avatar
Mustacila 🐢 1/19/2019 3:37 PM
But I don't think it's because of the includes
Avatar
Is there a way to get a classId of an controller? For example Iceworm_Queen_Character_BP_C from an AController. GetFullName returns the name of the AI controller
Avatar
why do you need the full name ?
10:22 AM
might be a better way to do what you're doing
Avatar
I want to hook AShooterGameMode.Killed to monitor boss kills, counting them for a player and saving the last kill time to display a timer of next respawn on my website.
10:24 AM
I think I already can get the playerid, the steamid and the name of the player who killed the queen, but can't get much information about the killed actor
10:24 AM
Also not sure about multiple players there, guess it will just take the last hit on the boss
Avatar
FString NPCClassString;
10:26 AM
maybe this will help ?
10:26 AM
you can open the Actor.h file in the API and search through the functions
Avatar
that's just a property of FNPCSpawnLimit, I can't find the connection of AController to it
Avatar
there is IsBoss also
Avatar
Hm, the IsBoss would help, so I don't have to create a whitelist of dinos to check, but still missing the name of the dino
Avatar
look at extended rcon ListDinos
Avatar
not sure if this works APrimalDinoCharacter* dino = static_cast<APrimalDinoCharacter*>(KilledPlayer->CharacterField()); (edited)
10:49 AM
But if it works, it should be the way to go. Thank you very much.
10:51 AM
not that familiar with c /c++ :/ Can I do some kind of typecheck like if (KilledPlayer->CharacterField() is APrimalDinoCharacter) {
Avatar
&&
10:53 AM
if (KilledPlayer->CharacterField() && (IsAAPrimalDinoCharacter::GetPrivateStaticClass()) (edited)
Avatar
if (KilledPlayer->CharacterField() && character->IsA(APrimalDinoCharacter::GetPrivateStaticClass()) (edited)
10:54 AM
although i declare character as ACharacter* character = EventInstigator->CharacterField();
Avatar
I've just created a simple command for a server I co-run where the other admin requested a way to get a player's IP. However the result of the following code just seems to return a SteamID. Is this normal or am I missing something? This is my first attempt at this stuff too, so probably me. ArkApi::GetApiUtils().GetIPAddress(player);
Avatar
i think it has been mentioned before that GetIPAddress was bugged and would return a steam id
Avatar
Ah, thanks. Any idea of any other way, or just hope there's a fix found? Not super important honestly.
Avatar
maybe take a look at the source code of Mutes & Blacklist plugin
Avatar
That's actually where I had been looking initially. Didn't see anything outside of that, but I haven't fully explored it yet.
Avatar
Would it be possible to modify theCenter's fog with ark api? I would be more than happy to do it if so... where would I look to see if it is possible. (edited)
Avatar
I had looked for a way to modify the current weather, but I didn't end up finding anything at the time. Lots of things are handled within the player's game rather than the server, so some of the more visual things are hard/not possible to modify from the server alone
Avatar
Hmm okay, I'll keep looking
Avatar
Timed Rewards is so picky it seems like
Avatar
well to be more precise, passing params to that damn callback
Avatar
Rogue Leader 3/18/2019 12:30 PM
Anyone else getting this crash after the new update?
12:31 PM
Looks like it's crashing sending player messages. I'm using the latest headers from the Git repo
12:31 PM
Only change I've made other than replacing StaticClass()
Avatar
Rogue Leader 3/18/2019 2:26 PM
@Michidu @OwnProx
Avatar
Rogue Leader 3/18/2019 2:44 PM
When checking if an attacker is a player to send messages to I've been using if (EventInstigator && EventInstigator->IsA(APlayerController::StaticClass())) (edited)
2:44 PM
With the update I'm using: if (EventInstigator && EventInstigator->IsA(APlayerController::GetPrivateStaticClass()))
2:45 PM
Is it possible that using ::GetPrivateStaticClass() is causing messages to be sent to dinos now?
2:51 PM
I had someone report an empty server crashing to it
Avatar
yeah its always casted to a dino
3:35 PM
or so @WoolyPenguin says
Avatar
shop uses notifications and it works fine
3:40 PM
try ashooterplayercontroller instead
Avatar
Rogue Leader 3/18/2019 3:48 PM
Weird that it's never caused a crash before. I'll update to AShooterPlayerController.
Avatar
yeah i also send notifications in my plugin with GetPrivateStaticClass() and I've had no issues also 😄 (edited)
Avatar
Rogue Leader 3/18/2019 3:55 PM
Do you do it in functions like take damage where a dino has to be filtered out?
Avatar
yes
4:40 PM
i hooked AprimalCharacterTakeDamage
4:41 PM
and i check if attacker is a player
4:41 PM
and it works without problems
Avatar
Rogue Leader 3/18/2019 5:30 PM
@WETBATMAN You check if they are a AShooterPlayerController?
Avatar
APlayerController
Avatar
Rogue Leader 3/18/2019 6:01 PM
@Michidu will you scan through my source and see if you can understand why it's crashing when sending notifications?
6:04 PM
Contribute to barnwellrd/New-Player-Protection development by creating an account on GitHub.
Avatar
if (EventInstigator != nullptr && EventInstigator->IsA(APlayerController::GetPrivateStaticClass()) && EventInstigator && EventInstigator->CharacterField())
6:04 PM
try to use APlayerController
6:05 PM
this one works for me because i tested it and it sends notifications
Avatar
Rogue Leader 3/18/2019 6:05 PM
that's what's crashing now
Avatar
oh
6:07 PM
is there anything else relevant on that line ?
Avatar
Rogue Leader 3/18/2019 6:39 PM
It's not actually crashing in my dll, it's crashing in the Ark code when it gets the data from the API for sending a notification
6:40 PM
lines 31, 42, and 67 are where I call notifications in my take damage hook
Avatar
Rogue Leader 3/18/2019 7:07 PM
Just confirmed that ->IsA(APlayerController::GetPrivateStaticClass()) is no longer enough to filter dinos from players
7:08 PM
replacing with ->IsA(AShooterPlayerController::GetPrivateStaticClass()) works
Avatar
Has anyone had an this issue with controllers before?
2:09 AM
2:10 AM
I've used it this way in the past, I assume AShooterPlayerController is a child of AController
Avatar
it should compile though
Avatar
It was my fault, I had a lingering API/Atlas/Atlas.h include hanging around 😆
Avatar
Looking at that latest plugin request has me wondering which function handles drawing player nameplates. Anyone know?
5:54 PM
Or even if there is a reference or actual Ark/Atlas source I can poke around in would be great. That'd make a great little plugin for configurable nameplate dist
Avatar
most likely the function you're looking for is in the Actor.h file
6:08 PM
you can find it in the api
Avatar
awesome, thanks much!
Avatar
as far as i know, server does not process any gui drawings (only a few exceptions)
Avatar
Hm. I see ClientAddFloatingText but if that were it I dont see how I could override it to extend range, as I dont know where it is called in Ark
6:39 PM
It was so bad when I was playing Atlas, I think it is shorter, So much friendly fire
Avatar
i think they use it to display dmg value, so this one might work actually let me know if you try to call it
Avatar
I will test it out a bit tonight after work and let you know!
👌 1
6:46 PM
It does seem like at the very least it could be used to create an alternative floating text, then could play with the range so that it only shows when the stock one is out of range
Avatar
would be nice, but arguments look a bit weird like it's gonna be drawn in 3d world
Avatar
sounds like i need to open the devkit and take a look. it may be that each player has a UTextBlock attached that is shown or hidden
Avatar
probably need to call this one: AShooterPlayerController::ClientAddFloatingText
Avatar
Also testing this sounds hard on 1 pc... is it possible to create a dummy player on a server?
6:56 PM
Yeah I am thinking that's the one
Avatar
you can run 2 copies of ark with sandboxie
6:56 PM
assuming your pc can handle that
Avatar
just disable BE 😃
Avatar
yeah that 😄
Avatar
APrimalCharacter::DrawFloatingHUD might have some value as well
6:59 PM
yeah, i think my pc could handle it
Avatar
not all functions in server even used, last time i checked AShooterHUD was always 0
7:02 PM
Thinking about it now, It is accessed by some mods, the "spyglass +" type mods come to mind
Avatar
what are you trying to achieve though
Avatar
mods work on client side
Avatar
trying to fulfill the request posted on ArkServerAPI ?
Avatar
@WETBATMAN recent plugin request for KOTH + floating names render range... i think the floating names would make a great small plugin. I know it would really help in Atlas
7:02 PM
@Michidu ugh, true.
Avatar
possibly they took client version to write server and that why some client references still here 😄
Avatar
@Michidu Given their track record I would not be surprised 😆
7:05 PM
Actually talking with a friend making a small game... he has it set that it creates a dedicated instance when he starts the game (w/in the client) and wanted to make a dedicated process... I told him to just run a client w/o a player
7:06 PM
That's probably exactly why all those are there... Worth trying but its likely it would only "render" for the server instance
Avatar
probably most gui functions on server are never called
Avatar
what if we had a client side mod for such applications 😄
7:09 PM
can a mod extension be developed for the API ? (edited)
Avatar
That would be amazing... I have thought about some kind of mod/api integration for a while but it's probably above my level of understanding lol
Avatar
i never opened the devkit lol
Avatar
it's actually possible, but there are not many mod devs
Avatar
Always wanted to hook WBUI in to arkshop... closest thing right now is the new JSON format
Avatar
a few people already wrote a nice gui for shop (edited)
Avatar
someone actually made a custom UI
7:11 PM
posted here
7:11 PM
that interacts with a shop with GET and POST requests
Avatar
I believe I saw that... german server, few months ago?
7:11 PM
that is really smart actually
7:12 PM
All I have ever done in the modkit is a bit of world design, but I should look more at the back-end stuff
Avatar
that is pretty cool 😄
Avatar
What's the best way to get something like that to run a function in the plugin?
7:13 PM
I love that UI, and how seamless it looks with the game UI
Avatar
you could probably get points from mysql
Avatar
you can communicate with mod/plugin via cheat commands
Avatar
as for exec you can do it via RCON maybe ?
7:15 PM
how does one execute a cheat command in the api btw
Avatar
ConsoleCommand
Avatar
it takes the command as the argument ?
Avatar
cool
Avatar
Hmm, does the shop have a console cmd to run the buy function for a player? or maybe have to add that yourself and recompile
Avatar
not right now but it's easy to add
Avatar
like playerbuyitem steamid itemid amount
7:17 PM
oh ive got the gears turning now
7:18 PM
mods can also register their own commands, so it probably the easiest way for communication
Avatar
I want to try it. The thought of blueprints gives me nightmares though 😆
Avatar
not sure if you can add items to gui on the fly
Avatar
Oh yikes, having to hard code all that, I change my shop all the time lol
7:30 PM
It would have to read the config unless you generated an accompanying json to feed the ui - WBUI has a read UI data from web json file option but id imagine its complex given how long it took him to implement it
Avatar
it also has an ingame edit option but yeah
7:31 PM
that would be a pain on multiple servers lol
Avatar
Yea, what im saying is when you generate your config.json (i use a sheet bc my shop has like 200 items) you could just generate a uiconfig.json or something that you can feed to your ui
7:37 PM
i used to manage my shops separately (boss kits were the big reason) but it was such a pain I just added a disclaimer to buy the boss kits on the proper server lol
7:40 PM
I'll probably clean up my shop config tool and put it up on the forum at some point, plan to do the same kind of tool for my lootboxes plugins
Avatar
that should help to a lot of people
Avatar
yeah lol
7:40 PM
considering some people here event went as far to pay others for their config
7:40 PM
lmao
Avatar
I know, i was tempted to take those offers and use my config but that felt too easy haha
7:41 PM
my tool*
7:41 PM
its nothing special, straight string concatenation, didnt bother with the built in JSON parsing
7:44 PM
But would be nice to be able to input an existing config and have it populate
Avatar
Question, if I enter a console command, am I automatically the "sender", if so is this also the case if I were to buy a console cmd from Ark/AtlasShop?
Avatar
yeah you’re the sender as far as i know
Avatar
You are 😃 I realized I could just check ArkShop lol
Avatar
Does anyone know the first possible entry point for a AShooterCharacter (even for character creation)? Already tried a few functions but none of them worked.
Avatar
Constructor :)
Avatar
How can I hook the constructor? o.O
Avatar
Actually the same way as any other function
Avatar
Thanks, will try that 😃
Avatar
Yes that worked. But now i'm not able to get the right steamId anymore... 😅 Looks like they get assigned later. -_-
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 3/22/2019 5:41 PM
SteamID should be obtainable by Controller only not Character
Avatar
Will try to hook to the Controller and hope he got called right :)
Avatar
Hey, I've got a bit of april fools question would it be possible to make everyone's tames render as dodos?
Avatar
That's likely mod territory
1:51 AM
Without actually replacing them with dodos, it's probably not possible
Avatar
that's actually a cool prank 😛
Avatar
Medicalmischief 3/25/2019 9:21 AM
Might be easier to change all the dino spawns to dodo's, but then.... no one would have anything to tame haha
Avatar
sounds like a better idea 😃
Avatar
hi there So , I have created my first plugin in as a test, using the example code from the site I can compile and Load the plugin successfully(or at least that is what the server reports in chat) but when i try to use the command /test no response I checked the log files as well and dont see anything
Avatar
code?
Avatar
#include "stdafx.h" #include "API\ARK\Ark.h" #pragma comment(lib, "ArkApi.lib") void TestCMD(AShooterPlayerController* shooter_controller, FString* message, int mode) { if (!shooter_controller->PlayerStateField()) return; Log::GetLog()->warn("Test Chat Command Called: {}", message->ToString()); ArkApi::GetApiUtils().SendServerMessage(shooter_controller, FColorList::Pink, L"{}, you tried the test command", *ArkApi::GetApiUtils().GetCharacterName(shooter_controller)); } void Load() { Log::Get().Init("Test Plugin"); ArkApi::GetCommands().AddChatCommand("/test", &TestCMD); } void Unload() { ArkApi::GetCommands().RemoveChatCommand("/test"); } BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: Load(); break; case DLL_PROCESS_DETACH: Unload(); break; } return TRUE; }
Avatar
seems good actually, you test in chat?
Avatar
in chat I used /test
9:24 AM
it didnt do anything, so I thought to try console.........nothing
Avatar
try to print something in Load function
Avatar
to the console ?
Avatar
ok.....well
9:42 AM
for some reason it seems to work now
9:42 AM
maybe i just messed up when compiling
Avatar
good 😃
9:42 AM
make sure you use release mode also
9:42 AM
what i the correct syntax for writing to console (edited)
Avatar
Log::GetLog()->info()
Avatar
this is what i stuck in the load
9:44 AM
void Load() { Log::Get().Init("ProjectCCC"); Log::GetLog()->debug("Testing 123, please load the project for me ;)"); ArkApi::GetApiUtils().SendServerMessageToAll(FColorList::Green, L"Test Message: {}", L"Test arg"); ArkApi::GetCommands().AddChatCommand("/test", &TestCMD); }
Avatar
you cant use SendServerMessageToAll in Load()
9:45 AM
game is not loaded at that state yet
Avatar
ok so thats why it doesnt work
9:45 AM
Log::GetLog()->debug("Testing 123, please load the project for me ;)");
9:45 AM
that one didnt do anything either
Avatar
try info
9:46 AM
thank you very much for your help and patience
9:46 AM
much appreciated
9:47 AM
ill give it play.....and see where the road takes me 😉
Avatar
if I want to find an item crafted by someone.......is there an existing function for that, or will I have to modify the api
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 3/26/2019 10:22 AM
find a crafted Item on whole map? o.o
10:22 AM
like search all inventories
10:22 AM
....for item crafted by
10:24 AM
only certain items have a crafted by field(if i can call it that for arguement sake) (edited)
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 3/26/2019 10:24 AM
You'll need to check UPrimalItem::CrafterCharacterNameField For each item in each inventory.. no matter if its of a structure / player 😄
Avatar
Know anyone whether server hold in memory offline players? I want to get all player's steam IDs, tribe IDs and CharacterLevel at once server is loaded. Is it possible? 😃
Avatar
Rogue Leader 3/27/2019 1:14 PM
Npp uses a database and structs with the timer to keep all that info in a database and update online players
1:15 PM
But I don't think you can access an offline players data directly through the api
Avatar
it's actually possible with some effort, server loads all players data on startup and then unloads it but you can find array with player/steam id of all players easily
Avatar
My problem is a start server with my plugin first time. I need to determine protection time of existing tribes and players. I can determine protection time when players logged in - its no problem. But I need know tribes about
1:24 PM
@Michidu is it possible by UGameplayStatistics?
Avatar
if i remember correctly, AShooterGameMode.SteamIds has ids of all players
Avatar
I see many methods like GetTribeIDsField and so forth but I not sure that return values will be contain all info and will be correct. Will test it, thanks all
Avatar
Is there any good reference for any of the logic inside of the native functions aside from the function names/args in the API itself?
2:59 PM
Not sure if maybe I can see some of the logic w/in the devkit or something
Avatar
Rogue Leader 3/27/2019 4:13 PM
You can load up the server.exe and .pdb with IDA Pro and follow the logic through the functions
Avatar
I like the way you think
4:25 PM
TY for the info!
Avatar
Ich habe da eine Plugin Idee^^ Wenn das jemand Umsetzten würde wäre Super 😃 Wie wäre es mit einem Plugin wo Admins zb /killwilddino machen und dann ein Counter von zum Beispiel 15 Minuten startet der dann für alle Sichtbar (Chat,Broadcast oder eine Info oben vom Plugin) ist und der dann danach alle Dinos killt und danach noch Save World macht^^ Ich würde das echt Praktisch finden 😃 Dann müsste man nicht immer fragen ob jemand was gegen einen Wild Dino Kill hat^^ I have a plugin idea ^^ If someone would implement that would be super 😃 How about a plugin where admins do eg / killwilddino and then start a counter of for example 15 minutes which is then visible to everyone (chat, broadcast or info above the plugin) and then kill all dinosaurs afterwards and then save World makes ^ ^ I would find that really practical 😃 Then you would not always ask if someone has something against a Wild Dino Kill ^ ^ (edited)
Avatar
You can still do the same already using an rcon script?
Avatar
RCON script ... Interesting ... but the disadvantage is that it is an extra program ... it would be better to have it as a plugin ...
Avatar
Ark has it to where you can do this as a built in system
8:31 PM
On serverrestarts. You can also configure admin permissions to do this.
8:31 PM
/cheat destroywilddinos
Avatar
I want that there is an early warning like a server restart before all wild dinos are killed (edited)
Avatar
If you want admins to do that then have the admins broadcast. Making a plugin would use more ram use. It is possible
Avatar
RAM is not a problem ^^ I just want it so the admins a Wild Dino kill with for example / killDino can do so then a 15 minute warning goes out all players and only then the dinos are removed
Avatar
Rogue Leader 3/29/2019 12:04 AM
Add a command that players can cancel it too. Then if someone is in the middle of a tame they can cancel it. But have it where it can't be deferred for more than 30 minutes or so
Avatar
That would be a good idea ^^ Now we need only someone who "can" the implementation 😄 (edited)
Avatar
Rogue Leader 3/29/2019 1:33 AM
Should be an easy job to learn on. Two commands and a timer
Avatar
well I can not xD
Avatar
It's never that easy 🙂
1:39 AM
Especially since running a wild dino wipe command on one of my servers can lag enough wiping the 5 digits worth of dinos that it can trigger ARK's hang detection thing lol
Avatar
The plugin would only have to kill, but warn the players beforehand ^^
Avatar
Is the goal to have that run on a schedule (e.g. daily) or just on demand? (edited)
Avatar
best even both ^^ (You could do so in the config that either uses a command or uses a timer ...) but mainly by command and then with an announcement of, for example, 15 minutes😄 (edited)
Avatar
Anyone even bothering with working on anything for Atlas at the moment? Game is so dead 😢
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 3/29/2019 3:51 PM
Gonna port over my AutoDecay soon.. but I agree.. Its starving slowly
Avatar
It's sad ... I bought way too much server hardware lol. But it had such potential, I played a ton the first month of officials
3:52 PM
So now I am probably just going to run a dedi for everyyyything
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 3/29/2019 3:52 PM
I didn't bought some hardware for it.. but I also played official hehe
Avatar
US or EU?
3:52 PM
I was on PVP US
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 3/29/2019 3:53 PM
Iam from Germany - US doesn't felt very well to play 😄
Avatar
I see - I had heard that the US server was hosted in EU to accomodate chinese players. Battlemetrics did show the location as DE or FR I believe
3:57 PM
Regardless, yes, official was a blast, i made a ton of friends in a short time and we had some really epic times... but after so long you end up in the same "ark megatribe" mentality and it loses its fun factor
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 3/29/2019 3:58 PM
Jup.. totally agree with you
Avatar
I hope the new wipe brings people back, I think the future will definitely lie with Unofficial in the long run. So monetization will be exponentially more necessary than in Ark
Avatar
If you look at player counts for ARK they spike during every update, drain slowly, and jump again the next update. With the impending official wipe for Atlas, I would say wait and see what happens after this next major patch. Eventually, I'm guessing it will act like ARK and the population will rise and fall with new content.
4:35 PM
Either way, announcing an impending wipe months before it happens is a great way to drive everyone away
Avatar
Yeah, it's no surprise it's dead. I almost wonder if thats what they wanted, some peace and quiet to actually fix the issues w/ the game
4:42 PM
^ That's Atlas. Here's ARK for comparison:
Avatar
Yeah its really bad right now lol. Ark is steady around the #13 spot.... Atlas is in the 200s
Avatar
I think there are more servers online for Atlas than there are players right now lol
4:50 PM
There's 1,600 people online at the moment
Avatar
Rogue Leader 3/29/2019 4:54 PM
Being a reskin of Ark was a big turnoff for me.
Avatar
the way they handled it was awful 😄
4:56 PM
did you guys see the video where they found an ark single player menu in atlas 😄
Avatar
Yeah...
Avatar
Though it may not be different enough, the things they re-used were smart in my opinion. Why spend time re-making the UI and assets that can be shared when you can spend time making the game?
4:58 PM
At the very least, having it a different game lets them go a completely different direction with it if they want.
Avatar
that's not the issue 😄
4:59 PM
when they delayed the game multiple times they already knew it would be met with criticism
4:59 PM
and yet they managed to leave an ark menu in there which attracted a lot of negative feedback
Avatar
Honestly, though. Grapeshot was split off of the pool of people from WC, so though you can be optimistic, WC isn't exactly known to meet deadlines lol
5:04 PM
I guess for that reason my expectations were very low at launch, so it wasn't as easy to be disappointed.
Avatar
Medicalmischief 3/29/2019 5:05 PM
Too bad you can't see more in depth stats on ark, like official and unofficial players and which maps are most populated
Avatar
I did start making something to collect that kind of data, but lost interest along the way.
5:07 PM
A few of the server lists (some discover unregistered servers as well) also have some graphs/pie charts that are interesting (edited)
Avatar
GSH | MrOwlSky 3/29/2019 5:13 PM
The fact they told everyone its wiping and the amount of bugs atlas has killed populations for now. Should get back up after they wipe but P.R for this game is a disaster.
Avatar
I really enjoyed the game. I think if they manage it with half a brain it will be a decent game.... Up in the air if they are capable of that though.
Avatar
Medicalmischief 3/29/2019 5:17 PM
How is the meshing on there?
Avatar
Unrelated, but can anyone explain the difference between AShooterGameMode::HandleNewPlayer and AShooterGameMode::HandleNewPlayer_Implementation
5:18 PM
@Medicalmischief I didn't notice much meshing going on other than a couple of people putting raft beds in rocks as usual lol
Avatar
GSH | MrOwlSky 3/29/2019 5:19 PM
Yep. Meshing is a thing and worst then ark.
Avatar
😮 dang
5:19 PM
Go figure though
Avatar
Rogue Leader 3/29/2019 5:59 PM
@Zachar543 it is the same game as ark, just different models. Even the APIs are nearly the same. They literally just took ark and removed dinos and replaced them with boats.
6:00 PM
It's just a modded version of ark sold as a seperate game
6:00 PM
Made by wildcard 2.0
6:00 PM
Grapeshot IS wildcard
6:01 PM
Owned by the same company and the same leads as old WC
Avatar
Definitely not the first time I've heard that argument, and I can see that side of it, but I don't think the "it's modded ARK" part is entirely fair. From a financial and time standpoint, re-using as much of the base code and assets as possible allows you to get to making the game rather than spending tons of time on the base again. They definitely could have spent more time making it seem like a different game, but since the base/engine is a huge investment that has to be refined over time, game studios do this all the time. They just normally do a better job of hiding what they re-used.
6:12 PM
We'll see if Grapeshot takes advantage of this, but the split to another game lets them have freedom to go a completely different direction than ARK.
Avatar
Medicalmischief 3/29/2019 6:19 PM
I'd love to see the boats and ocean in ark, and the way the maps and clusters work is cool too
Avatar
Honestly, I would like to see some of the building mechanic differences get pulled into ARK, but I'm guessing that won't happen any time soon if ever
Avatar
Medicalmischief 3/29/2019 6:21 PM
I like the building blueprints also
6:22 PM
It's a cool game, just has a lot of work that needs done
6:25 PM
Orion did great on the building thou, although some things should cost less like half walls but meh
Avatar
@Rogue Leader Don't get me wrong, I have many major gripes with Atlas. The argument that it should have been an ARK mod just gets to me far more than it should. Not saying this is the case for you, but it seemed like one person said that 10 minutes post launch, and tons of people accepted that as their opinion without spending any time figuring it out on their own. (edited)
Avatar
Not sure why they didn't do PTRs in the past. Seems like it fits WC's tendency to "let the players test it live": https://steamcommunity.com/games/834910/announcements/detail/1803035565199804066
Ahoy Pathfinders! This will be a rather compact Captain’s Log focused around updating you all on our progress as we work towards the upcoming megapatch -- which we’re going to designate “ATLAS 1.5” so that we don’t have to keep calling it megapatch! It will include ...
Avatar
Deleted User 3/30/2019 7:25 AM
does anyone know if it is safe to update the arkshop database manually rather than via rcon ?
Avatar
yes if you know what you are doing
Avatar
Deleted User 3/30/2019 7:35 AM
awesome, thank you.
7:36 AM
I'm editing it via discord bot through nodejs and wasn't sure if there were any other checks to verify the data that would mess things up in game or not.
Avatar
no, it doesn't cache anything also
Avatar
uh ok, totally unexpected Just crashed my server
8:55 PM
Fatal error! VERSION: 294.108 ProjectCCC.dll!FString::ToString() (0x00007ffae47d6d4a) + 0 bytes [d:\ark-server-api-master\version\core\public\api\ue\containers\fstring.h:1612] ProjectCCC.dll!Hook_UPrimalInventoryComponent_AddItem() (0x00007ffae47d72a4) + 29 bytes [c:\users\dfouc\source\repos\projectccc\projectccc\projectccc.cpp:58] ShooterGameServer.exe!UPrimalInventoryComponent::GiveInitialItems() (0x00007ff750522ffb) + 64 bytes [f:\build\trunk\projects\shootergame\source\shootergame\private\primalinventorycomponent.cpp:1362] ShooterGameServer.exe!UPrimalInventoryComponent::InitializeInventory() (0x00007ff750523e8c) + 0 bytes [f:\build\trunk\projects\shootergame\source\shootergame\private\primalinventorycomponent.cpp:1535] ShooterGameServer.exe!APrimalStructureItemContainer::BeginPlay() (0x00007ff7505e92eb) + 0 bytes [f:\build\trunk\projects\shootergame\source\shootergame\private\primalstructureitemcontainer.cpp:330] ShooterGameServer.exe!APrimalStructureItemContainer_SupplyCrate::BeginPlay() (0x00007ff7505fff87) + 0 bytes
8:55 PM
Right after the successfully loaded plugin message
8:59 PM
how would I rather unload a plugin than crash the server when there is an error
Avatar
what do you mean by that 😄
Avatar
if shit fails, rather unload the plugin, instead of it crashing the server
Avatar
return false in dllmain (edited)
9:01 PM
although i don't think if anything goes wrong it can unload itself at that point 😄
Avatar
argh dammit, C++ is so full of shit
9:04 PM
😆
Avatar
c:\users\dfouc\source\repos\projectccc\projectccc\projectccc.cpp:58
9:04 PM
check line 58 in your project
9:05 PM
might be of some help as to what is causing the crash
Avatar
Log::GetLog()->warn("Inventory Hook Running for player : {}", OwnerPlayer->PlayerNameField().ToString());
Avatar
do you init your plugin when you load it ?
9:05 PM
Log::Get().Init("NoAnunnaki");
9:06 PM
do you have something like that in the load function
Avatar
Log::Get().Init("ProjectCCC"); Log::GetLog()->info("Loading the project ............"); //Load Commands ArkApi::GetCommands().AddChatCommand("/test", &TestCMD); //Load Hooks //ArkApi::GetHooks().SetHook("APrimalCharacter.ServerUploadCharacter", &Hook_APrimalCharacter_ServerUploadCharacter, &APrimalCharacter_ServerUploadCharacter_original); ArkApi::GetHooks().SetHook("UPrimalInventoryComponent.AddItem", &Hook_UPrimalInventoryComponent_AddItem, &UPrimalInventoryComponent_AddItem_original);
9:08 PM
the commands was working fine until I added in a hook
Avatar
so after adding the hook it crashed on startup ?
Avatar
it said plugin successfully loaded, then crashed then restarted the server , same thing
Avatar
hmm weird
9:11 PM
maybe that hooks requires an additional PDBjson file ?
Avatar
how would I know that ?
Avatar
well to me your hook seems correct so that's the only thing that comes to mind for me 😄
9:13 PM
you probably aren't actually changing anything until the server is fully started so if it's crashing on startup it's something with the hook
Avatar
Owner Player could be 0
Avatar
it did mention that there was no players
9:14 PM
why would addItem fire then if there is no players to additem
9:14 PM
:😕
Avatar
Its on server start?
Avatar
from plugins.load and server start
Avatar
Game adds items on loading
9:16 PM
Just check for 0
Avatar
Deleted User 3/30/2019 9:47 PM
@Michidu will it hurt anything if new data/columns are added to that db?
9:47 PM
last question, i promise! lol.
Avatar
So if I tried if (OwnerPlayer != 0) never executes then tried if(OwnerPlayer->PlayerStateField()) it crashes then if(reinterpret_cast<AShooterPlayerController*>(OwnerPlayer->PlayerStateField())) crashes then if (OwnerPlayer) never executes (edited)
Avatar
Any ideas on how i can get this going
Avatar
@Deleted User it shouldnt, the plugin would be operating only on the columns it created, just dont alter or delete those
4:02 AM
why not just make a new table at that point though?
Avatar
Deleted User 3/31/2019 4:28 AM
because it's easier to just connect to one and keep everything in one location 'cause i'm already connecting/editing the shop db
4:28 AM
@Haragon
4:30 AM
im doing a discord bot in node and working with the shop db to update points/kits/etc, just going to add the other data i want to keep persistent rather than making a whole new db and having to dc, change args and then reconnect to a separate db
Avatar
i gotcha, but if you make a new table in the same db, you would just change the table in your query
4:53 AM
but just using the shop table would work too
Avatar
@Grumpy post your code 😃
Avatar
I have just figured it out
6:50 AM
void Hook_UPrimalItem_AddToInventory(UPrimalItem* _this, UPrimalInventoryComponent* toInventory, bool bEquipItem, bool AddToSlotItems, FItemNetID* InventoryInsertAfterItemID, bool ShowHUDNotification, bool bDontRecalcSpoilingTime, bool bIgnoreAbsoluteMaxInventory) { if (toInventory->IsOwnedByPlayer()) { const auto player_controller = toInventory->GetOwnerController(); const uint64 steam_id = ArkApi::IApiUtils::GetSteamIdFromController(player_controller); if (toInventory->IsLocalToPlayer(player_controller)) { FString ItemName; _this->GetItemName(&ItemName, true, false, player_controller); FString name; toInventory->GetInventoryName(&name, false); Log::GetLog()->warn("\"{}\" Added to {}[{}].", ItemName.ToString(), name.ToString(), steam_id); } } UPrimalItem_AddToInventory_original(_this, toInventory, bEquipItem, AddToSlotItems, InventoryInsertAfterItemID, ShowHUDNotification, bDontRecalcSpoilingTime, bIgnoreAbsoluteMaxInventory); }
6:51 AM
thanks @Michidu I am use to C#, so this C++ has been giving me a bit of a learning curve
6:51 AM
😃
6:51 AM
anyway, this is what I have so far
6:51 AM
any tips welcome
6:53 AM
I was first using the Additem Hook but it was just spamming items and I just could not get the syntax correct
6:53 AM
I then Look at the other hooks and got the one above working
6:55 AM
This is the one I had Issues with and left it one side UPrimalItem * Hook_UPrimalInventoryComponent_AddItem(UPrimalInventoryComponent* _this, FItemNetInfo* theItemInfo, bool bEquipItem, bool AddToSlot, bool bDontStack, FItemNetID* InventoryInsertAfterItemID, bool ShowHUDNotification, bool bDontRecalcSpoilingTime, bool bForceIncompleteStacking, AShooterCharacter* OwnerPlayer, bool bIgnoreAbsoluteMaxInventory) { //Log::GetLog()->warn("Hook_UPrimalInventoryComponent_AddItem-------------- {}", OwnerPlayer->PlayerStateField()); try { if (OwnerPlayer != nullptr) { Log::GetLog()->critical("Inventory Hook Running for player "); /*Log::GetLog()->warn("Inventory Hook Running for player : {}", OwnerPlayer->PlayerNameField().ToString()); ArkApi::GetApiUtils().SendServerMessage(reinterpret_cast<AShooterPlayerController*>(OwnerPlayer), FColorList::Blue, L"{}, You have added an item to your inventory", OwnerPlayer->PlayerNameField().ToString()); */ } } catch (std::exception e) { Log::GetLog()->error("Shit Failed again for ........Hook_UPrimalInventoryComponent_AddItem--------"); } return UPrimalInventoryComponent_AddItem_original(_this, theItemInfo, bEquipItem, AddToSlot, bDontStack, InventoryInsertAfterItemID, ShowHUDNotification, bDontRecalcSpoilingTime, bForceIncompleteStacking, OwnerPlayer, bIgnoreAbsoluteMaxInventory); }
6:56 AM
doesnt seem like the try catch block does anything at all, when it fails, it fails hard anyway, I am not sure why (edited)
6:58 AM
My biggest issue was trying to get into the if statement , but the code I have posted earlier are the example of what I have tried
Avatar
'try' can only catch c++ exceptions, you can try seh exceptions which is __try btw isn't IsOwnedByPlayer almost same as IsLocalToPlayer?
7:02 AM
ah, ignore it, just woke up :D so what problem you have now?
Avatar
if (OwnerPlayer != nullptr) {
7:03 AM
you said to check for 0, but not sure.....0 on what
Avatar
OwnerPlayer != nullptr is correct check
Avatar
but it never fires
7:03 AM
always false
Avatar
then OwnerPlayer always null i assume
7:04 AM
maybe you can get owner from UPrimalInventoryComponent
7:05 AM
I can give that a try
7:05 AM
similar to the second last code block
7:05 AM
uh no never mind
7:06 AM
Ill give it a play
7:06 AM
Thank you for your tim
7:06 AM
time
Avatar
UPrimalInventoryComponent::GetOwnerController maybe this
7:07 AM
thanks
Avatar
I find that after I few minutes after running the plugin the server stops responding, and have to restart it
8:29 AM
could just be coincidence, not sure
8:29 AM
Any tips to lookout for ???
Avatar
not likely because of plugin until you do something like inf loop
Avatar
nah all its doing is logging what the player have picked up
Avatar
so what happend when ark cant find a function
11:12 AM
ArkApi::GetApiUtils().SendServerMessage(reinterpret_cast<AShooterPlayerController*>(Dragger), FColorList::Red, L"Some message to send");
11:13 AM
Avatar
possibly Dragger is not a player
Avatar
Dragger is APlayerController*
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 3/31/2019 11:53 AM
For me it looks like Dragger is a Character, not a Controller 😄
11:53 AM
AShooterCharacter* OwnerPlayer ArkApi::GetApiUtils().SendServerMessage(reinterpret_cast<AShooterPlayerController*>(OwnerPlayer), FColorList::Blue, L"{}, You have added an item to your inventory", OwnerPlayer->PlayerNameField().ToString()); (edited)
Avatar
i want to make my WeapnDamageCustomizer config look something like this
9:25 PM
{ "WeaponDamageCustomizer": { "ToWild": [ { "WeaponName": "AP", "Multiplier": 5 } ], "ToTamed": [ { "WeaponName": "AP", "Multiplier": 5 } ], "ToPlayer": [ { "WeaponName": "AP", "Multiplier": 5 } ] } }
9:25 PM
where players add their own weapons
9:26 PM
is it better to load ToWild, ToTamed and ToPlayer each to separate arrays or load them into 1 array somehow ?
Avatar
Medicalmischief 3/31/2019 9:44 PM
Are titans included in that list? Or can you separate them from others?
Avatar
titans ?
Avatar
Medicalmischief 3/31/2019 10:01 PM
From extinction
Avatar
it's for weapons not dinos 😛
Avatar
Medicalmischief 3/31/2019 10:01 PM
Yeah weapon dmg vs titan
Avatar
"ToWild": [ { "WeaponName": "AP", "Multiplier": 5 }
10:02 PM
{ "WeaponDamageCustomizer": [ { "WeaponName": "AP", "Multiplier": 5, "Type":0 } ] }
10:02 PM
it will probably look like the last one
Avatar
Medicalmischief 3/31/2019 10:02 PM
That does all dinos right?
Avatar
where type decides if its a multiplier to wild,tamed or player
10:02 PM
depends on which one you set it to 😄
Avatar
Medicalmischief 3/31/2019 10:03 PM
I was wanting tamed titans to be easier to take down
Avatar
How would I check if an APrimalCharacter is an actual player or dino ? at this stage I am just checking the steam_id, if its 0 then not a player (edited)
6:36 AM
....but is there a better way to check it
Avatar
if(char->IsA(AShooterPlayerCharacter::GetPrivateStaticClass())) (edited)
Avatar
thanks 😃
6:44 AM
AShooterPlayerCharacter or AShooterCharacter
Avatar
AShooterPlayerCharacter
Avatar
there is no AShooterPlayerCharacter
8:21 AM
8:21 AM
8:22 AM
Avatar
Plugins for Ark Server API. Contribute to WETBATMAN/WeaponDamageCustomizer development by creating an account on GitHub.
8:45 AM
check this to see how i check for play/wild dino/tamed dino
8:45 AM
and don't mind some of the shit there like how i include json.hpp 3 times lol
Avatar
cool thanks
Avatar
How to solve dll import errors? https://i.imgur.com/OaOCr4e.png
Avatar
try to load this json.hpp it should solve the std::swap issue
689.44 KB
5:09 PM
it fixed the std:swap indeed 😃 but not the lin2001 error
Avatar
you trying to compile ArkShop ?
Avatar
no i made a different plugin a simple reward plugin that iwant to use with tdm
5:13 PM
or dm*
Avatar
TArray<UPrimalItem*> out_items; player_controller->GiveItem(&out_items, &fblueprint, default_amount, quality, force_blueprint,false, 0); Is out_items an array of items the player has or an array of the items created?
Avatar
created
Avatar
okay thanks 😄
Avatar
@Michidu how do you fix Linkin2001 error ?
Avatar
you're probably missing an include or something in the linker
9:46 PM
(i think) 😄
Avatar
Medicalmischief 4/1/2019 10:41 PM
Hey batman, does your bye bye corrupted make them take normal turret dmg also?
Avatar
byebyecorrupted only makes corrupted dinos not damage structures
Avatar
Medicalmischief 4/1/2019 10:57 PM
So people can gate off osds and it will be indestructible?
Avatar
currently yes 😛
Avatar
Medicalmischief 4/1/2019 10:58 PM
Okay, thanks
Avatar
@Natsu If you are using other plugin or library probably you need something like this #pragma comment(lib, "LibName.lib"), and you need to add path to .lib into project settings, of course.
Avatar
@DevCPP ya i got that and also using the call method as ArkShop::Points::addPoints for example
Avatar
I have 7 servers in my cluster and I find that the two that I have loaded are api on keeps stop responding from time to time since we've loaded the are api onto it is there any suggestions that you guys can give us to get around this. (edited)
Avatar
what plugins are you using ?
Avatar
The one i am busy developing a plugin for but is unloaded when not testing. The other only has the standard permissions one on it so far.
Avatar
by stop responding what do you mean ?
11:07 AM
like players can't join or the connections gets killed in RCON or something
Avatar
The server stops responding to any user connections, active connections stop and rcon refuses to connect as well
11:08 AM
And sometimes it show error.....hangdetection .....but not everytime
Avatar
i dont think just permissions would cause it to hang 😄
Avatar
are is no tutorial for dll export right?
Avatar
dll export ?
11:19 AM
__declspec(dllexport)
Avatar
what kind of tutorial you need?
Avatar
@Michidu the plugin i made is quite simple https://i.imgur.com/URvxQzs.png (edited)
1:32 PM
but i cant get it to use in a different plugin
1:32 PM
i get linking error
Avatar
you need add .lib too
Avatar
a simple tutorial on how to make a lib and use it in a different dll
Avatar
lib is generated automatically by compiler (edited)
1:37 PM
it's also loaded into the dll
1:38 PM
Reward::RewardBeacon::AddReward(player_steam_id, 1);
1:38 PM
works
1:38 PM
without a problem but
Avatar
did you add #pragma(lib, ....)
Avatar
just in case is your lib up to date? (edited)
Avatar
ya i just compiled it again
Avatar
how your import look like?
Avatar
with one? lib or dll?
Avatar
in .h
1:47 PM
this you mean?
Avatar
you include it to both projects?
1:48 PM
well i tried to base it off arkshop as in export dll
1:48 PM
if that's what you ment
Avatar
hm, weird, it looks correct, did you set path to lib too?
Avatar
yea i placed the lib with the rest https://i.imgur.com/7a5zEsp.png
Avatar
hm, why it so huge, did you set project type to .lib by chance?
1:57 PM
is that incorrect?
Avatar
keep as dll
Avatar
you dont need to do it
1:58 PM
and then rename it as .lib? (edited)
Avatar
no, lib will be generated with dll
Avatar
@Michidu tried to compile it as dll but i get a linking erro itself now 0_O https://i.imgur.com/3DbiUKa.png
Avatar
you need export
2:35 PM
check define
Avatar
on every class?
2:40 PM
dont export whole class
Avatar
@Michidu worked ty
3:43 PM
😄
3:43 PM
tough i had to make the project .lib
Avatar
any possible way to hide
8:30 PM
8:30 PM
this when a command is executed through a player 😄
Avatar
no @WETBATMAN
8:52 PM
he isnt a player he used his admin password
8:52 PM
other wise logging wont show
Avatar
no when you exec a console command with a plugin it logs to admin logs
8:52 PM
even if you're not admin 😄
8:52 PM
that's why i asked lmao
Avatar
why would you need to do a exec command?
Avatar
to add points ?
8:53 PM
RPS does this
8:53 PM
it has an RCON option too but its completely broke
Avatar
wait a sec looking something up i made
8:54 PM
erm
8:54 PM
you use the console command ingame?
8:55 PM
as in completed rps quest
8:55 PM
and receive reward?
Avatar
you can hide in config
Avatar
yes
Avatar
Yea that's logging @Michidu but it think he wants server logging just not the addpoints part
Avatar
he does not include the public functions for some reason
Avatar
if it shows up as server logging it's been done in the wrong way
Avatar
no all functions you run with a console command look like this 😄
8:57 PM
@'
Avatar
ha i see now what you mean lol sorry took a bit you want use the addpoints command?
Avatar
@Michidu when you added the shop {steamid} placeholder all commands executed with it looked like this too
Avatar
make a chat command
Avatar
i don't have the source code for it 😄
Avatar
you dont need it
Avatar
it's the RPS plugin
8:58 PM
points it self is arkshop right?
8:58 PM
yeah but agito does not include ArkShop in RPS
8:59 PM
what the hell
Avatar
otherwise the command to add points can be run with a function
8:59 PM
that's how it should be done other wise you get things like you have right now
Avatar
yep...
9:00 PM
he recommended me to use RCON instead of console but that does not work at all 😄
9:02 PM
maybe i should make an rcon command that intercepts a certain command and calls addpoints
9:02 PM
but idk the default ArkShop commands don't work with rcon maybe it's the command itself
9:02 PM
or RPS 😄
Avatar
so what your problem? lol looks like regular logged console command
Avatar
yeah that's my problem lol
9:14 PM
when people claim a reward it logs to chat and it spams the whole chat
Avatar
claim?
Avatar
the RPS plugin
Avatar
maybe it does something weird
Avatar
yes...
9:15 PM
instead of calling the public ArkShop function
9:15 PM
it makes me execute a console command 😄
Avatar
bad idea
Avatar
yeah now you see the problem 😄
Avatar
ask agito to change it heh
Avatar
already did
9:16 PM
just asked here if there was anything i could do 😄
Avatar
you can but its easier to exec command properly
Avatar
maybe hide it from chat ?
9:17 PM
like is it possible to filter the chat with a plugin 😄
Avatar
Yes
9:18 PM
Or custom handler in console command
Avatar
custom handler ?
Avatar
Yes, hook consolecommand, if command == add points, handle it and return without executing original function
Avatar
right but does that make the actual command go through ?
9:21 PM
or parse it get the steam id and call the ADDPoints function properly ?
Avatar
Yea, parse
9:24 PM
Or use a trick, there are 2 consolecommand functions and one doesnt call log
Avatar
yeah one is say right ?
9:25 PM
oh wait so there is a way to call a console command without logging it ?
Avatar
right, AShooterPlayerController::ConsoleCommand APlayerController::ConsoleCommand
9:28 PM
second doesnt call log
9:29 PM
you can redirect it
Avatar
so it has to be converted ?
9:29 PM
yeah that
9:29 PM
and AShooterPlayerController::ConsoleCommand has to be hooked ?
Avatar
yes
Avatar
that's AActor ?
Avatar
can be used to hide admin commands with enabled logs 😉
9:30 PM
yes
Avatar
that's a nice trick you just taught me 😄
9:30 PM
DECLARE_HOOK(AShooterPlayerController_ConsoleCommand, FString *, AShooterPlayerController*, FString *, FString *, bool);
9:31 PM
this one right ?
Avatar
wait a sec
9:34 PM
it has WriteToLog
9:34 PM
as bool
9:34 PM
or is that just the log file ?
9:37 PM
so how would i go about this static cast AShooterPlayerController to APlayerController or call the command from APlayerController somehow ?
Avatar
Its file
9:38 PM
Call from aplayercontroller
Avatar
if (Command->Contains("AddPoints")) { APlayerController->ConsoleCommand(); }
Avatar
What is APlayerController :D
Avatar
APlayerController* character = ConsoleCommand();
9:42 PM
needs something like this ?
Avatar
Consolecommand doesnt even return character
Avatar
APlayerController* command = _this->ConsoleCommand();
9:44 PM
something like this ? 😄
Avatar
Eh no, ((APlayerController*) _this) - >consolecommand
Avatar
yeah excuse my retardedness lmao
9:50 PM
FString * Hook_AShooterPlayerController_ConsoleCommand(AShooterPlayerController* _this, FString* result, FString* Command, bool bWriteToLog) { if (Command->Contains("AddPoints")) { FString result; FString AddPoints; Command = AddPoints; ((APlayerController*)_this)->ConsoleCommand(&result,&AddPoints,false); return 0; } return AShooterPlayerController_ConsoleCommand_original(_this, result, Command, bWriteToLog); }
9:50 PM
why can't it convert FString to FString 😄
9:50 PM
or did i do something completely retarded
Avatar
It wants FString* but you give FString**
9:53 PM
Just return function result btw
Avatar
result contains the contains the command ?
9:54 PM
or return the original result in the second console command
Avatar
Its actually empty but return Just in case
Avatar
how do i give FString*
9:55 PM
sorry i'm confused lol
Avatar
Its already fstring*
9:59 PM
You receive it
Avatar
it says no suitable conversion found from FString to Fstring*
Avatar
Your second call is good actually
Avatar
FString * Hook_AShooterPlayerController_ConsoleCommand(AShooterPlayerController* _this, FString* result, FString* Command, bool bWriteToLog) { if (Command->Contains("AddPoints")) { FString result; ((APlayerController*)_this)->ConsoleCommand(&result,Command,false); return 0; } return AShooterPlayerController_ConsoleCommand_original(_this, result, Command, bWriteToLog); }
10:00 PM
wait can i do this ? 😄
Avatar
Except that you call function after return :D
10:00 PM
Dont need & result
Avatar
re use the same one ?
Avatar
Ah, you call it fine
10:01 PM
Just use result
10:01 PM
Instead of & result
Avatar
FString * Hook_AShooterPlayerController_ConsoleCommand(AShooterPlayerController* _this, FString* result, FString* Command, bool bWriteToLog) { if (Command->Contains("AddPoints")) { ((APlayerController*)_this)->ConsoleCommand(result,Command,false); return 0; } return AShooterPlayerController_ConsoleCommand_original(_this, result, Command, bWriteToLog); }
10:01 PM
like this ?
10:01 PM
and don't return original if this passes ye ?
Avatar
Ye, and return function result instead of 0
Avatar
does the original have to be called after ?
Avatar
FString * Hook_AShooterPlayerController_ConsoleCommand(AShooterPlayerController* _this, FString* result, FString* Command, bool bWriteToLog) { if (Command->Contains("AddPoints")) { ((APlayerController*)_this)->ConsoleCommand(result,Command,false); return result; } return AShooterPlayerController_ConsoleCommand_original(_this, result, Command, bWriteToLog); }
10:02 PM
like this or set a bool and if its true don't call original ? (edited)
Avatar
Its fine
Avatar
hmm lemme test it 😄
10:03 PM
btw why return the result ?
Avatar
Why not lol that what it should return by default
Avatar
ah right lol
Avatar
Dont need to change function behaviour if its not required
Avatar
makes sense
10:05 PM
this is a neat trick haha
Avatar
it works
10:14 PM
thank you so much
Avatar
How can I get current player controller from UWorld
Avatar
I am currently using auto shooter_controller = static_cast<AShooterPlayerController*>(theWorld->GetFirstPlayerController()); ArkApi::GetApiUtils().SendServerMessage(shooter_controller, FColorList::Green, L", you tried the test command"); I am the only player on this server, and I am wondering if that is why its working. If there are more player on line , will it still come to me or could it possible go to another player due to it being GetFirstPlayerController (edited)
Avatar
"Returns the first player controller, or NULL if there is not one."
Avatar
yeah I assumed that from the name but doesnt really answer my question (edited)
Avatar
if you was first, it will return you
Avatar
ok, so clearly I should not be using that.
6:28 AM
do you have anysuggestions what I should rather use if I have to get controller from UWorld
Avatar
iterate over players
6:31 AM
for example, api function FindPlayerFromSteamName does it
Avatar
but how would the function Hook_APrimalDinoCharacter_IsReadyToUpload(APrimalDinoCharacter* _this, UWorld* theWorld) know that it found the correct controller as there is no reference to it
Avatar
there is character
Avatar
but its dino character
Avatar
because this function works with dinos?
Avatar
ok, so what I am trying to achieve here is to send the player that is trying to upload a dino a server message, how would I achieve it from here
6:41 AM
the function does what I need it to do, but I also need to send the message to the player that caused the trigger
Avatar
well, this function doesnt seem to take a player, you can find the owner of dino though which i guess will work
Avatar
yeah but the owner of a dino might not be the one trying to upload it
Avatar
you will need other function then
Avatar
any suggestions ?
6:44 AM
I need it to 1. Prevent a Dino from getting uploaded Working 2. Notify the user that they cant upload it. Not working as well as planned (edited)
6:48 AM
I have tried some void functions but not sure how to stop then from completing in the hook, or if its even possible (edited)
6:50 AM
it would be even better if i could just grey out the Dino in the upload or download list, but I haven't found anything even remotely close to that (edited)
Avatar
maybe this AShooterPlayerController::ServerUploadDino_Implementation
6:53 AM
AShooterPlayerController::ServerUploadDino
Avatar
I think that is one of them I have tried
6:53 AM
Ill look at it again
Avatar
you can send message to whole tribe 😃
Avatar
yeah I guess I could do that if I dont come right with it
6:55 AM
yeah I have tried both, not sure how I would stop the upload from happening
6:56 AM
Hook_APrimalDinoCharacter_IsReadyToUpload return a bool, so i just set it as false
6:56 AM
the last 2 you suggested is void
6:56 AM
not sure what to do with that
6:56 AM
I tried Passing nullptr
Avatar
dont execute original function maybe
Avatar
it still execute on its own
6:58 AM
if(true){ ///do what ever i need } else { execute original function }
6:58 AM
it seems to execute in both cases
6:59 AM
I tried that and I have tried passing nullptr
6:59 AM
the 1st uploads it anyway and the second crashes the server
Avatar
hook both maybe
Avatar
mmmm
7:00 AM
one for the action and one for the message
Avatar
yeah maybe that will work
7:01 AM
thanks
7:01 AM
😃
Avatar
any idea why these would fail
7:16 AM
7:16 AM
if I unload and load again it seems fine
7:16 AM
it only fails when the server starts
Avatar
how you hook it
Avatar
DECLARE_HOOK(AShooterGameMode_OnLogout, void, AShooterGameMode*, AController *); void Hook_AShooterGameMode_OnLogout(AShooterGameMode* _this, AController* Exiting) { AShooterGameMode_OnLogout_original(_this, Exiting); } //load ArkApi::GetHooks().SetHook("AShooterGameMode.OnLogout", &Hook_AShooterGameMode_OnLogout, &AShooterGameMode_OnLogout_original); //unload ArkApi::GetHooks().DisableHook("AShooterGameMode.OnLogout", &Hook_AShooterGameMode_OnLogout);
Avatar
hm it shouldnt fail 😄
Avatar
yeah it seems to work fine if i unload and load it manualy
7:26 AM
but fail on server restart
Avatar
Thanks @Michidu its working great
8:11 AM
how would I go about finding wyvern eggs that has not been picked up
Avatar
hm, dont know actually you can loop over all actors but its very slow (edited)
Avatar
If you know the position of the nests, perhaps you could spawn an actor there and then call AActor.GetOverlappingActors. Maybe that would work :)
Avatar
so an egg is actor as well
8:33 AM
?
Avatar
I assume so, but I couldn't say with any confidence. I'm still very new to plugin development.
Avatar
I guess its worth a try
Avatar
how does SubclassOf<APrimalDinoCharacter> work, how would I get a dino name from that At the moment I am using DownloadedDino->GetDinoDescriptiveName(&dino_name); to get the dino , but no idea how I would achieve it with the above subclass
Avatar
DinoDescriptiveName is just the class name i think
9:42 AM
it would return something like parasaur
Avatar
yeah I got it working like so FString dino_name; TheDinoClass.uClass->CreateDefaultObject()->NameField().ToString(&dino_name); (edited)
9:48 AM
but this returns the class name
9:49 AM
@WETBATMAN do you know how to get the normal name/nicename from class name (edited)
Avatar
hmm not really
9:49 AM
maybe some function has it as an argument
9:51 AM
FString& TamedNameField() { return *GetNativePointerField<FString*>(this, "APrimalDinoCharacter.TamedName"); }
9:51 AM
maybe this will help
Avatar
@Haragon could you enable PM for a sec 😄
Avatar
@WETBATMAN enabled
4:52 AM
4:52 AM
4:54 AM
4:56 AM
OK, so the Hook kept failing and decided to look into eventually. The Server Api Hooker Creator shows the hook with a UPrimalInventoryComponent*, but the code does not have anything with that type of parameter. there is this one above with no parameter
4:56 AM
So, which one is it, or is it a bug in either of the 2 Does anyone maybe know of a work arround ? (edited)
Avatar
hook is correct, in c++ first argument for function-members (which is 'this') is invisible
Avatar
how do i iterate through a TAray<class>*
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 4/4/2019 8:41 AM
You can iterate through it like any other array 😄 (edited)
Avatar
Is there any way to get FTribeData* from a TribeID other than iterating through all tribes?
Avatar
AShooterGameMode.GetTribeData
Avatar
is there a way to stop health regen?
Avatar
@Sotimurp TY
Avatar
@Michidu
Avatar
@WETBATMAN after testing the dm event i only had it once after 10 tests 😦
Avatar
what do you mean it does not launch ?
Avatar
na players dont get teleported inside
7:52 PM
only had it once after 10 tests or so
Avatar
i think that bug happens with the regular deathmatch aswell 😄
Avatar
ya i was testing regular
Avatar
ah
7:54 PM
you could try adding logs into it and see where it hangs (if it does)
Avatar
ya that's what i am going to do
7:55 PM
looks good 😄 next is highscore's 😃
7:56 PM
how long did that take you 😄
Avatar
mm that one 1h i think
7:57 PM
highscore will prob be less
Avatar
no the whole ui 😛
Avatar
oh long time
Avatar
great work it looks pretty cool
Avatar
what do you all think about asyncing DestoyWildDinos()
9:02 PM
is something like that even achievable ? 😄
Avatar
I think asyncing anything that wasn't intended to be thread safe is going to be a bad time
11:01 PM
Why not just trigger it on every reboot instead of trying to run it while the server is on?
11:03 PM
You could probably trigger it in a hook of one of the initial load methods as well
Avatar
actually i copied the source code from AsyncSaveWorld from Ownprox
11:04 PM
and had no issues surprisingly
11:04 PM
i can do other stuff when it dino wipes
Avatar
The thing with thread safety is that it may not crash always or possibly at all
Avatar
the only time i got it to crash is when i stacked the command when it wasn't fully done respawning in all the dinos
Avatar
Depending on what all is touched by ARK's dino wipe code, it could cause world corruption or just about anything to vanish (edited)
Avatar
i guess that's something i'll have to find out haha
11:09 PM
although does DestroyWildDinos affect the spawning in of those dinos aswell or just the deletion of them (edited)
Avatar
Not sure. I think the game sees that there is room to spawn dinos and starts respawning them
Avatar
yeah so i guess only asyncing DestroyWildDinos might cut it 😄
Avatar
I can think of a few ways you can do that wild dino wipe without messing with threading. They're not as quick to implement, but far safer
11:20 PM
first thing that came to my mind was this haha
Avatar
In general, forcing things to happen on another thread that we're designed to handle that is going to end in odd, hard to diagnose pain
Avatar
indeed but at least it's not something as important as a worldsave haha
Avatar
It's still very likely to cause random crashes
Avatar
i guess that's something i'll have to find out 😛
Avatar
Anyone who has worked with the daotk Mysql lib know how to convert daotk::mysql::datetime to std::time_t ?
6:39 PM
Or any way really to pull a DATETIME from mysql and work with it as time_t or any other type that I can use to compare times
Avatar
also, does anyone know if AShooterGameMode::ForceAddPlayerToTribe is what the game uses to add a player to a tribe? and for creation, would it be AShooterGameMode::ForceCreateTribe ?
Avatar
seems like you need to use UNIX_TIMESTAMP https://database.guide/unix_timestamp-examples-mysql/
In MySQL, you can use the UNIX_TIMESTAMP() function to return a Unix timestamp. A Unix timestamp is the number of seconds that have elapsed since '1970-01-01 00
7:38 PM
however, it easier to save values as timestamp in db already
7:40 PM
i think game uses AShooterPlayerState::AddToTribe
Avatar
@Michidu I ended up pulling the times as strings and then creating a time_t with strptime. Works well enough and is consistent. But I will check out unix timestamp as it may simplify some of the mathematics
Avatar
so why not save time as time stamp already?
Avatar
I have it saved as datetime but its all the same to me so long as I can compare it
8:19 PM
i used datetime because it seems like that is what daotk preferred
8:19 PM
also dont know how I missed AddToTribe... I will have to tinker with ClearTribe as well
Avatar
it doesn't prefer anything, but timestamp seems better
Avatar
i will tinker with it. TY for the help!
8:23 PM
oooh, I may be able to cover most of my cases by hooking AShooterPlayerState::UpdateTribeData if it's called after any change is made
8:25 PM
for functions prefixed with "ServerRequest", is that an intermediate func or would hooking those typically alter the behavior described by the function name?
Avatar
should change in most cases (especially if you can't find other one with similar name)
Avatar
"Name text NOT NULL DEFAULT '',"
10:47 AM
can a name be stored like this in mysql ? (edited)
10:47 AM
it's ingame names so i want it to have unicode
Avatar
Why not
Avatar
aight
1:48 PM
btw is doing multiple selects in multiple function a worse stress for the server compared to doing multiple in 1 run ?
1:48 PM
for mysql
Avatar
One request is faster
Avatar
db << "SELECT PlayerKills, PlayerDeaths, WildDinoKills, TamedDinoKills FROM Players WHERE SteamId = ?;" << steam_id >> std::tie(player_kills, player_deaths, wild_dino_kills, tamed_dino_kills);
2:27 PM
the sqlite request for ShopRewards looks like this
2:27 PM
would it be similar for mysql ?
Avatar
@WETBATMAN SELECT -> FROM -> WHERE
Avatar
selecting multiple the same ?
3:21 PM
just divide by ,
Avatar
is there any documentation ond the ark objects or do I just search through headers and examples until I find what I need?
Avatar
pretty much 😄
Avatar
sounds like my favourite type of programming
Avatar
welcome then 😃
Avatar
tbh it's not rocket science 😄
7:29 PM
i have no experience in either of the programming languages but thanks to the awesome API design and the very helpful devs here even i can get some very basic stuff done (edited)
Avatar
I did code some c++ a couple years back, I'll just hope for the best
7:32 PM
@Michidu thanks
Avatar
std::string GetPlayerStats(uint64 steam_id) override { std::string PlayerStats = ""; try { return db_.query("SELECT PlayerKills, PlayerDeaths, WildDinoKills, TamedDinoKills FROM Players WHERE SteamId = %I64u;", steam_id).get_value<std::string>(); } catch (const std::exception& exception) { Log::GetLog()->error("({} {}) Unexpected DB error {}", __FILE__, __FUNCTION__, exception.what()); } return PlayerStats; } (edited)
7:39 PM
if (Stats::IsPlayerExists(steam_id)) { database->GetPlayerStats>> std::tie(player_kills, player_deaths, wild_dino_kills, tamed_dino_kills); }
7:39 PM
i hope this works 😄
7:46 PM
obviously not 😄
8:56 PM
any ideas ?
Avatar
I've got this and I'm just as clueless lol
Avatar
@WETBATMAN How and where you declare and define these functions?
9:46 PM
mysqlDB.h
9:46 PM
bool TryAddNewPlayer(uint64 steam_id) override { try { return db_.query("INSERT INTO ShopRewards (SteamId) VALUES (%I64u);", steam_id); } catch (const std::exception& exception) { Log::GetLog()->error("({} {}) Unexpected DB error {}", __FILE__, __FUNCTION__, exception.what()); return false; } }
9:46 PM
look like this
Avatar
Try inline or place declarations and definitions to *.h and *.cpp file respectively
Avatar
what do you mean ?
Avatar
Code above is a method of class
9:50 PM
Your errors caused by a functions I think. use inline bool AddPlayerDeath(uint64 ...) { ... }
9:51 PM
Instead bool AddPlayerDeath(uint64 ...) { ... }
Avatar
still get the same
9:52 PM
weird i copied this from ArkShop directly 😄
Avatar
Weird... Usually this error becomes when you place function declaration and function definition in header file only.
Avatar
oh yeah they're both in headers 😄
9:59 PM
haha than's for pointing that out
Avatar
the nightmare of c++ headers
Avatar
In ArkShop declarations and definitions are separated to different files) This rule are truly for functions but you can declare and define class methods in header
10:54 PM
okay now i'm confused because i didn't touch or modify those in any way 😄
Avatar
What you are trying to do?
Avatar
isn't that cause the methods are defined in headers but not implemented?
Avatar
Probably
Avatar
Rewards are from the reward plugin right, maybe you copied the headers but not the implementation?
Avatar
nop i imported the whole plugin
Avatar
@Habasch looks like you unloaded plugin w/o cleaning it
Avatar
I think so, cause I add commands with AddConsoleCommand()
8:19 AM
I guess I'll have to do RemoveConsoleCommand() when detaching
Avatar
yea, you need
8:27 AM
or just restart server 😄
Avatar
restarting the server takes like 10 minutes and connecting another 5
8:28 AM
which is why I almost went crazy
Avatar
takes 70s on slow ssd
8:30 AM
if map is empty of course
Avatar
I wish
8:40 AM
I made a new savefile and removed all mods
Avatar
use Arkforum_eventmap
1:14 AM
its super small, good for testing
Avatar
@WETBATMAN
12:19 PM
std::string GetPlayerStats(uint64 steamid) override { std::string PlayerStats = ""; try { return db.query("SELECT PlayerKills, PlayerDeaths, WildDinoKills, TamedDinoKills FROM Players WHERE SteamId = %I64u;", steamid).getvalue<std::string>(); } catch (const std::exception& exception) { Log::GetLog()->error("({} {}) Unexpected DB error {}", __FILE, FUNCTION, exception.what()); } return PlayerStats; } is bad (edited)
12:20 PM
std::string GetPlayerStats(const uint64 steam_id) { try { return db_.query("SELECT PlayerKills, PlayerDeaths, WildDinoKills, TamedDinoKills FROM Players WHERE SteamId = %I64u;", steam_id).get_value<std::string>(); } catch (const std::exception& exception) { Log::GetLog()->error("({} {}) Unexpected DB error {}", __FILE__, __FUNCTION__, exception.what()); } return ""; }
Avatar
finally fixed the Linker errors
6:50 PM
thanks ownprox
6:50 PM
6:50 PM
now getting this for some reason
6:50 PM
const auto& mysql_conf = config["Mysql"]; { ShopRewards::database = std::make_unique<MySql>(mysql_conf.value("MysqlHost", ""), mysql_conf.value("MysqlUser", ""), mysql_conf.value("MysqlPass", ""), mysql_conf.value("MysqlDB", "")); }
Avatar
"Name TEXT NOT NULL DEFAULT '',"
7:43 PM
is a query like this invalid ? (edited)
7:43 PM
because once i remove it it loads the plugin fine
7:43 PM
but with that query in place it fails to create the table
Avatar
Use varchar
Avatar
nah it's just that text can't use a default apparently (edited)
Avatar
Oh that's interesting
Avatar
yeah lol 😄
8:02 PM
idk if varchar will cut it for Unicode though
8:02 PM
this is supposed to be the ingame player name
Avatar
@Haragon thanks for the hint, appreciate
Avatar
i think i forgot but how would i ignore color ? ArkApi::GetApiUtils().SendNotificationToAll(FLinearColor(0, 5, 0)
9:22 PM
@WETBATMAN
Avatar
i don't get why mysql does not wanna work for me 😄 (edited)
10:37 PM
it creates the tables fine
10:37 PM
but then the functions do not insert anything into them
10:37 PM
if (_this->TargetingTeamField() < 50000) { if (ShopRewards::database->IsPlayerExists(steam_id)) { Log::GetLog()->error("attempting to add player wild dino kill ", steam_id); ShopRewards::database->AddWildDinoKill(steam_id); } else { Log::GetLog()->error("attempting to add player to mysql", steam_id); ShopRewards::database->TryAddNewPlayer(steam_id); return APrimalDinoCharacter_Die_original(_this, KillingDamage, DamageEvent, Killer, DamageCauser); } } else { if (ShopRewards::database->IsPlayerExists(steam_id)) { Log::GetLog()->error("attempting to add player tamed dino kill", steam_id); ShopRewards::database->AddTamedDinoKill(steam_id); } else { Log::GetLog()->error("attempting to add player to mysql", steam_id); ShopRewards::database->TryAddNewPlayer(steam_id); return APrimalDinoCharacter_Die_original(_this, KillingDamage, DamageEvent, Killer, DamageCauser); } } }
10:37 PM
bool TryAddNewPlayer(uint64 steam_id) override { try { Log::GetLog()->error("TryAddNewPlayerCalled {}" ,steam_id); return db_.query("INSERT INTO ShopRewards (SteamId) VALUES (%I64u);", steam_id); } catch (const std::exception& exception) { Log::GetLog()->error("({} {}) Unexpected DB error {}", __FILE__, __FUNCTION__, exception.what()); return false; } }
10:38 PM
10:38 PM
Avatar
hm maybe try inserting a fixed id instead of just the steam-id?
Avatar
don't think that would change anything
Avatar
just wondering if it's maybe an issue of how the variable is written to sql
10:54 PM
cause the sql looks fine
Avatar
yeah that's what's driving me mad lol
Avatar
Rogue Leader 4/12/2019 12:56 AM
Is that the ShopRewards table?
12:56 AM
In your last SS
12:57 AM
And did you try refreshing the table?
12:57 AM
An error isn't being thrown, so I'm guessing it's putting that data somewhere.
12:58 AM
You can manually put a random number in the insert to confirm the insert isn't breaking on parsing the steam id from the code into the query strong before it sends it to the database.
Avatar
^^ this
Avatar
hmm will try when i get home
10:57 AM
would it not throw an exception though ?
Avatar
what I'm thinking is it tries to insert an empty (or null) value, which might not throw an exception
Avatar
yeah but steam id is logged
1:40 PM
in the console
1:41 PM
and that's the exact same argument as the one in the function 😄
Avatar
is AShooterPlayerState only available for online players?
Avatar
{ Log::GetLog()->error("TryAddNewPlayerCalled {}" ,steam_id); return db_.query("INSERT INTO ShopRewards (SteamId) VALUES (76561198082295768);", steam_id);
6:53 PM
even with a preset steam id like this nothing gets pushed to mysql
6:56 PM
it's something with the db connection i assume because even when i add myself manually it still tries to add me to the db again
6:56 PM
which probably means it can't read/write to it
6:58 PM
okay nvm
6:58 PM
i see my issue
6:59 PM
it can't insert anything because TEXT does not have a default value (edited)
6:59 PM
i see
Avatar
bool TryAddNewPlayer(uint64 steam_id) override { try { FString name = ""; AShooterPlayerController* controller = ArkApi::GetApiUtils().FindPlayerFromSteamId(steam_id); if (controller && controller->GetPlayerCharacter()) name = controller->GetPlayerCharacter()->PlayerNameField(); Log::GetLog()->error("player name", name.ToString()); Log::GetLog()->error("TryAddNewPlayerCalled {}" ,steam_id); return db_.query("INSERT INTO ShopRewards (SteamId , Name) VALUES (%I64u, %s);", steam_id,name.ToString()); } catch (const std::exception& exception) { Log::GetLog()->error("({} {}) Unexpected DB error {}", __FILE__, __FUNCTION__, exception.what()); return false; } }
7:42 PM
is getting the player name like this wrong ?
7:43 PM
7:43 PM
because nothing gets printed to the log
Avatar
can anyone give an example of how AShooterGameMode::GetTribeData(FTribeData *result, int tribeID) works?
Avatar
@WETBATMAN it looks fine, maybe controller or character == 0? also, you probably need to pass char* to %s parameter in the request
Avatar
for some reason the query was incorrect i think
5:33 AM
i copy pasted the query exactly as it was in the workbench
5:33 AM
and it worked
5:34 AM
i think when selecting multiple you need to enclose table names and such in ‘’
Avatar
@Haragon FTribeData* tribe_data = static_cast<FTribeData*>(FMemory::Malloc(0x128 + 0x28)); RtlSecureZeroMemory(tribe_data, 0x128 + 0x28); ArkApi::GetApiUtils().GetShooterGameMode()->GetOrLoadTribeData(teamId, tribe_data); // Do smth FMemory::Free(tribe_data); it may look a bit weird 😃
5:34 AM
in mysql you need, yeah
Avatar
yeah that was prob the issue
5:35 AM
need to somehow make the shop rewards stats display work now lol
5:36 AM
got adding kills and names to work
Avatar
work?
Avatar
yeah in mysql
5:37 AM
instead of sqlite (edited)
Avatar
@Michidu thank you, i'd have never come up with that :p
9:40 AM
is a query like this fine ?
9:40 AM
it lists no results in workbench for some reason
9:40 AM
although i've got 1 row
Avatar
looks good, what row you got?
Avatar
any error maybe?
Avatar
nope all green in the log
9:59 AM
tried an arkshop request too just to test and that didn't return anything either so maybe it's just like that
Avatar
try without order and limit 😃
Avatar
did that too
10:00 AM
Avatar
try ` maybe
Avatar
where ?
10:00 AM
table name ?
Avatar
instead of ' quotes
Avatar
yee that did the trick
10:01 AM
i thought they were quotes 😄
10:02 AM
btw any way to use std::bind with a string return type ?
10:02 AM
Avatar
that a quite weird syntax
Avatar
but can it be done this way or should something other than bind be used ?
Avatar
what you are trying to make? whole line makes no sense to me 😃
10:08 AM
trying to convert ShopRewards to mysql
10:08 AM
got adding player and dino kills to work
10:08 AM
now trying to make the commands work
10:08 AM
void ShowMyStats(AShooterPlayerController* player_controller, FString*, EChatSendMode::Type) { const uint64 steam_id = ArkApi::IApiUtils::GetSteamIdFromController(player_controller); int player_kills = 0; int player_deaths = 0; int wild_dino_kills = 0; int tamed_dino_kills = 0; if (ShopRewards::database->IsPlayerExists(steam_id)) { ShopRewards::database->GetPlayerStats -> std::bind(player_kills, player_deaths, wild_dino_kills, tamed_dino_kills); } ArkApi::GetApiUtils().SendChatMessage(player_controller, GetText("Sender"), *GetText("MyStats"), player_kills, player_deaths, wild_dino_kills, tamed_dino_kills); }
10:09 AM
the sqlite version used bind is there no way to do the same with mysql ?
10:10 AM
std::string GetPlayerStats(const uint64 steam_id) override { try { return db_.query("SELECT `PlayerKills`, `PlayerDeaths`,`WildDinoKills`, `TamedDinoKills` FROM ShopRewards WHERE SteamId = %I64u;", steam_id).get_value<std::string>(); } catch (const std::exception& exception) { Log::GetLog()->error("({} {}) Unexpected DB error {}", __FILE__, __FUNCTION__, exception.what()); } return ""; }
10:10 AM
request itself looks like this
Avatar
you cant read it as string since it will return 4 numbers
10:12 AM
int id; string name; optional<double> weight; auto res = my.query("select id, name, weight from person where id = %d", 3); if (res) { res.fetch(id, name, weight); cout << "ID: " << id << ", name: " << name; if (weight) cout << ", weight: " << *weight; cout << endl; } from lib docs
10:13 AM
that how you handle multiple values
Avatar
so all that goes into the query ?
10:19 AM
or the actual res part goes into the command ?
Avatar
depends how you want to do it
10:20 AM
you can build string from those values
Avatar
the way i have it does is functions get data from db and return it
10:26 AM
so i assume the res part would have to be done in the command itself ?
10:26 AM
instead of the query ?
Avatar
what do you mean with res part?
Avatar
void ShowMyStats(AShooterPlayerController* player_controller, FString*, EChatSendMode::Type) { const uint64 steam_id = ArkApi::IApiUtils::GetSteamIdFromController(player_controller); int player_kills = 0; int player_deaths = 0; int wild_dino_kills = 0; int tamed_dino_kills = 0; if (ShopRewards::database->IsPlayerExists(steam_id)) { auto res = ShopRewards::database->GetPlayerStats; if (res) { res.fetch(player_kills, player_deaths, wild_dino_kills,tamed_dino_kills); cout << "PlayerKills: " << player_kills << ", PlayerDeaths: " << player_deaths << ", WildDinoKills: " << wild_dino_kills << ", TamedDinoKills: " << tamed_dino_kills; cout << endl; } } ArkApi::GetApiUtils().SendChatMessage(player_controller, GetText("Sender"), *GetText("MyStats"), player_kills, player_deaths, wild_dino_kills, tamed_dino_kills); }
10:32 AM
something like this ?
Avatar
do fetch in GetPlayerStats
Avatar
and return what ?
Avatar
what you want, you can return 4 numbers or build string with them
Avatar
does anything have to be included for res ?
Avatar
alright i'm retarded 😄
10:43 AM
but for some reason it says res is undefined
10:43 AM
actually no it says it must be a bool
10:43 AM
std::string GetPlayerStats(const uint64 steam_id) override { int player_kills = 0; int player_deaths = 0; int wild_dino_kills = 0; int tamed_dino_kills = 0; try { auto res = db_.query("SELECT `PlayerKills`, `PlayerDeaths`,`WildDinoKills`, `TamedDinoKills` FROM ShopRewards WHERE SteamId = %I64u;", steam_id).get_value<std::string>(); if (res) { res.fetch(player_kills, player_deaths, wild_dino_kills, tamed_dino_kills); cout << "PlayerKills: " << player_kills << ", PlayerDeaths: " << player_deaths << ", WildDinoKills: " << wild_dino_kills << ", TamedDinoKills: " << tamed_dino_kills; cout << endl; } } catch (const std::exception& exception) { Log::GetLog()->error("({} {}) Unexpected DB error {}", __FILE__, __FUNCTION__, exception.what()); } return ""; }
Avatar
you dont need .get_value<std::string>()
Avatar
how can cout be red 😄
Avatar
cuz you forgot namespace
Avatar
{ using namespace std; auto res = db_.query("SELECT `PlayerKills`, `PlayerDeaths`,`WildDinoKills`, `TamedDinoKills` FROM ShopRewards WHERE SteamId = %I64u;", steam_id); if (res) { res.fetch(player_kills, player_deaths, wild_dino_kills, tamed_dino_kills); cout << "PlayerKills: " << player_kills << ", PlayerDeaths: " << player_deaths << ", WildDinoKills: " << wild_dino_kills << ", TamedDinoKills: " << tamed_dino_kills; cout << endl; }
10:46 AM
first cout is still red for some reason
Avatar
just use std:: instead
Avatar
std has no member cout 😄
Avatar
use log
Avatar
now bottom one is undefined
10:48 AM
wtf 😄
Avatar
just dont use cout
Avatar
@Michidu the cross chat ownprox released is that https://github.com/ark-mod/ArkCrossServerChat ?
Cross Server Chat support for ARK Survival Evolved servers. - ark-mod/ArkCrossServerChat
Avatar
its old one
Avatar
what does using Log here accomplish btw
2:51 PM
lmao it was undefined because IOSTREAM was not included 😄
Avatar
well it prints to console 😄
Avatar
yeh my issue was that i didn't have iostream included lol
3:32 PM
but how do i bind the return of that function to the function that actually displays the stats ? (edited)
3:32 PM
int GetPlayerStats(const uint64 steam_id) override { int player_kills = 0; int player_deaths = 0; int wild_dino_kills = 0; int tamed_dino_kills = 0; try { using namespace std; auto res = db_.query("SELECT `PlayerKills`, `PlayerDeaths`,`WildDinoKills`, `TamedDinoKills` FROM ShopRewards WHERE SteamId = %I64u;", steam_id); if (res) { res.fetch(player_kills, player_deaths, wild_dino_kills, tamed_dino_kills); cout << "PlayerKills: " << player_kills << ", PlayerDeaths: " << player_deaths << ", WildDinoKills: " << wild_dino_kills << ", TamedDinoKills: " << tamed_dino_kills; cout << endl; } } catch (const std::exception& exception) { Log::GetLog()->error("({} {}) Unexpected DB error {}", __FILE__, __FUNCTION__, exception.what()); } return player_kills,player_deaths,wild_dino_kills,tamed_dino_kills; }
3:32 PM
currently i made it return 4 integers
Avatar
you dont need iostream for log
3:35 PM
function can return only one value normally
Avatar
hmm
3:35 PM
so it needs to be a string ?
Avatar
no, you can return a struct or use pointers
Avatar
what do you mean 😄
3:36 PM
so basically an array ?
3:38 PM
you can use std::tuple also
Avatar
thx will have a look
Avatar
What command would I have to use to place a stucture at x y z (edited)
Avatar
What I am trying so far is const auto the_class = new UClass(); const auto location = new FVector(1,1,1); const auto rotation = new FRotator(0); const auto params = new FActorSpawnParameters(); ArkApi::GetApiUtils().GetWorld()->SpawnActor(the_class, location, rotation, params); (edited)
4:50 AM
but I have no Idea how to get from a blueprint classname to the actual UClass that is required for the spawn
Avatar
StaticLoadObject might help
Avatar
int GetPlayerStats(const uint64 steam_id) override { int player_kills = 0; int player_deaths = 0; int wild_dino_kills = 0; int tamed_dino_kills = 0; try { using namespace std; auto res = db_.query("SELECT `PlayerKills`, `PlayerDeaths`,`WildDinoKills`, `TamedDinoKills` FROM ShopRewards WHERE SteamId = %I64u;", steam_id); if (res) { res.fetch(player_kills, player_deaths, wild_dino_kills, tamed_dino_kills); cout << "PlayerKills: " << player_kills << ", PlayerDeaths: " << player_deaths << ", WildDinoKills: " << wild_dino_kills << ", TamedDinoKills: " << tamed_dino_kills; cout << endl; } } catch (const std::exception& exception) { Log::GetLog()->error("({} {}) Unexpected DB error {}", __FILE__, __FUNCTION__, exception.what()); } std::tuple<int,int,int,int> playerStats(int player_kills, int player_deaths, int wild_dino_kills, int tamed_dino_kills); { return ( player_kills,player_deaths,wild_dino_kills,tamed_dino_kills ); } }
1:57 PM
will something like this work for returning multiple values ?
Avatar
@WETBATMAN trying to make an achievment system? 😃
Avatar
nah just converting shop rewards to mysql lmao
Avatar
{ void ShowMyStats(AShooterPlayerController* player_controller, FString*, EChatSendMode::Type) { const uint64 steam_id = ArkApi::IApiUtils::GetSteamIdFromController(player_controller); int player_kills = 0; int player_deaths = 0; int wild_dino_kills = 0; int tamed_dino_kills = 0; if (ShopRewards::database->IsPlayerExists(steam_id)) { std::tie(player_kills, player_deaths, wild_dino_kills, tamed_dino_kills) = ShopRewards::database->GetPlayerStats(steam_id); } ArkApi::GetApiUtils().SendChatMessage(player_controller, GetText("Sender"), *GetText("MyStats"), player_kills, player_deaths, wild_dino_kills, tamed_dino_kills); }
6:53 PM
this was what i had to do
6:53 PM
used std::tuple
6:53 PM
not sure if works properly though haven't tested 😛
Avatar
Rogue Leader 4/20/2019 8:26 PM
Tuple seems really over complicated
8:26 PM
Why not create a struct and store the values there for each player?
8:27 PM
And have getplayerstats return the struct that matches the steam id you sent it
8:29 PM
Npp has an example of using structs to hold the data from the database for all offline and online players. And they have variables for each field in the db
8:30 PM
Then later if you add more stats, You can update the query, the struct, and then where it prints it.
Avatar
it seems to work fine so i can't complain 😄
Avatar
void Hook_UShooterCheatManager_BanPlayer(UShooterCheatManager* _this, FString PlayerSteamName)
10:38 AM
is this hook not used for banning players ?
10:38 AM
never returned original in it but it banned me anyway 😄
Avatar
does anybody have a quick idea why this gives me a fatal error without any real explanation?
Avatar
you get a crash log ?
Avatar
no only the ArkAPI log which has nothing useful in it
Avatar
yeah but does the server crash or just time out ?
Avatar
I'll try to reproduce and post the error message
Avatar
your crash log is saved
3:15 PM
in shootergame->saved->logs
3:15 PM
there should be a .crashtack
3:15 PM
if your plugin causes the crash it will tell you which line does
Avatar
oh yeah it actually does
3:17 PM
apparently line 51
3:17 PM
dino->GetEntryString
Avatar
why does ark make everything so complicated 😄
WarningPC 1
6:00 PM
not only do they have like 5 functions for banning players
6:00 PM
void Hook_UShooterCheatManager_BanPlayer(UShooterCheatManager* _this, FString PlayerSteamName)
6:00 PM
but playerSteamName is actually the steam ID here
6:00 PM
what the fuck
Avatar
probably steam name didnt work well
Avatar
I wonder why lmao
Avatar
@WETBATMAN ever messed with tribes/alliances? its a mess lol
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 4/27/2019 3:11 PM
Its not.. lol
3:11 PM
Its beautiful (edited)
Avatar
Does anyone know how can I get TribeID of structure, player, tamed dino (they can be offline)? TargetingTeamField always return non-zero value and I can't determine whether player/dino/structure is in tribe or not Eg for my non-tribed player I have about 900000 TargetingTeamField TribeIDField isn't always availaible in my hooks (edited)
Avatar
@DevCPP ARK reserves the lower numbers for internal uses (I don't recall what exactly the value is), so you'll see a few plugins have something like "TargetingTeamField < 20000" (check the number) to tell if it's a wild dino. (edited)
3:20 AM
I believe TargetingTeamField can also contain a PlayerId if they aren't in a tribe
Avatar
Has anyone ever messed with buffs?
Avatar
Hello 😃 I use recently the "Shop, Currency & Kits" ( https://ark-server-api.com/resources/shop-currency-kits.14/ ) plugin I want to create a package in which you buy 1 Dino and get the right saddle ... Does anyone have an example? (edited)
Features: Add any item, dino, beacon or experience points to the shop Points trading system Create custom kits with items and dinos inside Players can receive points for the time spent on server SQLite or MySQL Database Customizable config...
Avatar
Medicalmischief 5/8/2019 1:02 AM
Can set that up with the kits for sure. Unsure about only the buy command.
Avatar
Yes it is about kits I know ^^ but I would like it so that for example / buy velo enters and then a "Velonasaur" + "Velonasaur Saddle" gets (edited)
Avatar
Hi all! . I am looking for a dev capable of creating a spawn plugin for x and z coordinates with several features: 1. The spawn must be enabled for any dino, even for mods. 2. It is possible to add loot in the inventory of the dinos. 3. spawn of dinos configured by time. Axis: every 8 hours spawn. 4. Show broadcast when the dwn spawn appears. 5. Being able to create multiple spawn simultaneously.
Avatar
anyone know what function is called when you equip an item ?
Avatar
hello ppl somone know how i can enable colision on ARK for a player on rcon ? plugin no colision dont work on rcon 😦 (edited)
Avatar
adding an rcon command to that plugin should be simple enough
Avatar
maybe but i dunno how do that xD try learn c++ but need allot xD
Avatar
WoolyPenguin 6/17/2019 11:32 AM
I would recommend learning C++ syntax first 😃 (edited)
Avatar
just steal it from another one 😛
Avatar
Not necessarily a dev question, but has anyone had an issue with Kits causing crashes on Atlas?
Avatar
Means your Json is invalid. Please use a json validation tool
Avatar
several people asked me about that and 90% of the time they lack the permissions plugin 😄
Avatar
Hmm I have it and my JSON checks out. It's happening on spawn even if I have all kits set to OnlyFromSpawn:false and nothing set for DefaultKit
Avatar
well it has to still go over every kit so see which ones have OnlyFromSpawn enabled so chances are one of your kit configs (or multiple) are incorrect
Avatar
Do you have mysql setup?
Avatar
he's using atlas shop so yes (edited)
Avatar
yeah. ill have to go through my kits again with a fine tooth comb lol
Avatar
SublimeStyle 7/15/2019 11:45 PM
hey guys, fellow dev here (but newbie to creating plugins for ark) looking for a nudge in the right direction... if i'm trying to get current world data like players & dinos for ark within a plugin (with the goal of sending this data via requests to web server), where might I begin? Is there a specific library of method/function calls that I might be able use to retrieve an overarching list within the ArkApi?
Avatar
Hello there @SublimeStyle There is already a project started with it, but not internally using a plugin to get the data. You could take a look at https://github.com/ark-mod/ArkBot Maybe you can find some information! (edited)
ARK Survival Evolved application that monitors and extracts data from local ARK servers and exposes this data through a Web App, Web API and Discord Bot. Provides important functions to players: di...
Avatar
SublimeStyle 7/16/2019 1:02 AM
thank you so much!
Avatar
Server Plugins for ARK: Server API. Contribute to Michidu/Ark-Server-Plugins development by creating an account on GitHub.
👍 1
Avatar
SublimeStyle 7/16/2019 8:29 PM
@antihax this is exactly what i was looking for thank you!
Avatar
Anyone else having crash issues after today's updates on plugins? https://cdn.discordapp.com/attachments/589917716236730378/602696872292777987/unknown.png All 10 of our servers are crashing and giving that same error. Any help will be so welcomed! Thats the list of plugins we are using.
5:24 AM
Avatar
Server plugins support for ARK. Contribute to Michidu/ARK-Server-API development by creating an account on GitHub.
2:48 PM
If that helps any one.
2:50 PM
Be nice if it said what the error was 😐
Avatar
is anyone familiar with the Structure Limit Plugin? ^^ I want to have a limit for several structures (5 in total)
Avatar
Quick question - If I want to test my plugin on my local machine without setting up a server, can I just extract the API files to C:\Program Files (x86)\Steam\steamapps\common\ATLAS\ShooterGame\Binaries\Win64 and then copy my plugin files to C:\Program Files (x86)\Steam\steamapps\common\ATLAS\\ShooterGame\Binaries\Win64\AtlasApi\Plugins and launch the single player game? (edited)
Avatar
Would not recommend doing that, battleye would not like it.
Avatar
won't work
9:28 PM
API only works on server installs
9:28 PM
API won't load on client installs due to battleye
9:28 PM
since api is basically a cheat 😄
Avatar
Yeah, I can't even use a debugger or renderdoc on it :(
Avatar
That makes sense; thanks guys. Looks like I'll setup a new dev server then 😄
Avatar
Just glad it doesn't freak out about the VMs I have running like PUBG does 1x
Avatar
pubg freaks out on almost anything XD
9:31 PM
it doesn't allow kernel modifications so it won't run on a ghetto cracked windows
Avatar
I think it freaked out about an openssl hook I had installed once =P
Avatar
Also, is the GitHub link here only valid for ARK? Or is it the same for ATLAS, too? https://docs.google.com/document/d/1U4kRBevkLbXxcVMzKTmsjRKFkCEjtG46bfi5TdHNluQ/edit
Prerequisites: 1. https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15 2. https://github.com/Michidu/ARK-Server-API/archive/master.zip Step N1: Install Visual Studio by the link given on the first prerequisite. When the in...
Avatar
it has both API's in it
👍 1
9:42 PM
also i should change that guide
9:42 PM
it's better to add dependencies into vc++ directories
Avatar
Is it possible with the Structure Limit Plugin 3 different structures 1 limit to give?
Avatar
not without modifying it i think
Avatar
that is a pity ^^
Avatar
Medicalmischief 7/23/2019 10:23 PM
Are you talkin about you can choose to have one of the 3 items?
10:24 PM
Or 3 items each with their own limits
Avatar
Deleted User 7/25/2019 11:46 AM
Hi, has anyone played with item weight? Is it possible to change it with the API and will it register client side too? For example how stack mods reduce weight of certain items by 90%
Avatar
it's possible if you refresh the player inventory after changing it
11:48 AM
all item modifications are done with UPrimalItem
Avatar
Deleted User 7/25/2019 11:48 AM
Hmm thanks @WETBATMAN I'll look into that and the inventory refresh thing
Avatar
sometimes if you modify the item properly you won't even need to refresh the inventory
11:49 AM
you want to modify the weight upon the placement into player inventory right ?
Avatar
Deleted User 7/25/2019 11:49 AM
So in other words it has to be done every time player collects a resource basically?
11:50 AM
Yeah I'm guess that's what I'll have to do
Avatar
well if you modify the item AFTER it has been added you most likely won't have to refresh the inventory
11:50 AM
UPrimalItem * Hook_UPrimalInventoryComponent_AddItem(UPrimalInventoryComponent* _this, FItemNetInfo* theItemInfo, bool bEquipItem, bool AddToSlot, bool bDontStack, FItemNetID* InventoryInsertAfterItemID, bool ShowHUDNotification, bool bDontRecalcSpoilingTime, bool bForceIncompleteStacking, AShooterCharacter* OwnerPlayer, bool bIgnoreAbsoluteMaxInventory) { auto Items_array = config["BannedItemsChecking"]["RemovedFromInventoryItems"]; //Log::GetLog()->warn("Hook Called"); UPrimalItem* item = UPrimalInventoryComponent_AddItem_original(_this, theItemInfo, bEquipItem, AddToSlot, bDontStack, InventoryInsertAfterItemID, ShowHUDNotification, bDontRecalcSpoilingTime, bForceIncompleteStacking, OwnerPlayer, bIgnoreAbsoluteMaxInventory); if (item && !Items_array.empty()) { FString FullName; item->GetFullName(&FullName, nullptr); //Log::GetLog()->warn("Item Is {}", FullName.ToString()); for (std::string Item : Items_array) { FString ItemName = Item.c_str(); if (FullName.Contains(ItemName)) { FItemNetID itemID; itemID = theItemInfo->ItemIDField(); _this->RemoveItem(&itemID, false, false, true, true); } } } return item; }
11:50 AM
that's an example of how to safely remove an item from the inventory
Avatar
Deleted User 7/25/2019 11:51 AM
Oh great, thanks a lot! That's gonna help
Avatar
yeah it loads the items that need to be removed from an array
11:52 AM
so i guess you could change the array so each item has their own weight
Avatar
you can try something like this too: for (TSubclassOf<UPrimalItem>& data : Globals::GEngine() ->GameSingletonField()->PrimalGameDataOverrideField()-> MasterItemListField()) { if (!data.uClass) continue; UPrimalItem* item = (UPrimalItem*)data.uClass->GetDefaultObject(true); if (!item) continue; item->MaxItemQuantityField() = 1000; item->InventoryRefreshCheckItem(); item->UpdatedItem(); }
11:54 AM
if i remember correctly, it's enough to execute once
Avatar
Deleted User 7/25/2019 11:57 AM
Thanks guys, gonna try this and will keep you posted
Avatar
hello iam config my visual to start like that post https://ark-server-api.com/threads/tutorial-create-plugins.55/#lg=_xfUid-3-1564223846&slide=0 but when i place #include "Ark.h" i get error inside some files like Ark.h GameMode.h GameState.h Ue.h and others i need change all of this inside ? or i make something worng ? :\
any tutorial to create plugins? Thank you
Avatar
Helped Jota offline with this, and it's good now 😃
Avatar
@Foppa can arkbot be used on a hosted server? I notice there's some port forwarding and SSL things required which hosts most likely won't give access to. and you need to run the executable to set this up.
Avatar
well, the thing with arkbot. the bot needs to have full access to the save file. so you need to transfer it somehow.
Avatar
@Foppa I'm working with a host to get it supported. Working with saves isn't an issue. Will see how we go
Avatar
Hi, What is the best solution to escape mysql vars? I use the mysql++11.h and the connection works without any problem. But not escaping the vars is a little bit dangerous :D Is there any function like mysql_real_esacpe_string() ?
Avatar
SublimeStyle 8/8/2019 5:20 PM
I mean... it’s a plugin. Not saying you shouldn’t protect yourself but I don’t think you need to go all out... no ones going to inject your ark plugin lol unless there’s real $$ floating around then obviously yes
5:22 PM
I would look at the sql lib documentation and look at stack overflow on suggestions for securing against injections
Avatar
i write user inputs into the database. so it is really nessary to escape the input :D i use https://github.com/daotrungkien/mysql-modern-cpp but i don't know how to use stmt.bind_param(); with multiple vars
Lightweight header-only wrapper for MySQL with simple and convenient usage in modern C++ (C++11 or later) - daotrungkien/mysql-modern-cpp
6:38 PM
i get always "Invalid binding index"
Avatar
SublimeStyle 8/8/2019 7:08 PM
well for one i would never read user inputs directly into a database... so don't do that 😛
7:08 PM
always have to validate
7:09 PM
but i don't know anything about that library unfortunately :/
7:09 PM
i'm pretty sure arkapi includes it's own mysql lib so, if possible, i would use that
7:10 PM
not 'includes' but it definitely has the lib in the source
Avatar
SublimeStyle 8/8/2019 8:18 PM
Server Plugins for ARK: Server API. Contribute to Michidu/Ark-Server-Plugins development by creating an account on GitHub.
8:20 PM
those show how Michidu interfaces MySQL and SQLite (local) databases within the plugin
8:22 PM
as far as preventing sql injections, just make sure you validate the user input... if a user is inputting a string is should be checked against a validation range, also you can implement constraints from the rdbms (edited)
Avatar
i used the same lib :) But "stmt.bind_param(steam_id, message, player_name);" or for each param stmt.bind_param(); didn't work.
Avatar
SublimeStyle 8/9/2019 5:02 PM
i'm not exactly sure as i haven't worked with that library but my intention is to eventually incorporate mysql into my plugin so once I do and I'm in that lib and have any additional insight, I'll let ya know ^_^
Avatar
you can use mysqlreal_escape_string function actually ``` std::string EscapeString(const std::string& str) { std::string to(str.size() + 1, '\0'); mysql_real_escape_string(db.my_conn, to.data(), str.c_str(), str.size()); return to; } ```
👍 2
Avatar
SublimeStyle 8/9/2019 6:17 PM
std::vector<std::string> headers; headers.push_back("Content-Type:application/json"); headers.push_back("Accept-Charset:utf-8"); headers.push_back("Accept-Encoding:identity"); headers.push_back("Content-Encoding:identity"); try { API::Requests::Get().CreatePostRequest(url_, callback, current_batch_.dump(-1, ' ', false, nlohmann::detail::error_handler_t::ignore), headers); } catch (std::exception& e) { Log::GetLog()->error("{}", e.what()); } thought I had this working but after a refactor/rebuild I'm getting the same issue again with Requests::Update... I have no idea what I'm doing wrong - I can try lowering batch count again but I was able to get batches of 100 entities working and now 25 is throwing an error >_< (edited)
Avatar
have you tried w/o headers? and what api version is it?
Avatar
@Lacoi use token substitution, if that library doesn't offer it, throw it away and get a better one.
Avatar
SublimeStyle 8/9/2019 8:38 PM
i'm unwinding from the version that works and adding the refactored code piece by piece to figure out where I went wrong, and yeah I tried without headers but same issue
8:39 PM
i'll report back if i have anymore clarity to add
8:39 PM
and 3.2
8:40 PM
with the 3.2 updated source from GH as well
Avatar
Is it missing a required header?
11:18 PM
Null pointer
Avatar
SublimeStyle 8/9/2019 11:21 PM
that's a good question, idk tbh i just started backwards with the version that was working now i can send 150+ json obs so idk lol
Avatar
That may also not be the best place to do web stuff because it could hold the game loop up (edited)
Avatar
SublimeStyle 8/9/2019 11:21 PM
what could hold the game loop up ?
11:21 PM
callbacks?
Avatar
Firing off the request (edited)
Avatar
SublimeStyle 8/9/2019 11:22 PM
where would you suggest calling it ?
Avatar
What happens if it errors and you have to resend for example
11:22 PM
I would copy the state and pick it up in a thread probably...
Avatar
SublimeStyle 8/9/2019 11:22 PM
i have accounted for that...
11:23 PM
probably in not the most elegant way but i can still catch it
Avatar
Not sure how possible it is, then you can be lazy in the thread and deal with the errors
Avatar
SublimeStyle 8/9/2019 11:24 PM
i think by using batches i avoid serious overhead all at once
11:24 PM
more of a trickle effect
11:24 PM
but i have little to no experience in multi threaded programming so i have no clue
Avatar
trust me you shouldn't multi thread anything in ark
11:24 PM
it's not thread safe you'll cause more issues than the cost of that perf increase
Avatar
Yeah, was afraid that could be a problem.
Avatar
SublimeStyle 8/9/2019 11:25 PM
yeah i'm assuming this is all on the same thread
Avatar
You would have to copy the all the state you want
Avatar
SublimeStyle 8/9/2019 11:25 PM
i'm not intentionally coding any kind of thread logic
Avatar
Or you will race
Avatar
SublimeStyle 8/9/2019 11:25 PM
just using static variables and making callbacks
11:25 PM
if i can encapsulate that into a class, great but i'm not so sure i can with the callback
11:26 PM
or at least i've tried when making the callback private, could try making it public but i don't know if that'll make a difference
Avatar
Yeah, we get to cheat with redis in atlas
Avatar
SublimeStyle 8/9/2019 11:26 PM
what's redis ?
Avatar
It would do a state queue easy
Avatar
SublimeStyle 8/9/2019 11:28 PM
taking a shot in the dark, i think my error had to do with library dependencies or something because i rolled back to my working version, started adding the new classes/files i've made and it seems to be working fine now
11:28 PM
but that could be bs idk
Avatar
Its a key/value store, but it can do queues and channels too
Avatar
SublimeStyle 8/9/2019 11:29 PM
is that meant to work well within multithread or something ?
11:31 PM
when the async callbacks are happening, is that possible due to multithreading ? i'm used to async programming but when it's single thread underneath i.e. javascript, python (edited)
11:35 PM
and thinking on it... i could probably encapsulate the callback by storing the requests instance in the same class as the callback
Avatar
its more for sending data between systems
👌 1
Avatar
hey anyone online?
12:39 AM
??
Avatar
Bl4ckSkull666 8/14/2019 7:46 PM
Oh wow , great, few days no activity here. 👍
7:47 PM
After longer time, i will be programming me a small plugin. can anyone tell me where i found all available events?
Avatar
Server plugins support for ARK. Contribute to Michidu/ARK-Server-API development by creating an account on GitHub.
Avatar
Bl4ckSkull666 8/14/2019 7:48 PM
Ah thanks , it was on Michidu's Github. Thanks again. 😉 (edited)
Avatar
i found api document page been time out error (edited)
12:18 PM
12:22 PM
when will be fix it? (edited)
Avatar
thx i see document page is fixed (edited)
4:09 PM
and after build basic plugin with api i got build error of this messgae
4:09 PM
4:10 PM
and this is my source
4:10 PM
#include <Windows.h> #include "API/Atlas/Atlas.h" #pragma comment(lib, "ArkApi.lib") BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved) { switch (dwReason) { case DLL_PROCESS_ATTACH: ArkApi::GetApiUtils().SendServerMessageToAll(FColorList::Green, L"This is Welcome Message"); break; case DLL_PROCESS_DETACH: break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; } return TRUE; }
4:12 PM
translate error code to english 1.first formal parameter to 'operator new' must be 'size_t'
4:15 PM
2. _InterlockedIncrement64 not member of global namespace
4:15 PM
how can i fix this isssue? (edited)
Avatar
you should link with AtlasApi.lib if you make a plugin for atlas moreover, you can't send message to players on plugin load (because server hasn't even started yet)
Avatar
i import AtlasApi.lib and it didn't work
4:49 PM
also the error message output is same as image (edited)
4:51 PM
#include <Windows.h> #include "API/Atlas/Atlas.h" #pragma comment(lib, "ArkApi.lib") #pragma comment(lib, "AtlasApi.lib") BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved) { switch (dwReason) { case DLL_PROCESS_ATTACH: // ArkApi::GetApiUtils().SendServerMessageToAll(FColorList::Green, L"This is Welcome Message"); break; case DLL_PROCESS_DETACH: break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; } return TRUE; }
Avatar
why are you including both lib files ?
4:53 PM
for atlas you only need AtlasApi.lib
Avatar
i see the arkapilib in example at api document
4:54 PM
thx i'll try and if anything happen i'll let you know
Avatar
after i exclude Public file to my project , project build is successful
6:14 PM
so i think include file makes wrong result (edited)
Avatar
Is there any object method that execute add player to whitelist? (edited)
Avatar
SublimeStyle 8/20/2019 7:50 PM
i'm sure there's probably a method that accomplishes this more elegantly but if you know the folder structure and where the .txt is, you can just use standard fstream to read/write from txt: http://www.cplusplus.com/doc/tutorial/files/
7:51 PM
but then you'd probably have to call some kind of update method without needing to restart server so idk... I know there is a couple methods... but I don't know if there is one to explicitly add them to the server whitelist (as in the list that only allows x players, not the one that whitelists them as admins)
7:52 PM
if your server has restarts, you could write them to the txt as needed and just wait for the restart but that seems a little inefficient/not very user friendly (edited)
7:53 PM
@라스크 ^
Avatar
Thanks for the help
👍 1
Avatar
SublimeStyle 8/20/2019 8:13 PM
also, there is a helper method in ArkApi::Tools called GetCurrentDir or something like that.... use that in conjunction with fstream for the aforementioned approach
Avatar
Then what is difference of AShooterGameMode::LoadPlayersJoinNoCheckList() and AShooterGameMode::SavePlayersJoinNoCheckList()? (edited)
Avatar
SublimeStyle 8/21/2019 3:40 PM
i think that is referring to a blacklist
3:41 PM
i.e. ban list
3:41 PM
but you could try it out and see what it does!
Avatar
ChapelierHD 8/25/2019 7:36 AM
hello
7:36 AM
one problem ark api help
7:37 AM
Failed to read pdb - Failed to open pdb file
Avatar
missing dia?
Avatar
Deleted User 9/8/2019 3:40 AM
Im trying to get the player position in Atlas, but it seems to only show the last spawned position no matter where I move on the map when I check my position using the plugin it never changes, and when I tp to the position its where I spawned, to test it I logged out and back in and my position changes to the spawn location but it doesnt change again until I log FVector pos = ArkApi::IApiUtils::GetPosition(player_controller); Log::GetLog()->warn("Player position X-{}, Y-{}, Z-{}", pos.X, pos.Y, pos.Z);//using this to debug Is this not whats used for Atlas? iI dont see anything else and it seems to be whats used in Ark (edited)
Avatar
Deleted User 9/8/2019 3:55 AM
I would think you would want to have grid information in there as well so I have to wonder if there is another way I should be doing this
Avatar
@Deleted User try actor->RootComponentField()->RelativeLocationField()
5:54 AM
someone else recommened that
Avatar
Deleted User 9/8/2019 5:27 PM
Unfortunately That still gave me the spawn location as before, but after a little digging that got me to this, which worked: FVector pos = player_controller->DefaultActorLocationField(); Thanks for the help!
Avatar
老板来瓶爽歪歪 9/19/2019 5:28 PM
Hello there! How do I use the {steamid} placeholder in json, because I always use this to crash the server. Here is my json code: "ShopItems": { "A00": { "Type": "command", "Description": "Suicide Can be used when the small black house is closed. First deduct 100 gold coins, return 100 gold coins after resurrection", "Price": 100, "Items": [ { "Command": " HurtMe 900000 | ChangePoints {steamid} 100 " } ] } } beceuse I want the player to buy the item for free, and the number of times is not limited to the number of collections, but if the amount is set to 0, the amount will be insufficient.
Avatar
Highly Customizable Suicide Command That Can Be Adjusted To Your Liking! Source if you use "SuicideRequiresPermission": true make sure to grant the group you want to be able to use suicide command a permissions called Suicide thanks to...
5:56 PM
why not just use my suicide plugin 🙂
😅 1
Avatar
老板来瓶爽歪歪 9/19/2019 6:08 PM
Suicide is not an end, I want to quote the {steamid} placeholder here.😅
6:12 PM
Similar to this kit can add points to the player, why the store can not?
Avatar
Bl4ckSkull666 10/6/2019 8:03 PM
Hey all, anyone have a statistic Plugin for ARK? That's save Player Level, Tamed Dinos, Death's, Tribe Name to MySQL?
Avatar
SublimeStyle 10/7/2019 3:32 PM
^ i've been working on one but dev has slowed down since school has started up again - i plan on releasing it as a SaaS - essentially monthly plans where you can sign up for your server cluster and have a web portal and everything
3:33 PM
but if I were to give an estimate, i'd check back in 3-6 months lol
3:33 PM
not really any time for it anymore rn
Avatar
Does anyone know if i can use bIsBeingDragged for example to prevent it? Or is it bIsDraggingWithGrapHook? I'm talking about the victim not the player that is dragging the player.
Avatar
Simonsays095 10/24/2019 3:06 AM
How do I inject the dll after I compile the plugin?
Avatar
Does anyone know would it be possible to draw addition 2D HUD text for particular players?
Avatar
It would not be possible @DevCPP
Avatar
it might be
2:44 PM
if the damage number overlay accepts non number characters
2:44 PM
i got damage numbers to display with the API
Avatar
Damage numbers are bounded to a world pos and not screen pos no? @WETBATMAN
Avatar
true (edited)
Avatar
I think the question wants to put some text onto the 2d hud space, which wouldn't work properly with damage numbers
7:05 PM
Since their 2d pos would be w2s(3d pos)
Avatar
yeah that probably will be the case
Avatar
The best option I believe would be to cook your own custom mod (and find a way to hide it off steam) and have the server initialize it via rpc (edited)
7:07 PM
If the mod would only be started for some clients, then it is safe to assume that the clients that need it, should have it, and others do not need it
7:09 PM
If you rpc a client without the rpc function, I don't think it would crash the client or server
7:09 PM
But you would have to check yourself
7:10 PM
@Foppa you would need to hook the function that sets that boolean.
Avatar
why hide it off steam, just make authentication for the mod
7:33 PM
i manage HWIDBans licenses that way heh
Avatar
@WETBATMAN to help prevent reverse engineering and lower client load-time for non auth'ed users
Avatar
as far as i know mods are virtualized c++ so reversing them is going to be alot of effort 😛
Avatar
Not really that hard tbh, you can also stub a mod and load it another way (in the case that you want to use it on your own server)
Avatar
Asset loading is relative file paths
10:23 PM
Mods are assets
Avatar
auth helps in that case XD
Avatar
I'm talking about the other user using their own server
10:24 PM
Ex: You can make a mod to load that mod and bypass the auth.
10:24 PM
If you write the auth into the actual loading of the GUI (for something with a GUI), the functions are still exposed
10:24 PM
The only solution would be to require an auth check on each func call, which would be slow
10:25 PM
Yes, the remote server could cache the auth state ... but then you're at the same issue of a mod (on the server) overriding the cached value
10:26 PM
Why do this? Well, the mod itself may be secure from an auth state (e.g. not vuln to unauth'ed RPC calls) but
10:26 PM
your auth service may not be secure, either the service itself, or the machine.
10:26 PM
Smaller attack surface is always better.
10:26 PM
and again, lower load times for clients who'd never be authed
Avatar
maybe heh
Avatar
Guys, does anyone have a list with RCON commands?
Avatar
still having shop point dispersement lag on grid with alot of players
8:48 PM
what can be done to not have the 5-7 second lag every 5 mins
8:48 PM
something isnt right
Avatar
Is it something I need to set within my MySQL database?
10:15 PM
It’s only on grids with more players than the rest
10:16 PM
Is there a way to enable some kind of log to help figure out the issue?
Avatar
unless you recompile the plugin no 😄
Avatar
Can someone do that? So I can solve this issue pls
Avatar
@Foppa had it running with debug i think
10:42 PM
i don't host atlas so i don't do anything with that game's plugins 😦
Avatar
Well hopefully Foppa can give me a hand here
Avatar
What do you need? :)
Avatar
is there a way that i could log/debugg shop when its dishing out points on its intervals
Avatar
i can give you a debug version if you want
Avatar
Pls that would be helpful
1:41 AM
Thank you Foppa
2:01 PM
It will looks like this
Avatar
thank you sir
Avatar
@Foppa I have a function that returns FString* and has an FString* parameter. In IDA I have looked, and the returned FString* is the FString* parameter after some data is written to it via FString::Printf__VA. I am attmepting to replace the data in the FString* but I am getting a crash, usually looking something like this
8:18 PM
[h:\livegamehotfixes\engine\source\runtime\core\public\hal\mallocbinned.h:1046]
Avatar
i was getting the same crash while hooking ConsoleCommand and returning non original function
8:19 PM
seems like garbage collector doesn't like something
Avatar
FString* someHook(void* _this, FString* result) { result->Empty(); FString string1 = <some string from a field> FString str = *FString("c string" + string1.ToString() + "another c string"); result->Append(str); Log::GetLog()->log(spdlog::level::info, "Final String Is " + result->ToString()); return result; }
8:22 PM
anonymized the code, but that's what it's doing to test something
8:25 PM
@WETBATMAN Actually
8:25 PM
I just noticed, it should be returning void
8:25 PM
I think the FString* return type is due to IDA as IDA doesn't really populate instance methods as instance methods
Avatar
that could very well be why some functions crash with that error 😛 (edited)
Avatar
because
8:26 PM
8:26 PM
is called as if it was void
8:26 PM
but it's sig in IDA
8:26 PM
8:27 PM
going to change the return to void
8:27 PM
and see what happens
8:32 PM
alright
8:32 PM
8:32 PM
that did not work
8:32 PM
Lul
Avatar
rip 😄
8:33 PM
that's enough for now.
Avatar
does it crash after some time for you too ?
Avatar
IDA?
8:34 PM
No
Avatar
no the hook
8:34 PM
in the console command hook it took 5-10 minutes for me till the server crashed
8:34 PM
it wasn't immediate
Avatar
The hook when returning void crashes immediately
Avatar
when it's FString ?
Avatar
the hook when returning FString* crashes soon after it's called (edited)
Avatar
hm
Avatar
The entire function takes a shooter object, a fstring pointer, and prints a new value into the fstring and returns it
8:35 PM
it works when I return as FString* but as you said, the garbage collector freaks out
Avatar
exact same in ConsoleCommand hook
Avatar
I'm not hooking that though 🙂
8:36 PM
I don't see why this crashes
Avatar
wonders of ark 😄
Avatar
If I don't return my string, but call the original function and return
8:36 PM
it works fine
8:37 PM
but even stranger, I don't think it crashes when I return my new string, and don't change the string pointer (edited)
3:10 AM
sure love me some virtual function tables
3:10 AM
my 2nd favorite behind virtual function pointer tables
Avatar
if I wanted to add my own functions
3:56 AM
struct UPrimalLocalProfile { void AddArkTributeDino(APrimalDinoCharacter dino) { NativeCall<void, APrimalDinoCharacter*>(this, "UPrimalLocalProfile.AddArkTributeDino", dino); } };
3:56 AM
would suffice right?
3:56 AM
and _this->AddArkTributeDino(<some ptr>); should be valid yeah?
Avatar
cool, it worked (I did a function that returned a bool that I could control) (edited)
4:41 AM
though it looks like this bypasses my hooks (?) so interesting enough
4:42 AM
now the discussion becomes, should direct calls bypass hooks ... or should the hooks still apply. Personally, I think hooks should still apply as I may call a function that another mod is hooking ... and would want that result instead of the original call.
4:43 AM
However ... a good middle ground may be to do both, have the "REAL" version, and a version that calls hooks first, thus a mod author can decide which is the source of truth.
4:44 AM
(e.g. _this->AddArkTributeDino(<some ptr>) = call this but use the hooks and `_this->AddArkTributeDino(<some ptr>, true) = bypass hooks.
4:45 AM
and have AddArkTributeDino have a branch to either call the hooked function, or the original based off the optional boolean.
Avatar
I should add, fwiw, if you're hooking a function in your mod, and you wish to call the original function (but with your hooked version) a second / passive hook would work just fine
Avatar
How to modify the statistics of an article as armor durability and damage? example: const bool result = shooter_pc->GiveItemNum (item_id, quantity, quality, force_bp, armor, durability, melee);
Avatar
it's not possible like that
1:38 PM
you can't modify it that easily
1:38 PM
me and my friend spent 5 hrs reversing how they set all that
1:42 PM
void SetItemStatValue(UPrimalItem* item, EPrimalItemStat::Type item_stat_type, const float new_value) { *(item->ItemStatValuesField()() + item_stat_type) = 0; const float old_stat_modifier = item->GetItemStatModifier(item_stat_type); *(item->ItemStatValuesField()() + item_stat_type) = 1; *(item->ItemStatValuesField()() + item_stat_type) = (new_value - old_stat_modifier) / (item->GetItemStatModifier(item_stat_type) - old_stat_modifier); switch (item_stat_type) { case EPrimalItemStat::MaxDurability: if (item->bUseItemDurability()()) item->ItemDurabilityField() = item->GetItemStatModifier(item_stat_type); break; } #ifdef Atlas item->UpdatedItem(); #else item->UpdatedItem(false); #endif }
Avatar
thanks! @WETBATMAN for help
Avatar
@MindDragon
1:02 AM
any ideas on this?
1:02 AM
_this->MyInventoryComponentField()->AddCustomFolder(*FString("some string")
1:02 AM
causing
1:02 AM
ShooterGameServer.exe!FMallocBinned::Realloc() (0x00007ff60e1e4573) + 0 bytes [h:\trunk\engine\source\runtime\core\public\hal\mallocbinned.h:1026] ShooterGameServer.exe!FHeapAllocator::ForAnyElementType::ResizeAllocation() (0x00007ff60d342125) + 43 bytes [h:\trunk\engine\source\runtime\core\public\containers\containerallocationpolicies.h:347] ShooterGameServer.exe!UPrimalInventoryComponent::AddCustomFolder() (0x00007ff60d54e309) + 68 bytes [h:\trunk\projects\shootergame\source\shootergame\private\primalinventorycomponent.cpp:5541]
Avatar
I get this error with doing FString* test = new FString(); test->Append("test"); AddCustomFolderHook(_this->MyInventoryComponentField(), test, 768);
1:28 AM
as well
1:29 AM
void AddCustomFolderHook(UPrimalInventoryComponent* _this, FString* CFolder, int InventoryCompType) { char buffer[1024]; sprintf_s(buffer, "Logged Data %s %i", CFolder->ToString(), InventoryCompType); Log::GetLog()->log(spdlog::level::info, "[DEBUG] Add Custom Folder was called."); Log::GetLog()->log(spdlog::level::info, buffer); AddCustomFolder_original(_this, CFolder, InventoryCompType); }
1:29 AM
with the same callstack
1:29 AM
ShooterGameServer.exe!FMallocBinned::Realloc() (0x00007ff60e1e4573) + 0 bytes [h:\trunk\engine\source\runtime\core\public\hal\mallocbinned.h:1026] ShooterGameServer.exe!FHeapAllocator::ForAnyElementType::ResizeAllocation() (0x00007ff60d342125) + 43 bytes [h:\trunk\engine\source\runtime\core\public\containers\containerallocationpolicies.h:347] ShooterGameServer.exe!UPrimalInventoryComponent::AddCustomFolder() (0x00007ff60d54e309) + 68 bytes [h:\trunk\projects\shootergame\source\shootergame\private\primalinventorycomponent.cpp:5541]
Avatar
We've kinda given up on the project -- too unwieldy for us ... I think someone is working on rebuilding it from the ground up
Avatar
This is for my own plugin @MindDragon
2:00 AM
I was just asking in case you had experience in this bug
Avatar
it's some kind of conflict with other mods
Avatar
I should clarify
2:05 AM
I'm writing a plugin with my own hooks, passing the fstring to the function causes the crash
2:05 AM
The test server is 100% vanilla minus my plugin for testing
2:06 AM
The failure is on realloc
Avatar
can you tell me what is in mallocbinned.h around line 1026?
2:09 AM
i don't want to download UE just for this lol
Avatar
I'll look in a bit
2:10 AM
However, related
2:11 AM
Do you think UProperty() would fix it?
Avatar
yeah that could be... the destructor could be not finding what it's looking for
2:12 AM
malloc is here
2:13 AM
pretty basic function...
Avatar
I'll try the UPROPERTY()
2:18 AM
Oh, I should add @MindDragon
2:18 AM
My function isn't calling fmalloc
2:18 AM
It's an existing ark function
2:18 AM
But I'll check the uprop
Avatar
you probably dont even need to alloc memory for fstring
Avatar
@Michidu I tried with
12:36 PM
&FString(TEXT("Test :)"))
12:36 PM
Same crash :/
Avatar
whats your full code?
Avatar
if you're still around, I can post it @Michidu (edited)
Avatar
void AddCustomFolderHook(UPrimalInventoryComponent* _this, FString* CFolder, int InventoryCompType) { CFolder->ReverseString(); AddCustomFolder_original(_this, CFolder, InventoryCompType); } This functions fine, and does as what is expected.
4:57 PM
void AddCustomFolderHook(UPrimalInventoryComponent* _this, FString* CFolder, int InventoryCompType) { AddCustomFolder_original(_this, CFolder, InventoryCompType); CFolder->ReverseString(); AddCustomFolder_original(_this, CFolder, InventoryCompType); } This is crashing for me.
Avatar
for this crash ShooterGameServer.exe!TArray<FCustomVersion,FDefaultAllocator>::~TArray<FCustomVersion,FDefaultAllocator>() (0x00007ff6e4a969f6) + 13 bytes [h:\trunk\engine\source\runtime\core\public\containers\array.h:498] ShooterGameServer.exe!FBitWriter::~FBitWriter() (0x00007ff6e3fd1022) + 0 bytes [UnknownFile:0] ShooterGameServer.exe!UNetDriver::InternalProcessRemoteFunction() (0x00007ff6e5136206) + 0 bytes [h:\trunk\engine\source\runtime\engine\private\networkdriver.cpp:975]
5:10 PM
void AddCustomFolderHook(UPrimalInventoryComponent* _this, FString* CFolder, int InventoryCompType) { FString text = TEXT("text literal"); AddCustomFolder_original(_this, &text, InventoryCompType); } is also crashing.
5:12 PM
it seems this func is generally called from bp code and not from their c++ directly
5:13 PM
the underlying call from the PrimalInventoryComp is IDataListProviderInterface::AddCustomFolder(IDataListProviderInterface *this, FString *CFolder, int InventoryCompType)
5:13 PM
@Michidu
Avatar
dont call original twice
5:15 PM
secondly dont use 'new'
Avatar
Yes, the 2nd variant doesn't do that, I attempt to call it with a string Literal
5:15 PM
void AddCustomFolderHook(UPrimalInventoryComponent* _this, FString* CFolder, int InventoryCompType) { FString text = TEXT("text literal"); AddCustomFolder_original(_this, &text, InventoryCompType); }
5:15 PM
no new in this one, crash with no stack.
Avatar
well, 2nd variant crashes because its a local variable and function tries to call free on it
Avatar
Then I should put the FString on the heap? What would you suggest for that, malloc manually?
5:17 PM
free should crash when being called on a stack variable, so that makes sense (edited)
Avatar
either just use CFolder or alloc using FMemory::malloc
Avatar
I'm going to need to use FMemory::Malloc 😦
5:18 PM
I'm not actually going to use AddCustomFolderHook in my plugin, I wrote it originally to log what the value of InventoryCompType was
5:18 PM
I'm going to be calling the actual function from another hook.
5:19 PM
I thought new in C++ would put a variable on the heap, like smart pointer?
Avatar
yes but UE has its own memory management functions
Avatar
For the Fmemory::Malloc, should I alloc enough space for FString->Empty and use FString->Append to dynamically resize it with the content?
5:22 PM
FString* text = (FString*) FMemory::Malloc(sizeof(FString)); text->Empty(); text->Append("some text");
5:22 PM
something like this?
Avatar
nah, it has own buffer anyway
Avatar
what should I do for the FString Malloc then?
Avatar
use sizeof
5:27 PM
actually i guess your latest crash related to something else
Avatar
yes, because FString* text = (FString*) FMemory::Malloc(sizeof(FString)); text->Empty(); text->Append("some text"); AddCustomFolder_original(_this, text, InventoryCompType); (edited)
5:27 PM
also threw a crash
Avatar
call only AddCustomFolder_original
Avatar
I am
5:28 PM
that is the whole func that causes a crash currently.
5:28 PM
no crashstack, but i have a dump file now so I will read it.
5:29 PM
5:29 PM
is this because I alloc the memory in my dll ? I thought once injected they shared the same memory space/access (edited)
Avatar
no, its fine
5:30 PM
does it crash if you only call orig func?
Avatar
what do you mean, like if I call _this->MyInventoryComponentField()->AddCustomFolder()?
5:30 PM
right now I am only calling AddCustomFolder_original from the DECLARE_HOOK macro
5:31 PM
void AddCustomFolderHook(UPrimalInventoryComponent* _this, FString* CFolder, int InventoryCompType) { FString* text = (FString*) FMemory::Malloc(sizeof(FString)); text->Empty(); text->Append("some text"); AddCustomFolder_original(_this, text, InventoryCompType); }
5:31 PM
that is the full function as-is, nothing else calls anything to do with the folders atm.
5:32 PM
should FString* text = (FString*) FMemory::Malloc(sizeof(FString)); be FString* text = (FString*) FMemory::Malloc(sizeof(void*));? (edited)
5:33 PM
just try to leave only call to orig func
Avatar
oh, you mean void AddCustomFolderHook(UPrimalInventoryComponent* _this, FString* CFolder, int InventoryCompType) { AddCustomFolder_original(_this, CFolder, InventoryCompType); }
5:34 PM
that works fine
5:34 PM
I can even operate on the CFolder such as FString->Append, works 100% fine.
5:34 PM
Some context, the value for CFolder should be coming from the UI of the client as it's an input box on the UMG (similar to dino rename)
5:35 PM
Does it need the UProperty() ? I'm not sure how to add that if it does. I'm making a guess that it has UProperty() internally as the FString of the input textbox would be a property. (edited)
Avatar
no why you dont just change CFolder then?
Avatar
Because I am going to be calling this from another hook that doesn't have any relation
5:36 PM
This existing hook was for debugging / dumping info
Avatar
actually i guess it crashes because you just passes wrong text in CFolder
Avatar
What do you mean?
Avatar
you just call it with 'some text'
Avatar
yes, the text can be whatever, it's supplied from user-input on a client
Avatar
hm, is that your crash now? ShooterGameServer.exe!TArray<FCustomVersion,FDefaultAllocator>::~TArray<FCustomVersion,FDefaultAllocator>()
Avatar
that was when I called the func twice (edited)
5:39 PM
currently, my crash produces no crashstack
5:40 PM
last lines in the log before the crash
5:40 PM
[2019.11.08-16.38.20:451][ 8]WinMain() __try _except guarded failure, no report? [2019.11.08-16.38.20:451][ 8] - FPlatformMisc::RequestExit(1)
Avatar
what exactly you gonna call from other hook?
Avatar
void Hook_APrimalDinoCharacter_TameDino(APrimalDinoCharacter* _this, AShooterPlayerController* ForPC, bool bIgnoreMaxTameLimit, int OverrideTamingTeamID, bool bPreventNameDialog, bool bSkipAddingTamedLevels) { APrimalDinoCharacter_TameDino_original(_this, ForPC, bIgnoreMaxTameLimit, OverrideTamingTeamID, bPreventNameDialog, bSkipAddingTamedLevels); if (_this->MyInventoryComponentField()) { ArkApi::GetApiUtils().SendChatMessageToAll("Server", "A Dino Was Tamed!"); _this->MyInventoryComponentField()->AddCustomFolder(<some text>, <some int>); } else { Log::GetLog()->log(spdlog::level::info, "[DEBUG] NULL Inventory Comp!"); } Log::GetLog()->log(spdlog::level::info, "[DEBUG] Tame Dino was called."); }
Avatar
what you are even trying to do in AddCustomFolder hook?
Avatar
currently, debug why calling AddCustomFolder crashes with my own FString
5:43 PM
after I can make sure it works , nothing.
Avatar
is it necessary? 🙂
Avatar
_this->MyInventoryComponentField()->AddCustomFolder has the same crash.
5:44 PM
Do you mean remove the hook entirelly?
5:44 PM
I will be once I can confirm _this->MyInventoryComponentField()->AddCustomFolder won't crash with my custom FString.
Avatar
since you call AddCustomFolder by yourself it kinda doesnt make sense to hook it
Avatar
I had it hooked originally to log the value of InventoryCompType so I could call the actual function with the correct value.
5:47 PM
The issue, is no matter how AddCustomFolder is called, it crashes with my supplied FString
5:49 PM
VERSION: 300.7 ShooterGameServer.exe!FMallocBinned::Realloc() (0x00007ff6e4aa4573) + 0 bytes [h:\trunk\engine\source\runtime\core\public\hal\mallocbinned.h:1026] ShooterGameServer.exe!FHeapAllocator::ForAnyElementType::ResizeAllocation() (0x00007ff6e3c02125) + 43 bytes [h:\trunk\engine\source\runtime\core\public\containers\containerallocationpolicies.h:347] ShooterGameServer.exe!UPrimalInventoryComponent::AddCustomFolder() (0x00007ff6e3e0e309) + 68 bytes [h:\trunk\projects\shootergame\source\shootergame\private\primalinventorycomponent.cpp:5541] ArkAdvert.dll!Hook_APrimalDinoCharacter_TameDino() (0x00007ff9e1336a41) + 208 bytes [C:\Users\Riley\source\repos\Ark-Server-Plugins-master\SomeHooks\ArkAdvert\ArkAdvert.cpp:78] ShooterGameServer.exe!AShooterPlayerController::ForceTame() (0x00007ff6e40ae3f5) + 31 bytes [h:\trunk\projects\shootergame\source\shootergame\private\shooterplayercontroller.cpp:6064] ShooterGameServer.exe!UFunction::Invoke() (0x00007ff6e4ae2ecf) + 6 bytes [h:\trunk\engine\source\runtime\coreuobject\private\uobject\class.cpp:3801]
5:49 PM
related crash-stack
5:49 PM
for
5:49 PM
void Hook_APrimalDinoCharacter_TameDino(APrimalDinoCharacter* _this, AShooterPlayerController* ForPC, bool bIgnoreMaxTameLimit, int OverrideTamingTeamID, bool bPreventNameDialog, bool bSkipAddingTamedLevels) { APrimalDinoCharacter_TameDino_original(_this, ForPC, bIgnoreMaxTameLimit, OverrideTamingTeamID, bPreventNameDialog, bSkipAddingTamedLevels); if (_this->MyInventoryComponentField()) { ArkApi::GetApiUtils().SendChatMessageToAll("Server", "A Dino Was Tamed!"); _this->MyInventoryComponentField()->AddCustomFolder(FString(TEXT("Test")), 768); } else { Log::GetLog()->log(spdlog::level::info, "[DEBUG] NULL Inventory Comp!"); } Log::GetLog()->log(spdlog::level::info, "[DEBUG] Tame Dino was called."); }
Avatar
hm its weird indeed
5:50 PM
try to malloc here maybe in tamedino function
Avatar
this
5:50 PM
FString* text = (FString*) FMemory::Malloc(sizeof(FString)); text->Empty(); text->Append("some text");
5:50 PM
?
5:51 PM
uhm, I think your declaration is wrong actually in the API
5:51 PM
5:51 PM
it takes FString , not FString*
5:51 PM
but
5:52 PM
IDA says
5:52 PM
void __fastcall UPrimalInventoryComponent::AddCustomFolder(UPrimalInventoryComponent *this, FString *CFolder, int InventoryCompType)
Avatar
if ida says pointer then its pointer 🙂
Avatar
then yours would not work then 😦
5:52 PM
however,
5:52 PM
this AddCustomFolder_original should suffice no?
5:53 PM
or should I redecl the function like so
5:53 PM
void AddArkTributeDino(APrimalDinoCharacter* dino) { NativeCall<void, APrimalDinoCharacter*>(this, "UPrimalLocalProfile.AddArkTributeDino", dino); } (but for the function)
Avatar
actually it could be FString
5:54 PM
i see just FString in ida
Avatar
strange
5:55 PM
my ida says pointer
5:55 PM
5:55 PM
MonkaBinoculars
Avatar
don't use decompiler, it guesses types
Avatar
ok, but then why should _this->MyInventoryComponentField()->AddCustomFolder(FString(TEXT("Test")), 768); crash ?
5:56 PM
if it is doing a value-copy
5:56 PM
just wondering
Avatar
you declared it as FString*
5:56 PM
well, try to change
Avatar
_this->MyInventoryComponentField()->AddCustomFolder this wasn't declared with FString*
5:56 PM
that is the one from your api currently, it uses FString
Avatar
you have it by value now?
Avatar
_this->MyInventoryComponentField()->AddCustomFolder has always been byvalue
5:58 PM
both _this->MyInventoryComponentField()->AddCustomFolder and my AddCustomFolder_original crash with my supplied FString
5:58 PM
_this->MyInventoryComponentField()->AddCustomFolder = byvalue
5:58 PM
AddCustomFolder_original = ptr
5:58 PM
the first is from your api decl
5:58 PM
the 2nd was me testing from the folder hook
5:58 PM
but I will try something.
Avatar
i just saw you use pointer in the hook
Avatar
in the hook, yes, but doesn't calling _this->MyInventoryComponentField()->AddCustomFolder bypass the hook?
Avatar
I also tried with not enabling the hook
6:00 PM
I have found that calling the func in my experience has bypassed my hook before, consistently on a function that returned a bool that I could control.
6:00 PM
when the bool was supposed to be false, but hooked the func to return true, it returned false , and vice-versa
Avatar
it shouldn't happen actually
6:01 PM
until you call _orig directly
Avatar
it was for me, I hooked the func to return true, but when it was false (set from server config) it returned false when I called it.
6:02 PM
but when set to true in server config it was saying true
6:02 PM
I had previously verified the hook worked
6:02 PM
it just crashed when using FString byvalue
Avatar
not sure why usually it cant bypass hook 🙂
Avatar
DECLARE_HOOK(AddCustomFolder, void, UPrimalInventoryComponent*, FString, int); void AddCustomFolderHook(UPrimalInventoryComponent* _this, FString CFolder, int InventoryCompType) which is never actually enabled (no EnableHook)
6:03 PM
_this->MyInventoryComponentField()->AddCustomFolder(FString(TEXT("Test")), 768);
6:03 PM
crashes
6:03 PM
I don't think I need to FMalloc it now since it's not a pointer ?
6:04 PM
Fatal error! VERSION: 300.7 ShooterGameServer.exe!FMallocBinned::Realloc() (0x00007ff6e4aa4573) + 0 bytes [h:\trunk\engine\source\runtime\core\public\hal\mallocbinned.h:1026] ShooterGameServer.exe!FHeapAllocator::ForAnyElementType::ResizeAllocation() (0x00007ff6e3c02125) + 43 bytes [h:\trunk\engine\source\runtime\core\public\containers\containerallocationpolicies.h:347] ShooterGameServer.exe!UPrimalInventoryComponent::AddCustomFolder() (0x00007ff6e3e0e309) + 68 bytes [h:\trunk\projects\shootergame\source\shootergame\private\primalinventorycomponent.cpp:5541] ArkAdvert.dll!Hook_APrimalDinoCharacter_TameDino() (0x00007ff9e47d6a51) + 208 bytes [C:\Users\Riley\source\repos\Ark-Server-Plugins-master\SomeHooks\ArkAdvert\ArkAdvert.cpp:90] ShooterGameServer.exe!AShooterPlayerController::ForceTame() (0x00007ff6e40ae3f5) + 31 bytes [h:\trunk\projects\shootergame\source\shootergame\private\shooterplayercontroller.cpp:6064]
Avatar
actually you dont need to, indeed
Avatar
same crash stack 😦
Avatar
just in case you tried pointer too? 🙂
Avatar
Yes, as the &FString(TEXT("")) and FString* text = (FString*) FMemory::Malloc(sizeof(FString)); text->Empty(); text->Append("some text");
6:08 PM
6:08 PM
the function is a mess in IDA LUL
Avatar
actually you didnt call constructor
Avatar
isn't that what new is for?
Avatar
but you use malloc
Avatar
you told me to use malloc
6:09 PM
new also was crashing
6:09 PM
but I had a paired delete
Avatar
yes but now you need to call constructor manually heh
Avatar
how?
6:09 PM
Should I just try new, and not pair it with delete?
Avatar
new (text) FString();
6:09 PM
placement new
Avatar
oh, do it like that for the pointer version
6:10 PM
I'll try it
6:10 PM
auto text = new ("test") FString(); AddCustomFolder_original(_this, text, InventoryCompType);
6:10 PM
for pointer version?
6:11 PM
no
6:11 PM
its variable, not "test"
Avatar
oh
Avatar
you dont event need auto text = part (edited)
Avatar
you want me to FMalloc then do this
6:11 PM
?
Avatar
so
6:12 PM
auto text = (FString*)FMemory::Malloc(sizeof(void*)); new (text) FString();
6:12 PM
just sizeof FString
Avatar
since the API version is using the byval version, I'll do it in the hook and re-enable the hook
6:13 PM
auto text = (FString*)FMemory::Malloc(sizeof(FString)); new (text) FString(); AddCustomFolder_original(_this, text, InventoryCompType);
6:14 PM
so do I always have to do auto text = (FString*)FMemory::Malloc(sizeof(FString)); new (text) FString(); and never just use new (for not malloc)? (edited)
Avatar
ye try
Avatar
well
6:15 PM
6:15 PM
it didn't crash
6:15 PM
!
6:15 PM
so i may ask you
6:15 PM
earlier I had done
6:16 PM
FString* test = new FString();
6:16 PM
but I had delete test after the AddCustomFolder_original call
6:16 PM
do you think that was why there was the crash, and not because I did FString* test = new FString();?
Avatar
because you used new
Avatar
yes, but from what I understand new is essentially the same as malloc and new (var) <T>
6:18 PM
placement new doesnt alloc anything (edited)
Avatar
is there a more terse way of doing auto text = (FString*)FMemory::Malloc(sizeof(FString)); new (text) FString();
6:19 PM
?
Avatar
except writing your own new? 🙂
Avatar
hm, maybe it should be something in the api in a future release.
6:21 PM
it would help with other people running into this issue too I think.
6:21 PM
should I be freeing this pointer btw?
6:21 PM
Or did you say that the callee is doing it?
6:22 PM
6:22 PM
but it does work now.
Avatar
old one yes
Avatar
auto text = (FString*)FMemory::Malloc(sizeof(FString)); new (text) FString(); text->Append("Happy"); AddCustomFolderHook(_this->MyInventoryComponentField(), text, 768);
6:34 PM
crashes monkaH (edited)
6:34 PM
this is being called from a diff. hook.
6:34 PM
I'm calling the hook right now because your def. of the function is incorrect
Avatar
change it 🙂
Avatar
then i have to recompile the lib CmonBrug
6:35 PM
I will later
6:35 PM
but if AddCustomFolderHook keeps crashing I might have to now
Avatar
no you dont
Avatar
I went ahead and fixed it
6:37 PM
auto text = (FString*)FMemory::Malloc(sizeof(FString)); new (text) FString(); text->Append("Happy"); _this->MyInventoryComponentField()->AddCustomFolder(text, 768);
6:37 PM
will see if this crashes now
6:40 PM
@Michidu
6:40 PM
nope
6:40 PM
6:40 PM
😦
6:40 PM
same
6:40 PM
ShooterGameServer.exe!FMallocBinned::Realloc() (0x00007ff6e4aa4573) + 0 bytes [h:\trunk\engine\source\runtime\core\public\hal\mallocbinned.h:1026] ShooterGameServer.exe!FHeapAllocator::ForAnyElementType::ResizeAllocation() (0x00007ff6e3c02125) + 43 bytes [h:\trunk\engine\source\runtime\core\public\containers\containerallocationpolicies.h:347] ShooterGameServer.exe!UPrimalInventoryComponent::AddCustomFolder() (0x00007ff6e3e0e309) + 68 bytes [h:\trunk\projects\shootergame\source\shootergame\private\primalinventorycomponent.cpp:5541]
Avatar
you changed function declaration?
Avatar
yes
6:41 PM
void AddCustomFolder(FString* CFolder, int InventoryCompType) { NativeCall<void, FString*, int>(this, "UPrimalInventoryComponent.AddCustomFolder", CFolder, InventoryCompType); }
6:42 PM
it worked when it was doing auto text = (FString*)FMemory::Malloc(sizeof(FString)); new (text) FString(); in the hook
6:42 PM
do you think there's something alloc'ed into mem before this function is run?
Avatar
you should directly call your hook
Avatar
I did, that also crashed
Avatar
i mean when you call function, you actually call your hook
Avatar
I meant to say, when I did it in the hook, from the context of the hook being triggered by the game, it worked (edited)
6:44 PM
when I do the same FString setup in my own custom function and call the function from that context, it crashes (edited)
Avatar
should be exactly same however
6:45 PM
maybe disable your hook
Avatar
could this be related?
6:46 PM
if ( this->vfptr[3].GetPerfObjectBulkDataPath((UObjectBase *)this, (FString *)(unsigned int)InventoryCompType) )
6:47 PM
InventoryCompType
6:47 PM
int InventoryCompType
6:47 PM
I'm not sure what InventoryCompType is supposed to be set to. When I logged it, it had a value of 768
6:47 PM
but I call with that value and it crashes, even when the FString should be properly setup
6:50 PM
the crash stack says it crash on AddCustomFolder()+68
6:50 PM
which points to here
6:50 PM
6:51 PM
which is
6:51 PM
FHeapAllocator::ForAnyElementType::ResizeAllocation( (TAlignedHeapAllocator<0>::ForAnyElementType *)&_this->DisplayDefaultItemInventoryCount, v10, v8, v9)
Avatar
it has to do something with that resize again
6:54 PM
weird why it works in the hook
6:57 PM
however if you call func by yourself it doesnt work at all?
6:57 PM
even in hook
Avatar
It works in the hook
6:58 PM
if I call by func
6:58 PM
void AddCustomFolderHook(UPrimalInventoryComponent* _this, FString* CFolder, int InventoryCompType) { char buffer[1024]; sprintf_s(buffer, "Logged Data %s %i", CFolder->ToString(), InventoryCompType); Log::GetLog()->log(spdlog::level::info, "[DEBUG] Add Custom Folder was called."); Log::GetLog()->log(spdlog::level::info, buffer); if (CFolder->ToString() == "dbl") { auto text = (FString*)FMemory::Malloc(sizeof(FString)); new (text) FString(); text->Append("Happy"); AddCustomFolder_original(_this, text, InventoryCompType); } return AddCustomFolder_original(_this, CFolder, InventoryCompType); }
6:59 PM
if I make folder called dbl, it will make both the dbl folder and one called Happy
6:59 PM
this works, no crash
6:59 PM
each time I log the value of InventoryCompType
6:59 PM
6:59 PM
it's 768 so
6:59 PM
blobshrug
Avatar
hm makes no sense
7:13 PM
only int and UPrimalInventoryComponent could be different
Avatar
you don't think UPrimalInventoryComponent is invalid?
7:14 PM
I call this on tame
7:14 PM
APrimalDinoCharacter_TameDino_original(_this, ForPC, bIgnoreMaxTameLimit, OverrideTamingTeamID, bPreventNameDialog, bSkipAddingTamedLevels); if (_this->MyInventoryComponentField() != nullptr) { //stuff }
7:14 PM
maybe MyInventoryComponentField is a valid ptr, but isn't ready yet?
Avatar
its possibly actually
Avatar
will test with
7:18 PM
void Hook_UPrimalInventoryComponent_RemoveCustomFolder(UPrimalInventoryComponent* _this, AShooterPlayerController* PC, FString FolderName, int InventoryCompType) { UPrimalInventoryComponent_RemoveCustomFolder_original(_this, PC, FolderName, InventoryCompType); ArkApi::GetApiUtils().SendChatMessageToAll("Server", "A Dino Was Tamed!"); auto text = (FString*)FMemory::Malloc(sizeof(FString)); new (text) FString(); text->Append("Happy"); _this->AddCustomFolder(text, 768); }
7:18 PM
since this would imply the inv. is ready for folders (can't remove if you can't add)
Avatar
Well this was never called
7:51 PM
But I think it's the inventory comp
7:52 PM
I tried to add a folder with invalid int, no crash
Avatar
you can try timer
8:04 PM
delayexecute exactly
Avatar
@Michidu how to use?
Avatar
Its in Timer class
8:21 PM
?
8:23 PM
and use like
8:23 PM
Timer(3000, true, &doFolder, _this);
8:23 PM
?
Avatar
Actually you can try this But i was talking about other timer class
Avatar
well, it crashed
8:29 PM
what was the other one, can you show me an example?
Avatar
API::Timer::Get().DelayExecute(&TimerCallBack, 10, _this, target);
Avatar
i will try that
Avatar
@Michidu I tested (edited)
4:50 AM
still crashed
4:50 AM
4:50 AM
same stack
4:50 AM
VERSION: 301.2 ShooterGameServer.exe!FMallocBinned::Realloc() (0x00007ff728c422a3) + 0 bytes [f:\build\trunk\engine\source\runtime\core\public\hal\mallocbinned.h:1026] ShooterGameServer.exe!FHeapAllocator::ForAnyElementType::ResizeAllocation() (0x00007ff727dea915) + 43 bytes [f:\build\trunk\engine\source\runtime\core\public\containers\containerallocationpolicies.h:347] ShooterGameServer.exe!TArray<FString,FDefaultAllocator>::Emplace<FString const & __ptr64>() (0x00007ff727e79724) + 0 bytes [f:\build\trunk\engine\source\runtime\core\public\containers\array.h:1303] ShooterGameServer.exe!UPrimalInventoryComponent::AddCustomFolder() (0x00007ff7280080a3) + 0 bytes [f:\build\trunk\projects\shootergame\source\shootergame\private\primalinventorycomponent.cpp:5542]
4:50 AM
😦
4:51 AM
void doFolder(APrimalDinoCharacter* _this) { auto text = (FString*)FMemory::Malloc(sizeof(FString)); new (text) FString(); text->Append("Happy"); _this->MyInventoryComponentField()->AddCustomFolder(text, 768); } void Hook_APrimalDinoCharacter_TameDino(APrimalDinoCharacter* _this, AShooterPlayerController* ForPC, bool bIgnoreMaxTameLimit, int OverrideTamingTeamID, bool bPreventNameDialog, bool bSkipAddingTamedLevels) { APrimalDinoCharacter_TameDino_original(_this, ForPC, bIgnoreMaxTameLimit, OverrideTamingTeamID, bPreventNameDialog, bSkipAddingTamedLevels); API::Timer::Get().DelayExecute(&doFolder, 5, _this); if (_this->MyInventoryComponentField() != nullptr) { ArkApi::GetApiUtils().SendChatMessageToAll("Server", "A Dino Was Tamed!"); } else { Log::GetLog()->log(spdlog::level::info, "[DEBUG] NULL Inventory Comp!"); } Log::GetLog()->log(spdlog::level::info, "[DEBUG] Tame Dino was called."); }
Avatar
Hi all I'm working with IDA and I have expressions like this *(double*)(((__int64(__fastcall*)(APrimalCharacter*))this->vfptr[6].RegisterDependencies)(this) + 2664) Does anyone know ways to translate it (manually, of course) into readable representation? RegisterDependencies is a member function of UStruct but UStruct doesn't related with APrimalCharacter is I seen in the Api's code
Avatar
It's calling a virtual function pointer
3:31 AM
Basically, it's gonna be aids to properly figure out
3:33 AM
IDA is a static code analysis tool, you maybe be able to attach a debugger to the game with a break point on the address to find the address of the function (edited)
3:34 AM
Then you could analyze the function
3:35 AM
You'd want to do this with be disabled and -insecure (disables vac) and on a 2nd acct for good measure
Avatar
Will try, thanks @substitute
Avatar
@Michidu
6:19 PM
!
6:19 PM
I think I have found why the folder causes a crash 😦
6:20 PM
the interface that is called IDataListEntryInterface::AddCustomFolder does v3 = v2->Data.AllocatorInstance.Data; where v3 is an FScriptContainerElement* and v2 is the FString*
6:20 PM
and then
6:20 PM
if ( v3 ) { v4 = GMalloc; if ( !GMalloc ) { GCreateMalloc(); v4 = GMalloc; } ((void (__fastcall *)(FMalloc *, FScriptContainerElement *))v4->vfptr[2].Exec)(v4, v3); }
6:21 PM
I think my v3 isn't valid for the ((void (__fastcall *)(FMalloc *, FScriptContainerElement *))v4->vfptr[2].Exec)(v4, v3);
6:21 PM
The only thing I can think of now is having a break point to see how the virtual function works.
6:22 PM
But I am thinking the virtual function is adding a special inventory "item" that shows as a folder, that is the only thing I can think of right now.
6:22 PM
Or that there is a field on the dino for folders. This may be a function that we will have to implement manually since the game seems to use bp code for it (?)
Avatar
that function is malloc most likely
Avatar
hm, well I may just put a debugger onto the exe and see what the stack is during RIP
6:32 PM
@DevCPP You can also see if this helps
6:32 PM
IDAPython tool for creating automatic C++ virtual tables in IDA Pro - 0xgalz/Virtuailor
Avatar
Spikeydragoon 12/1/2019 2:36 AM
is there anything special you have to do to cast a string to a FString*
Avatar
use .c_str() (edited)
Avatar
Spikeydragoon 12/1/2019 8:44 AM
yeah was given error so changed to this and seams to work fine FString* fblueprint = (FString*)blueprint.c_str();
Avatar
Uh what
5:31 PM
c_str() is for getting a c string not an FString (edited)
Avatar
it's how you convert std::string into FString
Avatar
Well, not exactly. You’re creating a c string from your std::string. FString has a conversion from c styled strings to FStrings built in. It’s not std::string to FString, it’s std::string to c string which then creates a new FString from the c string.
5:35 PM
It’s an indirect cast
5:36 PM
If the user was using c strings (char[]) there’d be no need to do this extra step
Avatar
Spikeydragoon 12/1/2019 9:34 PM
@substitute So the above is wrong? If so how should it look?
Avatar
it's not
9:38 PM
looks correct
Avatar
@Spikeydragoon itll work just fine
12:16 AM
I was simply explaining some of the more specific info about it
Avatar
Spikeydragoon 12/2/2019 12:17 AM
Ah got ya.
Avatar
there's an extremely small amount of extra overhead converting to the c str then to FString
12:19 AM
There *might* be a native std::string to FString in FString that would be faster
12:19 AM
but if not, it doesn't matter too much unless you're making millions and millions of string conversions a tick
12:21 AM
c strings are char[], std::string is an object, and FString is an object with the contents of the string being TCHAR[]
12:22 AM
not sure how std::string stores it's contents, could be char[], then in which case .c_str() could be returning the char[] directly instead of making a copy.
Avatar
I'm making my first Ark Plugin. Followed the ArkApi Basic Google Doc guide to get Visual Studio setup properly. Read through the ArkApi-Tutorials-And-Guides Github. Checked through the Discord here. Is there anywhere I can find guides to help me after that? Ideally a project I can replicate to get an idea of what file structure I should use, how to compile and test my plugin. That sort of thing.
Avatar
I'll second @Sleepy request. I would like a guide showing the compile and test.
Avatar
you compile it like any other project though 😄
4:14 PM
directory structure is up to you
4:14 PM
if you followed the ArkApi basic doc then you should have everything ready for compilation anyway
Avatar
WETBATMAN are there code examples somewhere? Or a list of the functions for ArkApi? I found your suicide code from a year~ ago. It talks about removing the command in void unload but I'm not familiar with how to do that.
Avatar
Server Plugins for ARK: Server API. Contribute to Michidu/Ark-Server-Plugins development by creating an account on GitHub.
C++ Plugins for Ark Server API: https://github.com/Michidu/ARK-Server-API/ - ownprox/ArkServerApi
Avatar
@Sleepy it unloads the command loaded by the plugin
4:44 PM
in case the plugin is unloaded by the user without restarting the server
Avatar
Thank you!
Avatar
I have been looking through the API and drawing a blank. If I want to find a dinosaur's stat's how would I do that? Is it related to APrimalDinoCharacter? For example, if I have a tame in-game the Awesome Spyglass shows the stats like HP of 29 points. How do I access that variable via the API?
Avatar
Is it maybe with GetCharacterStatusComponent()? Am I on the right track?
Avatar
yes but i couldn't find how to get exactly same value as from Spyglass, possibly it does some calculations (edited)
Avatar
@Michidu how do the values differ? Does it return the numbers like 29HP and 32M but different absolute HP number and different melee percentage? Or....?
Avatar
well, if you need absolute stat value (like 782 hp) then its easy to get
Avatar
I want to get the points (like 29HP) for my purposes
Avatar
probably you have to do some calculations to get it
Avatar
you want to get how many points in each stat ? @Sleepy
10:02 AM
if so i remember i did that somehow without any calculations
10:02 AM
i think it’s stored in the dino’s status component
Avatar
is it points? i thought it's some base stat value
Avatar
@WETBATMAN yes, just read how many points in each stat. So if points are less than X run some code. Or if they're higher than X print an error in chat. Where X is defined in a config file for the server owner to configure.
Avatar
@Michidu @Sleepy there is a points value
Avatar
@substitute any tips for accessing the points value?
Avatar
I would like to help you
11:57 PM
But I think my psu just died
11:58 PM
Not even fucking kidding
Avatar
FeelsBadMan Hope your PSU is saveable. Or the replacement arrives quickly :/
Avatar
it was actually the GPU
6:44 PM
it exploded
Avatar
@Sleepy
3:57 AM
3:57 AM
one of the IC chips blew on the GPU
3:57 AM
gonna replace it sometime in the future
Avatar
Even more expensive to replace than a PSU :( Hope the rest of your PC is okay.
Avatar
PapaManu | Chaindog 12/15/2019 6:59 PM
As long as your motherboard didn't catch on fire, like mine did some years ago... 😂
Avatar
@Sleepy @PapaManu | Chaindog
7:23 PM
Everything else was fine, replaced it with a 2070 SUPER
7:23 PM
7:23 PM
I'm going to try to replace this chip as well so that I'll have the 980ti as a spare.
Avatar
Hello, how would you do to make a casino system for a discord server of the Ark, Currency & Kits plugin?
7:41 PM
With c++
Avatar
Mr. Whitlock 12/16/2019 10:46 PM
quick question: would it be possible to alter the server capacity past 70?
Avatar
yeah it can be whatever you want ? 😃
Avatar
@Mr. Whitlock that's literally an ini setting lol.
12:57 AM
no need for any plugins
12:58 AM
some officials even have a cap of 100 players
Avatar
Mr. Whitlock 12/17/2019 2:42 AM
ooooh lol
2:42 AM
i thought there was a hard coded server cap
Avatar
@Sleepy status->NumberOfLevelUpPointsAppliedField()() will give amount of points applied, if you still need it (edited)
Avatar
Tysm Michidu!
Avatar
Is it possible to create a mindwipe plugin for dino? (edited)
Avatar
Does anyone with Database knowledge want to help me?
Avatar
what u need ?
Avatar
figured it out already, sorry
Avatar
@Bitou2k it should be
Avatar
is it very difficult to port apis from ark to atlas?
Avatar
@HaLCoN depends
Avatar
I don't know if it goes against any discord rule. I apologize if I break it. The api that I need to port this https://ark-server-api.com/resources/safezones.2/
SafeZones Source: Click Here Features: Prevent PVP in certain area's Prevent Building in certain area's Prevent Structure damage in certain area's Notifications on Entering and Leaving SafeZone area's Ability to restrict players from...
5:54 PM
I need someone to port, I'm willing to pay for it.
Avatar
oh
6:06 PM
you mean plugin, not api code
6:07 PM
You'd need the source-code first (but I think Michidu posts it on their Github)
6:07 PM
yes
6:08 PM
is this all your wonderful collection
6:08 PM
But I urgently need the safe zone plugin
Avatar
why not give it a shot yourself?
6:13 PM
the project should compile from the Github, try changing the target from Ark to Atlas.
6:13 PM
might work out-of-box.
Avatar
I have no idea and I don't know where to start
6:19 PM
I would like to learn but I can't find a guide
Avatar
Argh, to those who read my other messages (deleted), I could not compile because on this new project I forget to choose Release x64. Grrrr. Such a newb. 🤦‍♂️
Avatar
Giant Ginger 1/4/2020 3:59 AM
Not sure if this is the proper place for this question but I’m in a bind. Is there anyway I can effectively force mindwipe all players on my server?
3:59 AM
Any help is greatly appreciated
Avatar
Hey I’m a server owner and I was wondering if anyone here could help me with some coding as I am trying to make my server we’re players get instant level ups upon joining and creating a survivor can anyone help me??
Avatar
MindDragon 1/9/2020 9:55 PM
ArkBot 1.91 RC has released! Download is available here: https://github.com/ark-mod/ArkBot/releases Please check the github for complete change notes as the list is too large to paste here. Thanks!
ARK Survival Evolved application that monitors and extracts data from local ARK servers and exposes this data through a Web App, Web API and Discord Bot. Provides important functions to players: di...
Avatar
could someone change this ark plugin to make it work atlas?
8:02 PM
Feel free to join my Discord Server! PointLimiter This plugin is designed to cap the stats of players and dinos. The config should be self explanatory. ...Besides the fact that values below 0 Means the is no Limit (-1 for convention) Anything...
Avatar
GormusSenex 1/12/2020 1:47 PM
Is there any way to get some sort of unique server id in a cluster, ie. ip + port, from the ArkApi ? Im currently using ArkApi::Tools::GetCurrentDir() to get some sort of distinction between the servers (cuz they r on the same hardware), but that wouldnt work across hardware if installed in the same way. Also Im not sure it would work if u have made symlinks instead of server folders.
Avatar
You could try to get the ip/port from the object directly
5:26 PM
I think it might be in the game mode object
5:26 PM
You’ll have to look
Avatar
GormusSenex 1/12/2020 7:51 PM
ty. But what about this one: ArkApi::GetApiUtils().GetShooterGameMode()->ServerIDField() ? I only have one server atm so cant check if its unique...
7:55 PM
i tried looking for ip and port in GameMode but to no avail, except RCONPortField
Avatar
ShooterGameMode* aShooterGameMode = ArkApi::GetApiUtils().GetShooterGameMode(); FString result; aShooterGameMode->GetNetworkNumber(&result);
7:56 PM
this gets you the game port
Avatar
GormusSenex 1/12/2020 7:57 PM
👍 tyvm
Avatar
to get server IP you can make a request to https://api.ipify.org?format=json
Avatar
GormusSenex 1/12/2020 7:58 PM
ohh ye ofc. didnt think about asking out 😄
7:58 PM
this is kewl ! ive been looking a.k.a. googling for hrs upon hrs 😄
Avatar
hehe hope this helps you out
Avatar
GormusSenex 1/12/2020 7:59 PM
it most certainly will 🤩
Avatar
@GormusSenex
3:39 AM
Lazy mode would be a json blob in the root dir of the server
Avatar
GormusSenex 1/13/2020 7:20 AM
I dont think that would work if server folders are symlinked. Unless, ofc, one can place such a file in the savefolder and access it... Hmm... 🤔
Avatar
GormusSenex 1/13/2020 10:48 AM
ohh nvm. u meant the ip in a json file. not the port. gotcha 🙂
Avatar
No I meant whatever identification you wanted in a json blob
5:46 PM
Could also instead put whatever identification you want as a custom ini field
Avatar
GormusSenex 1/14/2020 12:01 PM
wouldnt that go against the current way of implementing plugins ? i mean, currently (after installed the api ofc) u can simply install a plugin by copy/paste to the plugin folder which is simple and clean. making a what-to-do-next list is ofc possible, but i dont think i like breaking the concept of installing plugins. maybe its just me tho 😉 (i donno if other plugins require one to do that anyway)
Avatar
it's advised to keep everything inside plugin folder 🙂 otherwise, getting a server port should be a good way of identification of the server in cluster
Avatar
GormusSenex 1/14/2020 12:07 PM
The master has spoken, and so it shall be... 😉
Avatar
lol also you can try this function FString server_addr; ArkApi::GetApiUtils().GetWorld()->GetAddressURL(&server_addr); should give ip with port
Avatar
GormusSenex 1/14/2020 12:11 PM
I did see that one but didnt test it hence the url in the function name. gonna try it out 👍
Avatar
GormusSenex 1/14/2020 12:22 PM
Ohh, didnt work. Only got this:
12:22 PM
w8... could it be becuz it cuts off some of it tho ?
Avatar
ah, i remember i was using it at some point weird, because they have a place for ip in the string
12:25 PM
possible they removed it
Avatar
GormusSenex 1/14/2020 12:30 PM
Funny enuf, Webbatmans suggest gives almost the same:
12:33 PM
Then I could ask out for IP but that would give a dependency i don't like... hmm 🤔
Avatar
a site you mean?
Avatar
GormusSenex 1/14/2020 12:34 PM
ye. batman actually also suggested that.
Avatar
well, that looks fine actually
Avatar
GormusSenex 1/14/2020 1:28 PM
cant I include <curl/curl.h> and <atlstr.h> in a plugin ? it makes a libcurl.dll in the output nicely and everything compiles with no errors, but the plugin wont start ?
Avatar
why are you including curl ?
1:28 PM
API already has it
Avatar
GormusSenex 1/14/2020 1:28 PM
to ask out for the ip
1:28 PM
ohh
Avatar
use Requests.h
1:29 PM
API::Requests::Get().CreateGetRequest("https://api.ipify.org?format=json", std::bind(&GetServerIP, std::placeholders::_1, std::placeholders::_2));
1:29 PM
GetServerIP would be your function
1:32 PM
void GetServerIP(bool success, std::string response) { if (success) { if (response != "") { try { nlohmann::json parsedResponse = nlohmann::json::parse(response); const std::string sIP = parsedResponse.value("ip", nlohmann::json::object()); } catch (const std::exception& error) { Log::GetLog()->error(error.what()); } } } } (edited)
Avatar
GormusSenex 1/14/2020 1:33 PM
why not just ask directly on https://api.ipify.org/ ? gives nothing but an ip string ?
Avatar
could also do that 😛
1:33 PM
sometimes i've had it return something other than a json object here though
1:34 PM
looks like if it errors out API returns the error code
1:34 PM
so it wouldn't parse in that case
Avatar
GormusSenex 1/14/2020 1:34 PM
ahh
Avatar
GormusSenex 1/14/2020 1:44 PM
woot it works !! tyvm. i just have to figure out why i have to call my function twice be4 the ip actually gets saved... ngl, c++ is NOT my strong side so shit takes time 😄
1:48 PM
ohh its an async call im guessing...
Avatar
yeah the request is async
1:53 PM
how do you save the IP ?
Avatar
GormusSenex 1/14/2020 1:53 PM
global variable from inside GetServerIP. im looking at the <future> library now
Avatar
hm and what's the problem ?
Avatar
GormusSenex 1/14/2020 1:55 PM
i write it immediately to chat after call which ofc wont show anything until the response is parsed 🙂
Avatar
send it to chat from request
Avatar
GormusSenex 1/14/2020 1:56 PM
sending to chat is just for my testing purposes. wont be the end result. but i wanna make sure my code dont continues executing while an async call is being performed
Avatar
yea what you could do is get the server port in the request
1:57 PM
call the request on plugin load
1:58 PM
then call the function you need to do something with this data from the request
1:59 PM
or set a bool from within the request
1:59 PM
then check if this bool is true (indicating the request finished) before moving on
Avatar
GormusSenex 1/14/2020 1:59 PM
ohh and then a while loop ? thats a hack but ye.. will work 😄 (edited)
Avatar
yea something like that 😛
Avatar
GormusSenex 1/14/2020 2:01 PM
needs to be a modified while tho with timestamp so incase that site is down it wont w8 forever
2:01 PM
but that will work. a hack, but should work 😄
Avatar
count how many times the request was sent
2:01 PM
if over some num set the bool to true
Avatar
GormusSenex 1/14/2020 2:04 PM
i like timestamps more. i remember doing counts as "timestamps" back on 8086 and my program/game didnt work anymore moving to a better pc 😂
Avatar
GormusSenex 1/14/2020 4:39 PM
couldnt make it so it checked for the async value. so now i'll just keep it in the load method and if something tries accessing the ip value and its empty i'll log an error. 🙄
Avatar
@GormusSenex
6:43 PM
are you binding 0.0.0.0?
6:43 PM
you could try to bind the actual IP address explicitly
6:43 PM
as 0.0.0.0 actually binds to all addresses on the machine.
6:44 PM
https://en.wikipedia.org/wiki/0.0.0.0#As_a_host_address In the context of servers, 0.0.0.0 can mean "all IPv4 addresses on the local machine". If a host has two IP addresses, 192.168.1.1 and 10.1.2.1, and a server running on the host is configured to listen on 0.0.0.0, it will be reachable at both of those IP addresses.
In the Internet Protocol Version 4, the address 0.0.0.0 is a non-routable meta-address used to designate an invalid, unknown or non-applicable target. This address is assigned specific meanings in a number of contexts, such as on clients or on servers.
6:45 PM
The game may be simply returning what address you are binding with.
Avatar
GormusSenex 1/14/2020 6:45 PM
Im not sure how that would work or how to set it up.
Avatar
It should be in the configuration of your server
Avatar
GormusSenex 1/14/2020 6:46 PM
Im alrdy struggling with c++. No need for more complexity 😂
6:46 PM
If google charged me for every search I would be homeless 😄
Avatar
nah it should be an easy option
7:01 PM
like -port
7:01 PM
because normally it isn't really possible to easily know the external IP of the server
7:02 PM
(Especially if it's behind NAT, but I am assuming you're using a dedicated IP for the machine.)
Avatar
Where does one go to see all the listed hooks/events ?
Avatar
every function can be hooked
Avatar
Ah ok, but what i was refering to is more predefined ones like AShooterCharacter_Die, APrimalCharacter_TakeDamage declared in the DECLARE_HOOK(name,return_type) method
Avatar
you can create them easily, it consists of name (any), return type and arguments
6:03 PM
@KillZone
6:04 PM
made by ownprox
Avatar
Errr is there a source code somewhere for that exe or is it on a "here you go " basis ?
6:06 PM
@WETBATMAN
6:07 PM
Also thanks @Michidu but i was refering to exactly what this exe does
Avatar
Server Api Creator Tool Source Overview: this tool allows you to quickly generate hooks for in game server functions saving you a lot of time of having to lookup the argument's / structure's / class's manually. Features: Ark & Atlas Api...
6:08 PM
my bad lol
Avatar
it does exactly same just automatically 🙂
Avatar
Alright will read into these thanks! peepoheart
Avatar
@GormusSenex
6:59 PM
try -serverip=
6:59 PM
with your WAN address
6:59 PM
And then maybe it won't return 0
Avatar
GormusSenex 1/16/2020 7:00 PM
ohh ill try that 👍
Avatar
because without -serverip=
7:01 PM
I can only assume they bind to 0.0.0.0
7:01 PM
which as an int long would be 0 (edited)
7:02 PM
At least then you won't have to make (and cache) an HTTP request that could fail.
Avatar
GormusSenex 1/16/2020 7:03 PM
ye, that would be much better ngl
Avatar
This is on a machine that isn't behind NAT right?
7:04 PM
If it's not being NAT and has a routable IP this solution should "just work"
Avatar
GormusSenex 1/16/2020 7:06 PM
it is currently. but i have to setup nat loopback anyway somehow
Avatar
GormusSenex 1/16/2020 11:57 PM
@substitute didnt give me ip. could be ive set up nat loopback wrongly tho which prolly is the case becuz i started up a 2nd server clustered to the 1st one to c if i could transfer, and i couldnt - so the loopback is either setup wrongly or dont work anymore.
Avatar
Does it give anything
2:54 AM
Or just 0
Avatar
GormusSenex 1/17/2020 10:38 AM
just 0
10:39 AM
i tried seting the ip as the ip with punctuation, and as the long value of the ip. nothing worked
Avatar
GormusSenex 1/17/2020 11:40 AM
ok spoke to one of my collegues. i did set up the nat loopback correctly, but just tested it wrongly. gonna test it after work. (edited)
Avatar
Hi guys, still trying to break into this. Digging into OwnProx's code, and many others. Learning c++ while I go. But can someone answer me one question. Do you ALWAYS need to create a hook to be able to get data from the engine?
Avatar
@Schmevn
5:34 AM
To some extent .... yes.
5:34 AM
Technically a mod could hook whatever you wanted and send HTTP POST requests
5:35 AM
but you're just hooking via a normal mod instead of a plugin.
Avatar
bot really
8:18 AM
if you want your mod to be stackable you are only able to use event listeners
8:19 AM
which are pretty limited
8:19 AM
if you actually override a function then you’re overriding primalGameData and you’ll break other mods (possibly)
Avatar
@substitute @WETBATMAN thank you for the replies. I'll create a hook and see about getting data I'm looking for. Thank you.
Avatar
GormusSenex 1/18/2020 3:13 PM
I'm hooking into AShooterGameMode.AddNewTribe. Inside that I need the tribe id, but I'm guessing the tribe isn't really created at that point or what ? Hook_AShooterGameMode_AddNewTribe(AShooterGameMode* _this, AShooterPlayerState* PlayerOwner, FString* TribeName, FTribeGovernment* TribeGovernment) const uint64 steamId = ArkApi::IApiUtils::GetSteamIdFromController(PlayerOwner->GetOwnerController()); auto playerId = _this->GetPlayerIDForSteamID(steamId); auto tribeId = _this->GetTribeIDOfPlayerID(playerId); (edited)
3:15 PM
Is there a GetTribeIdFromTribeName-ish ?
Avatar
exec original function first
Avatar
GormusSenex 1/18/2020 3:28 PM
ahh ofc 🙄 ty 😄
3:33 PM
Yup, worked ofc. Ty 🙂
Avatar
GormusSenex 1/18/2020 8:13 PM
omfg ! setting player pos is the obvious SetPlayerPos, but getting it... DefaultActorLocationField wtf ?!? 👿
Avatar
just ark lol
Avatar
@Michidu Hello, can you upload the source code of Atlas Permissions
7:00 PM
I need to compile using vs 2017
Avatar
it always was open source
Avatar
There seems to be no update now
Avatar
permissions have 2 versions
9:56 AM
I checked it again
Avatar
it's two in one
9:56 AM
you just have to choose ark or atlas configuration when compiling
Avatar
But atlas permissions was updated once in September
Avatar
possible it wasn't source code related update
10:00 AM
What I compiled with vs 2017 can't be used
Avatar
why?
10:06 AM
I installed vs2019 and it will crash
10:06 AM
I changed to vs2017 problem solving
10:08 AM
vs2019 crash log
10:08 AM
10:09 AM
atlas
Avatar
not sure, i'm compiling it using 2019 version
10:16 AM
should be no difference
10:18 AM
Avatar
it says nothing, better see crash stack
Avatar
I suspect the problem is vs c ++ 2015-2019
10:19 AM
Avatar
no, i doubt its vs problem
10:20 AM
possible you didnt choose atlas
10:21 AM
dmp
10:21 AM
Avatar
i haven't touched atlas for quite some time but the current version on forum was compiled with 2019
10:23 AM
Well, I'll study it again
10:24 AM
10:25 AM
Source code missing 1.4 1.5 1.6
10:25 AM
only 1.4
Avatar
will check tbh i dont remember what was changed in 1.6
Avatar
this discord is for plugins not devkit modding
Avatar
AaronBasques 1/27/2020 6:16 AM
If anyone can give me an idea how i should get the tribe data of a tribe id (on or offline), i would be grateful, i'm a nub in C++ but learning. I have tried the following, but as soon as it hits the: GetOrLoadTribeData(...) the server crashes, no log or stack, just closes. AShooterGameMode* gameMode = ArkApi::GetApiUtils().GetShooterGameMode(); if (!gameMode) return; FTribeData* ftribe; if (gameMode->GetOrLoadTribeData(team.Key, ftribe)) { if (!ftribe || ftribe == nullptr) Log::GetLog()->debug("GetOrLoadTribeData(...) returned null for team {}", team.Key); else ownerID = ftribe->OwnerPlayerDataIDField(); } // also with : LoadTribeData(...) // Crash // : GetTribeData(...) // Crash
Avatar
it's tricky FTribeData* tribe_data = static_cast<FTribeData*>(FMemory::Malloc(0x200)); RtlSecureZeroMemory(tribe_data, 0x200); if (ArkApi::GetApiUtils().GetShooterGameMode()->GetOrLoadTribeData( teamId, tribe_data)) { // } FMemory::Free(tribe_data);
7:11 AM
also this function leaks memory as far as i know getting data of online tribe is easier however
Avatar
it does leak memory
8:08 AM
Adrian had this issue in AutoDecay
Avatar
AaronBasques 1/27/2020 8:16 AM
@Michidu Thanks for the pointer, would never of thought of that. @WETBATMAN any idea how Adrian avoided the memory leak? In his patch notes for AutoDecay, the last update says "finally resolved the RAM Leak - it came from an ARK internal function (yay)"
Avatar
he didn’t, he switched to using some other method (edited)
Avatar
AaronBasques 1/27/2020 8:18 AM
bummer, its a paid plugin too, not sure i'd get the answer if i asked
Avatar
what are you trying to do ?
8:18 AM
most likely there is an easier way to achieve what u want
Avatar
AaronBasques 1/27/2020 8:21 AM
get all the current tribes on the server and store it in a database, collecting alliances/relationships, dino count, basically as much as possible something akin to using the savegame toolkit to extract data
Avatar
maybe find all ShooterCharacters and get the data from them ?
Avatar
AaronBasques 1/27/2020 8:24 AM
would that work for offline players though?
Avatar
GormusSenex 1/27/2020 8:24 AM
why not read trough the .tribe files ?
Avatar
ShooterCharacter is there if you’re offline
Avatar
AaronBasques 1/27/2020 8:24 AM
you can read the .tribe files?
Avatar
although it would probably not exist if you’re dead
8:25 AM
ofc from a plugin you can do anything 😃
Avatar
GormusSenex 1/27/2020 8:25 AM
ive started c# one. ive read all except the alliances (havnt rly worked on that). but tribe log, members, owners, admins
Avatar
um
8:27 AM
ArkBot already has a core for doing all this
Avatar
AaronBasques 1/27/2020 8:27 AM
i wouldn't know where to begin on that yet. Its more than i had 10 minutes ago xD Much appreciated
Avatar
GormusSenex 1/27/2020 8:27 AM
haha rly ? 😄
Avatar
we’re looking for devs actually
Avatar
AaronBasques 1/27/2020 8:27 AM
Is ArkBot opensource?
Avatar
yes
8:28 AM
we’re looking for devs to expand the reading system
Avatar
GormusSenex 1/27/2020 8:28 AM
that would have been easier. buuut... its also fun to code and try to reverse the savefile 😂
Avatar
ArkBot reads from savefile
Avatar
AaronBasques 1/27/2020 8:29 AM
cool, will have to look more into this
Avatar
that’s it’s main issue ATM 😃
8:29 AM
we’re looking to move it to a plugin based data pull
Avatar
AaronBasques 1/27/2020 8:29 AM
thats where i was looking, rather than an external lib/exec
Avatar
it’s more like a standalone app tbh
8:30 AM
it hosts a website with the data it pulls from servers
Avatar
AaronBasques 1/27/2020 8:30 AM
ahh right
Avatar
@GormusSenex @AaronBasques if you guys want to help with this project i’ll tell SirShaw to give you dev roles
8:34 AM
driver code is c#
Avatar
GormusSenex 1/27/2020 8:34 AM
that tool gives quite a lot of info ngl
Avatar
AaronBasques 1/27/2020 8:35 AM
just poking around the git now, looks pretty large
Avatar
Hi, I'm new to ArkAPI and I'm looking for a plugin (or to make a plugin) that filters dino trasfers between clustered maps. anyone know of such a plugin?
Avatar
GormusSenex 1/30/2020 12:17 PM
filters dinos ?
12:18 PM
u mean so theres some dinos that cant transfer to X server but only to Y and Z server ?
Avatar
AaronBasques 2/3/2020 8:52 AM
anyone know how to read an .arktributetribe file?
Avatar
GormusSenex 2/3/2020 9:20 AM
not yet. gonna reverse that one when i get around to it 🙂
9:20 AM
so if u can wait... umm... 2-3 weeks then maybe 😂
Avatar
@GormusSenex
10:02 AM
Would the struct help you re it?
Avatar
GormusSenex 2/3/2020 10:02 AM
u got it ? would surely help a lot
10:02 AM
@substitute
Avatar
I have somewhere
10:06 AM
I’ll look tomorrow
10:06 AM
I just added another struct earlier
10:06 AM
See in #【💬】ɢʟᴏʙᴀʟ-ɢᴇɴᴇʀᴀʟ
Avatar
GormusSenex 2/3/2020 10:07 AM
approx how far back ?
Avatar
Like maybe 1-3 patches ago
Avatar
you probably just could call LoadTribeData
Avatar
@Michidu could be for external tools
10:17 AM
Would be silly to req booting a server to parse tribe data files (edited)
Avatar
there are a few libraries to do it, not sure if they still work however
Avatar
GormusSenex 2/3/2020 10:35 AM
If this is it @substitute u might as well have been writing chineese 😂 i cant even tell what this is...
10:36 AM
i scanned all ur posts and this i didnt understand at all so it could be that one ?
Avatar
substitute 2/3/2020 3:04 PM
@GormusSenex no I meant I did another struct recently
Avatar
AaronBasques 2/4/2020 9:40 AM
does anyone know how to convert a time double to unix epoch milliseconds/seconds? I've done a bit of searching but i may just be looking for the wrong thing. long double& LastNameChangeTimeField() ? >
Avatar
GormusSenex 2/4/2020 11:20 AM
found this, if long is milliseconds: #include <chrono> using namespace std::chrono; milliseconds ms = duration_cast< milliseconds >( system_clock::now().time_since_epoch() );
11:22 AM
Avatar
AaronBasques 2/4/2020 12:22 PM
i'm ok for getting the epoch from std::chrono, i use long time_stamp = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count() its converting from the return value of say LastNameChangeTimeField long double > long where long .. represents the unix epoch i've thus far not been able to find a solution I'm wondering how the game stores and uses its time values, are they consistent with real time, or some value based on the game "running" time where in game time stamps stop/pause while the server is offline and progress only while the server is operating. If they are consistent with real time i could extrapolate a unix time stamp from time based fields, if they are not then i have no idea how, other than capturing events where times are needed and generating a time stamp, storing them for later calls/checks. (edited)
Avatar
Returns time in seconds since world was brought up for play, IS stopped when game pauses, IS dilated/clamped
Avatar
GormusSenex 2/4/2020 12:48 PM
How would I get a blueprints max stack size ? And would it work with a stack mod ?
Avatar
you mean by BP path?
Avatar
GormusSenex 2/4/2020 12:49 PM
ye
12:50 PM
my initial idea was to add 1000000 into the inventory and then draw it back out to see how much i got back. but that doesnt seem like the right way
12:51 PM
and if char is slot-capped alrdy it wouldnt work either (edited)
Avatar
you dont have UPrimalItem ?
Avatar
GormusSenex 2/4/2020 12:52 PM
ig i can get that from the bp path ?
Avatar
if you have exact bp path, you can load it if not then for (TSubclassOf<UPrimalItem>& data : Globals::GEngine() ->GameSingletonField()->PrimalGameDataOverrideField()-> MasterItemListField()) { if (!data.uClass) continue; UPrimalItem* item = (UPrimalItem*)data.uClass->GetDefaultObject(true); if (!item) continue; item->MaxItemQuantityField() = 1000; item->InventoryRefreshCheckItem(); item->UpdatedItem(); }
12:53 PM
something like this
Avatar
GormusSenex 2/4/2020 12:54 PM
so even if i use a stack mod, i would get the stack size from item->MaxItemQuantityField() ?
12:55 PM
(im at work right now, just preparing for when i get home)
Avatar
hopefully 🙂
Avatar
GormusSenex 2/4/2020 12:55 PM
cool, ill try 👍
Avatar
i think ark supports overriding max stack size via config now, why still use mods?
Avatar
GormusSenex 2/4/2020 12:57 PM
ik, but it seems like a lot of work putting all bps into a json file and redo all weights etc. i would like that solution, ngl, but the work to get there is a bit... umm... boring and long 😄
12:57 PM
afaik u have to set it on each bp path
Avatar
could loop over MasterItemListField and generate config automatically for all items 🙂
Avatar
GormusSenex 2/4/2020 12:59 PM
hmm 🤔
Avatar
anyone know the hook for killing a dino?
Avatar
GormusSenex 2/4/2020 8:58 PM
hook_APrimalCharacter_die ?
Avatar
substitute 2/4/2020 9:40 PM
@GormusSenex
9:40 PM
there isn't a a struct for that file
9:40 PM
i believe it's just an AOB
Avatar
GormusSenex 2/4/2020 9:44 PM
its different from file to file so prolly a pointer of some sort to the main savefile.. i donno
Avatar
substitute 2/4/2020 9:45 PM
it doesn't touch the main save
9:45 PM
how would transfers work?
Avatar
GormusSenex 2/4/2020 9:45 PM
ohh wait. i had the main save file in mind. nvm (edited)
Avatar
substitute 2/4/2020 9:45 PM
they're almost the same from what I've seen
Avatar
GormusSenex 2/4/2020 9:46 PM
r we talking about the arktribetribute or the savefile now ? 🤔
Avatar
substitute 2/4/2020 9:46 PM
ark tribute
Avatar
GormusSenex 2/4/2020 9:49 PM
could still be a pointer of some sort to the cluster-save file. isnt the cluster save file saved as <steamid>. so if that file holds all data from all servers and the arktribetribute from each server points to a location in the cluster file ? hell, i donno...
9:49 PM
nvm. doesnt make sense since its uploaded
9:49 PM
hmm
Avatar
GormusSenex 2/7/2020 12:03 AM
@Michidu u gave me this : for (TSubclassOf<UPrimalItem>& data : Globals::GEngine() ->GameSingletonField()->PrimalGameDataOverrideField()-> MasterItemListField()) { if (!data.uClass) continue; UPrimalItem* item = (UPrimalItem*)data.uClass->GetDefaultObject(true); if (!item) continue; item->MaxItemQuantityField() = 1000; item->InventoryRefreshCheckItem(); item->UpdatedItem(); } But the 'PrimalGameDataOverrideField()' isnt there anymore ?
Avatar
substitute 2/7/2020 5:22 AM
@Michidu
5:22 AM
Do you think with ue4 reflection it could be possible to call bp code?
Avatar
substitute 2/7/2020 5:39 AM
I got an answer of maybe from someone at wc so I’m gonna give it a shot
Avatar
GormusSenex 2/7/2020 11:54 PM
im going insane 🤪 i cant find anywhere how to get like an array of all blueprints like the MasterItemListField above... 🤦‍♂️
11:54 PM
here i thought google knew it all 😂
Avatar
@GormusSenex sorry, in latest version you need to cast GameSingletonField to UPrimalGlobals
6:05 PM
@substitute it might be possibly, but i don't know let me know if you find a way
Avatar
GormusSenex 2/8/2020 6:08 PM
Its this line that dont work : Globals::GEngine()->GameSingletonField()->PrimalGameDataOverrideField()->MasterItemListField() I tried Globals::GEngine().Get()->GameSingletonField()-> but then theres no PrimalGameDataOverrideField anymore ?
Avatar
maybe Get is correct
6:09 PM
you need to cast GameSingletonField to UPrimalGlobals anyway
Avatar
GormusSenex 2/8/2020 6:10 PM
erm... i donno how to do that, sry :/
6:12 PM
tried this, but nope : auto test = static_cast<UPrimalGlobals>Globals::GEngine().Get()->GameSingletonField(); (edited)
Avatar
static_cast<UPrimalGlobals*>(Globals::GEngine()()->GameSingletonField())->PrimalGameDataOverrideField()
Avatar
GormusSenex 2/8/2020 6:13 PM
ahh ty 😄
Avatar
substitute 2/8/2020 7:27 PM
@Michidu
7:27 PM
I don’t have access to stuff like FFrame in api not defined
7:27 PM
PepeHands
7:27 PM
So it would be a lot of work to try and test it
7:27 PM
I don’t see why it wouldn’t work though since the api runs internally
7:28 PM
So it’ll have the same abilities
Avatar
shouldnt be hard to add
7:41 PM
struct __cppobj FFrame : FOutputDevice { UFunction *Node; UObject *Object; char *Code; char *Locals; UProperty *MostRecentProperty; char *MostRecentPropertyAddress; TArray<unsigned int,TInlineAllocator<8,FDefaultAllocator> > FlowStack; FFrame *PreviousFrame; FOutParmRec *OutParms; UField *PropertyChainForCompiledIn; UFunction *CurrentNativeFunction; };
Avatar
substitute 2/8/2020 7:43 PM
Yeah but there’s a few other bits missing too
7:43 PM
sweating
7:43 PM
Like FindFieldChecked for fields
Avatar
seems like only UProperty version exists which might not matter though
7:46 PM
FindFieldChecked<UProperty>(UStruct *Scope, FName FieldName)
Avatar
substitute 2/8/2020 8:29 PM
Maybe
8:31 PM
8:32 PM
Could be actually
Avatar
You will need to somehow get BP class of mod
Avatar
GormusSenex 2/8/2020 10:05 PM
Based on @Michidu & @ antihax i made this to use instead of a stack mod : std::vector<std::string> configOverrideItemMaxQuantity; for (TSubclassOf<UPrimalItem>& data : static_cast<UPrimalGlobals*>(Globals::GEngine()()->GameSingletonField())->PrimalGameDataOverrideField()->MasterItemListField()) { if (!data.uClass) continue; UPrimalItem* n = (UPrimalItem*)data.uClass->GetDefaultObject(true); if (!n) continue; if (n->IsUsableConsumable() || n->IsValidForCrafting() || n->IsInBlueprint()) { FString fPathName; n->GetPathName(&fPathName, NULL); std::string pathName = fPathName.ToString(); pathName = pathName.substr(pathName.find("Default__") + 9); int maxItemQuantityField = n->MaxItemQuantityField(); configOverrideItemMaxQuantity.push_back(fmt::format("ConfigOverrideItemMaxQuantity=(ItemClassString=\"{0}\",Quantity=(MaxItemQuantity={1},bIgnoreMultiplier=true))\n", pathName, maxItemQuantityField)); } } std::sort(configOverrideItemMaxQuantity.begin(), configOverrideItemMaxQuantity.end()); std::string output; for (const auto& text : configOverrideItemMaxQuantity) output += text; std::ofstream file("ConfigOverrideItemMaxQuantity.txt"); file << output; file.flush(); file.close(); (edited)
10:05 PM
Has one problem tho (prolly more I dont know of). It doesnt dump the VeggieCake ? Im doing this: n->IsUsableConsumable() || n->IsValidForCrafting() But maybe there's a 3rd option too ? It creates this: ConfigOverrideItemMaxQuantity=(ItemClassString="PrimalItemAmmo_AdvancedBullet_C",Quantity=(MaxItemQuantity=100,bIgnoreMultiplier=true)) ConfigOverrideItemMaxQuantity=(ItemClassString="PrimalItemAmmo_AdvancedRifleBullet_C",Quantity=(MaxItemQuantity=100,bIgnoreMultiplier=true)) ConfigOverrideItemMaxQuantity=(ItemClassString="PrimalItemAmmo_ArrowStone_C",Quantity=(MaxItemQuantity=100,bIgnoreMultiplier=true)) [...]
Avatar
GormusSenex 2/8/2020 10:45 PM
Hmm, it doesnt dump cannons either...
Avatar
Hey guys, I had trouble finding a plugin and am a web developer by trade (.net) and was trained in school with c++. I am using the Shop, Currency & Kits plugin, but need a ui to go on top.
3:18 AM
Am I overlooking a plugin which might take care of this?
Avatar
@Ender It is not possible to build UI on plugin
3:42 AM
UI is client-sided only, you need a mod.
Avatar
Understood @substitute . If I did a mod, could I theoretically call the data put into ark shop arkserverapi plugin? (edited)
Avatar
not easily
3:58 AM
but it could be possible
Avatar
Awesome. Last question, i've got about a month before my new job starts. Anyone have any good ideas for paid plugins?
Avatar
any idea I would have
4:04 AM
I am already working on
4:04 AM
and plan on open sourcing
Avatar
I might be down to contribute if you show me the ropes. 🙂
Avatar
AaronBasques 2/13/2020 5:54 PM
Hi peoples, so say i have found a hook i want to use from Actor.h void UploadCharacterPlayerDataToArk( TArray<unsigned char>* PlayerDataBytes, FString PlayerName, TArray<FString> PlayerStats, unsigned __int64 PlayerDataId, bool WithItems, unsigned int ItemCount ) { NativeCall< void, TArray<unsigned char>*, FString, TArray<FString>, unsigned __int64, bool, unsigned int > ( this, "AShooterPlayerController.UploadCharacterPlayerDataToArk", PlayerDataBytes, PlayerName, PlayerStats, PlayerDataId, WithItems, ItemCount ); } From this i build.. (has errors and crashes) DECLARE_HOOK( AShooterPlayerController_UploadCharacterPlayerDataToArk, void, TArray<unsigned char>*, FString, TArray<FString>, unsigned __int64, bool, unsigned int ); void Hook_AShooterPlayerController_UploadCharacterPlayerDataToArk( TArray<unsigned char>* PlayerDataBytes, FString PlayerName, TArray<FString> PlayerStats, unsigned __int64 PlayerDataId, bool WithItems, unsigned int ItemCount ) { ...code...} For some reason i get errors unless i add AShooterGameMode* to the set of parameters, i'm wondering if this is the case for all hooks and if not why? i'm not experienced at all with this and i'm mostly learning from existing code provided by @Michidu & OwnProx
5:54 PM
this works as expected however GameMode is null when the program runs: DECLARE_HOOK( AShooterPlayerController_UploadCharacterPlayerDataToArk, AShooterGameMode*, void, TArray<unsigned char>*, FString, TArray<FString>, unsigned __int64, bool, unsigned int ); void Hook_AShooterPlayerController_UploadCharacterPlayerDataToArk( AShooterGameMode* GameMode, TArray<unsigned char>* PlayerDataBytes, FString _PlayerName, TArray<FString> PlayerStats, unsigned __int64 PlayerDataId, bool WithItems, unsigned int ItemCount ) { ...code...} Just looking for some clarification on whether this is the method i should use.
Avatar
you can use hook generator by OwnProx if you are wondering why AShooterPlayerController* (not AShooterGameMode) needed, it's because UploadCharacterPlayerDataToArk is a member-function (of class AShooterPlayerController), hence class instance is always passed as first argument c++ just makes this process transparent, that why you dont usually see it in code (edited)
Avatar
AaronBasques 2/14/2020 2:11 AM
welp, i saw that tool when i first joined, but then forgot it existed makes sense now lol, thanks XD
Avatar
AaronBasques 2/14/2020 2:20 AM
is that tool out of date though? because this looks incorrect https://i.imgur.com/vjqqkQI.png
2:23 AM
also this looks incorrect https://i.imgur.com/arMlc30.png
2:29 AM
this also doesn't match what i already have https://i.imgur.com/S9Cqlm4.png https://i.imgur.com/EMzG4rr.png
Avatar
@AaronBasques
2:34 AM
if you know how to use ida
2:34 AM
u can just use ida and see how to make hooks
Avatar
AaronBasques 2/14/2020 2:35 AM
i don't, or at least i don't think i do (edited)
Avatar
then rip4u
2:36 AM
which func?
Avatar
AaronBasques 2/14/2020 2:36 AM
i was just making them manually, i wasn't aware that the class instance was passed as the first argument
Avatar
it isn't always
Avatar
AaronBasques 2/14/2020 2:37 AM
should i not use the OwnProx tool then?
Avatar
it works fine for most things
2:37 AM
so for methods that are instance methods e.g. player.beginplay() the first parameter is always internally this, thus for your hook you need to also pass this for methods that are static methods e.g. player::somethingblahblah() there is no this parameter
2:38 AM
almost all hooks you will need to use will be instance methods though
2:38 AM
but you see (edited)
2:38 AM
2:38 AM
the "this"?
2:39 AM
this is because in assembler, there is no such thing as classes / objects
2:39 AM
when c++ is compiled, the object instance methods are actually all technically static methods on the structure, but the first paramter is a reference to the "owning" object.
2:40 AM
so in this class class Hello { public: void Hi(); static void Bye(); }; void Hi() actually has a hidden parameter called this that is inserted when the program is compiled. but static void Bye() does not
Avatar
AaronBasques 2/14/2020 2:42 AM
hmm, well, my lack of knowledge entirely shows through here. i understood very little of what you said 😢
Avatar
GormusSenex 2/15/2020 8:53 PM
😂
8:53 PM
me too 😄
Avatar
FVector OutLoc; FRotator OutRot; PlayerController->GetPlayerViewPoint(&OutLoc, &OutRot); FVector ForwardVector; PlayerController->GetActorForwardVector(&ForwardVector); FVector End = ForwardVector * 5000.0f + OutLoc; TArray<TEnumAsByte<EObjectTypeQuery>> ObjectTypes = { EObjectTypeQuery::ObjectTypeQuery9 }; TArray<AActor*> ActorsToIgnore = { PlayerController->GetPlayerCharacter() }; FHitResult HitResult; if (UKismetSystemLibrary::LineTraceSingleForObjects( ArkApi::GetApiUtils().GetWorld(), OutLoc, End, &ObjectTypes, false, &ActorsToIgnore, EDrawDebugTrace::None, &HitResult, true )) { auto actor = HitResult.ActorField().Get(false); FString DisplayName; UKismetSystemLibrary::GetDisplayName(&DisplayName, actor); Log::GetLog()->warn("{}", DisplayName.ToString()); } Would anyone have any idea why this crashes moments after it logs the desired output (what I am looking at)? It doesn't leave a crash stack, just immediately closes shootergameserver.exe thinkW
Avatar
Same result w/ GetAimedActor, it gets the output I want then just closes the server (edited)
Avatar
@dougy
12:44 AM
Your log is wrong I think
12:44 AM
Should be {0}
Avatar
either would work i think, but the log isnt the issue it prints out the correct value
12:45 AM
it crashes shortly after
12:52 AM
Crashes without the log part too, just tested
Avatar
So, @WETBATMAN , I have modified the arkshop to accept tribeid to be able to buy npp protection: from within BuyCommand c++ auto game_mode = ArkApi::GetApiUtils().GetShooterGameMode(); auto player_id = game_mode->GetPlayerIDForSteamID(steam_id); const uint64 tribe_id = game_mode->GetTribeIDOfPlayerID(player_id); FString fcommand = fmt::format(command, fmt::arg("steamid", steam_id), fmt::arg("tribeid", tribe_id), fmt::arg("playerid", player_id)).c_str(); Log::GetLog()->info(fmt::format("[Buy cmd] steamid:{} tribeid:{} playerid:{} cmd:{}",steam_id,tribe_id,player_id, fcommand.ToString())); FString result; player_controller->ConsoleCommand(&result, &fcommand, true); It works fine when I do it for myself, Ark-log: 02/21/20 20:47 [ArkShop][info] [Buy cmd] steamid:76561198170352161 tribeid:1662978856 playerid:152942838 cmd:NPP.AddProtection 1662978856 168 02/21/20 20:47 [NewPlayerProtection][info] Admin: 76561198170352161 added 168 hours of NPP Protection to Tribe: 1662978856. But when players buy only one of the rows outputs and players dont get protection: 02/21/20 20:01 [ArkShop][info] [Buy cmd] steamid:76561198007030433 tribeid:1479612071 playerid:858649124 cmd:NPP.AddProtection 1479612071 168 Have only seen one player try this, but one error is disturbing enough. Any clues? Big thanks to any clue!
Avatar
your problem is that NPP itself checks if you're an admin or not
9:19 PM
But there has to be some workaround ...plz 🙂
Avatar
NPP is open source 😄
Avatar
Is there any drawback to remove that check? If I find it.
9:21 PM
And ofc I rather not mess up that plugin too 🙂
Avatar
it's kinda useless because to run a cheat command you have to be an admin anyway
Avatar
I thought so.
Avatar
ofc you can temporarily mark the player as admin from your ArkShop plugin and then set it back to what it was
Avatar
ok, needs some investigation then. When I actually modified the code as above I felt as a genius figuring that out by myself. Baby steps.
Avatar
also
9:26 PM
there is a much easier way
9:26 PM
TargetingTeamField()
9:26 PM
😄
Avatar
ok.... 🤔
Avatar
PC->TargetingTeamField()
9:27 PM
where PC is AShooterPlayerController
Avatar
To get tribeid?
Avatar
yes
Avatar
OK. Thank you. I'll do it the easier way then. So, can I mark the player as an admin just before player_controller->ConsoleCommand and then change it back right after? Or are these events messaged somehow and happens in unknown order? (sry for not being a programming pro here). But since I might use the shop for any command in the future I think that's the way to go. (edited)
Avatar
everything happens line by line
9:36 PM
unless ofc something is async in which case it can run simultaneously as other stuff but this is not the case in any public open source plugin pretty much (edited)
Avatar
Ok, ty. Any hints how to mark as admin? 🙂
Avatar
PC->bIsAdmin() = true;
9:40 PM
should be like this
Avatar
Great! Thank you!
Avatar
void UnlockEngrams_Cmd(AShooterPlayerController* PlayerController, FString* message, int mode) { auto Singleton = (UPrimalGlobals*)Globals::GEngine().Get()->GameSingletonField(); auto GameData = Singleton->PrimalGameDataOverrideField() ? Singleton->PrimalGameDataOverrideField() : Singleton->PrimalGameDataField(); auto EngramClasses = GameData->EngramBlueprintEntriesField(); for (auto&& Engram : EngramClasses) ((AShooterPlayerState*)PlayerController->PlayerStateField())->ServerUnlockEngram(Engram->BluePrintEntryField(), true, true); } If anyone is interested (edited)
👍 2
5:01 AM
Here is a way to automatically unlock all engrams listed in the Primal Game Data
5:02 AM
It will automatically detect if there are any Primal Game Data overrides and use that override instead of the default one. Then it will read the engrams and auto unlock them (edited)
5:03 AM
This is bound to a chat command like this ArkApi::GetCommands().AddChatCommand("/unlockengrams", &UnlockEngrams_Cmd);
Avatar
@dougy added you
Avatar
thanks 😄
Avatar
@WETBATMAN I tried the temporary admin hax above. Seems the user get an admin star to their name in the chat window, and it sticks...
5:38 PM
... but luckily they cant use cheats anyway.
Avatar
GormusSenex 2/22/2020 5:44 PM
if u set them to admin, they will be able to use admin commands
Avatar
Its just on and off
Avatar
GormusSenex 2/22/2020 5:44 PM
ok so they have to be fast about it 😄
Avatar
yeah. Really fast
5:47 PM
c++ //Lets make admin for a split micro second :) auto admin_state = player_controller->bIsAdmin(); // saving admin status player_controller->bIsAdmin() = true; // set temp admin player_controller->ConsoleCommand(&result, &fcommand, true); // Do command! player_controller->bIsAdmin() = admin_state; // rollback admin status Can this be risky? and why do the star stick? 🥶
Avatar
GormusSenex 2/22/2020 5:58 PM
probably some refresh command. like when u update inventory. but i havnt worked with it so im just guessing
Avatar
well, this is one of my first baby steps in this. So the inv likeness does not reach to me...yet 🙂 (edited)
Avatar
Deleted User 2/26/2020 3:21 AM
how can i make a plugin that disables ally looking and baby dinos auto wandering I can just use what someone has started with the auto disabling ally looking and just need to add to there how to disable baby auto wandering
Avatar
@Haragon any chance we can get advanced kits for shop plugin ported to Atlas?
Avatar
Rogue Leader 3/5/2020 7:46 PM
Anyone know what class shoulder dinos are? They aren't APrimalDinoCharacters, and that class is the only one in the api that has baby functions/fields and a function to return a UPrimalCharacterStatusComponent
Avatar
They should be
10:40 PM
Until they’re on your shoulder
10:40 PM
You could probably upcast
Avatar
Rogue Leader 3/5/2020 11:47 PM
Nah, they are failing AActor->IsA PrimalDino
11:48 PM
Tested on otters jerboas and the new shoulder pet
Avatar
Does isa count children
11:48 PM
Or only direct class
Avatar
Rogue Leader 3/5/2020 11:49 PM
Pretty sure only actual and super classes
11:50 PM
This is what I got from debugging
11:50 PM
Shoulder pets are: 03/05/20 08:06 [DinoPassiveProtection][info] Target is AActor class. 03/05/20 08:06 [DinoPassiveProtection][info] Target is APawn class. 03/05/20 08:06 [DinoPassiveProtection][info] Target is APlayerState class. 03/05/20 08:06 [DinoPassiveProtection][info] Target is APrimalTargetableActor class. "Regular" dinos are: 03/05/20 08:07 [DinoPassiveProtection][info] Target is AActor class. 03/05/20 08:07 [DinoPassiveProtection][info] Target is APawn class. 03/05/20 08:07 [DinoPassiveProtection][info] Target is APlayerState class. 03/05/20 08:07 [DinoPassiveProtection][info] Target is ACharacter class. 03/05/20 08:07 [DinoPassiveProtection][info] Target is APrimalCharacter class. 03/05/20 08:07 [DinoPassiveProtection][info] Target is APrimalDinoCharacter class. 03/05/20 08:07 [DinoPassiveProtection][info] Target is APrimalTargetableActor class.
11:51 PM
It's like there's a class missing from the api
Avatar
Something could be wrong
11:51 PM
But shoulder pets should inherit from Dino at some point in the chain
Avatar
Rogue Leader 3/6/2020 12:25 AM
That's what I thought, but nothing inherits APrimalDinoCharacter
12:25 AM
At least nothing currently in the api. Does anyone have a full list of all classes from the server executable?
Avatar
substitute 3/6/2020 1:30 AM
You can use the devkit
1:31 AM
and check class inheiritance
Avatar
Rogue Leader 3/6/2020 11:12 PM
I figured it out. I was checking the players target when using the command, and it looks like shoulder pet's have an object overlapping them that its picking up instead of them.
11:12 PM
@Foppa did some testing that confirmed it
11:12 PM
Thanks @Foppa <3
Avatar
༺𝓐𝓷𝓪𝓻𝓬𝓱𝔂༻ 3/6/2020 11:29 PM
Foppa da man.
😄 1
Avatar
DrackusOfDFDDS 3/7/2020 1:42 AM
So, I need a plugin that could scan a MySql DB for permissions groups on a weekly basis and then distribute X lootboxes (run a short command with steam ID) to each user based on the permissions group they have. For example: Platinum VIP = 12 boxes Gold VIP = 6 boxes No vip= 0 boxes. Should be able to handle a lot of different permissions. Anyone know who might be a good person to talk to that might be interested in this kinda project? (Also is this the right channel to post this kinda thing?) (edited)
1:43 AM
Please @ me or DM if ya have any insight lovebirb
Avatar
substitute 3/7/2020 2:42 AM
The database would be very simple to setup
2:42 AM
As for gift distribution you should use a command
2:43 AM
You could periodically check who is valid for a gift and send them a reminder
2:43 AM
Or less annoying, send a reminder on login and when the gift is available
2:44 AM
There’s a few ways you can define the contents of the gift, json blobs in sql, config values, etc., up to you really
2:44 AM
(I would probably use a relationship table mapping gift ids and item blueprints as entries)
2:44 AM
@DrackusOfDFDDS
Avatar
DrackusOfDFDDS 3/7/2020 2:48 AM
So, the database already exists. It's a database of lootboxes from Haragon's Lootboxes + and a permissions database from Michidu's plugin. The goal is for the plugin to scan the permissions database, if a steam ID has one of several permissions groups then deliver X number of lootboxes to the lootbox DB based on which permissions group they have. So, scan. If VIP = addlootbox {steam ID} #
2:48 AM
@substitute
Avatar
substitute 3/7/2020 3:23 AM
Hamfisting plugins together like that isn’t always the best idea
3:24 AM
The logic remains the same
3:24 AM
But you will have to map groups from plugin a to sets of gifts (another table) to player lootboxes
Avatar
So I'm totally new to using the tools created here, but have done some direct hooking of ark functions in the past. Has anyone played around with hooking network events? Wondering if spoofing packets S -> C is feasible (edited)
Avatar
it should be possible but why?
Avatar
Could make things like creating fake players have a lot less overhead.
Avatar
GormusSenex 3/12/2020 4:12 PM
u'll be banned on battlemetrics if they find out tho 😉
4:12 PM
but i'd like to hear more about that 😄
Avatar
Oh more what I was thinking about is human NPCs
Avatar
GormusSenex 3/12/2020 4:14 PM
ohh, darn 😂
Avatar
I mean you could do that too
Avatar
GormusSenex 3/12/2020 4:14 PM
but thats also cool ngl
4:15 PM
and have it macro / script controlled. so ppl can make their own scripts etc
Avatar
I did a lot of Minecraft modding a while back and packet spoofing opened a lot of doors
Avatar
GormusSenex 3/12/2020 4:15 PM
like a "slave" npc
Avatar
Things like proxying multiple servers together was also possible
4:16 PM
Although replay may be less feasible depending on how they do auth
4:17 PM
I'm also wondering if it's possible to use blueprints that are in the game but either not used or used for something else by spoofing packets with the model changed (again haven't really looked at this much) (edited)
Avatar
You don’t need to spoof for blueprints @Plazmaz
4:46 PM
As for authentication, that is does using steam auth blobs
4:47 PM
But you could override the authentication function too
Avatar
Good point
4:47 PM
Although actually I don't know if you'd need to for proxying
4:47 PM
I guess probably to some extent
6:40 PM
How can i do this?
6:41 PM
APrimalBuff doesnt have a isA func but i can cast
6:41 PM
but then i dont know how to get the Buff_IceBomb class
Avatar
So my question is how would i check for a class that is not in the API
Avatar
you cannot identify a buff by it's class
8:32 PM
unfortunately
8:32 PM
only thing different that they have is an ID which is an integer but i forgot where exactly it was located
Avatar
is there a higher level network send function outside of FSocketBSD.SendTo?
8:43 PM
basically wondering if there's anything that has higher level packet data and not just bytes (edited)
Avatar
@Plazmaz
10:56 PM
There’s fnetcontrolmessage
10:56 PM
But you will have to define them yourself
Avatar
I have a file with them defined (for sending not for hooking received)
10:56 PM
I can paste it here
Avatar
yeah that'd be great
Avatar
Was gonna merge it into the api at some point
10:57 PM
But fnetcontrol is just like
10:57 PM
Control codes for game state
Avatar
Like disconnect
10:57 PM
Swap controllers
10:57 PM
Kick
Avatar
yeah I am not seeing much info outside of that
Avatar
Etc
Avatar
there's Serialize, but that's for the world data
10:57 PM
I am wondering if this is UE's special sauce
10:57 PM
just handling all the network stuff
Avatar
Yes
10:57 PM
It is
Avatar
that's annoying
Avatar
The engine handles rpc and replication
10:58 PM
Fnetcontrol message is also internal ue4 engine stuff
Avatar
btw I saw a datadog method somewhere in there, lol
10:58 PM
so apparently they're streaming metrics
Avatar
Yes they have that
10:58 PM
Only for officials
Avatar
You think it's feasible to decode UE4 packets?
Avatar
Yes
Avatar
is there a method for it?
Avatar
Go look at ue4 source code
Avatar
is it public?! 😮
Avatar
That’s what I did for fnetcontrol to see how it worked
10:59 PM
And it’s semi public
10:59 PM
It’s on GitHub
10:59 PM
But you have to do something first to get added
Avatar
like what send nudes
Avatar
No sign legal agreements
11:00 PM
is there a method we could just call to decode/encode packets? I bet there is (edited)
Avatar
Internally in the engine probably
11:01 PM
But they’re also going to be serialized
11:02 PM
theoretically it should be possible to spawn an actor with an unused model
11:02 PM
there's UShooterCheatManager::SpawnActor but that might be too high lvl
11:03 PM
UWorld::SpawnActor might do it
11:03 PM
tbh network level control probably isn't important if I can just spawn an actor w/o behavior
Avatar
ffs unreal engine won't let me link up my github
Avatar
Is there a way to get a better error msg than 1114? I have try/catch around pretty much everything in my code
Avatar
1114 = load error
6:54 AM
meaning it didn't attach correctly usually
6:55 AM
so something is really janked
Avatar
how do I debug?
7:01 AM
like I've got my config set up (and yes, it's valid json)
7:04 AM
should I be building for x86 or x64? my system is x64
7:06 AM
or sorry plugininfo.json. Do I need a config if I'm not using it? (edited)
Avatar
ahh figured out I can attach visual studio debugger, which helps a LOT
7:21 AM
wtf apparently it's in my log init?!
7:21 AM
Log::Get().Init("ArkMod");
Avatar
make sure you build as x64 release
Avatar
I am
7:24 AM
logger_ = std::make_shared<spdlog::logger>(plugin_name, begin(sinks), end(sinks)); this line creates the error
7:24 AM
sinks is empty
7:25 AM
ohhh wait
7:25 AM
building as debug
7:25 AM
and this logic #if _ITERATOR_DEBUG_LEVEL == 2 _Lockit _Lock(_LOCK_DEBUG); _Orphan_me(); #endif // _ITERATOR_DEBUG_LEVEL == 2 } else { // have a parent, do adoption _Container_proxy* _Parent_proxy = _Parent->_Myproxy; #if _ITERATOR_DEBUG_LEVEL == 2 if (_Myproxy != _Parent_proxy) { // change parentage _Lockit _Lock(_LOCK_DEBUG); _Orphan_me(); _Mynextiter = _Parent_proxy->_Myfirstiter; _Parent_proxy->_Myfirstiter = this; _Myproxy = _Parent_proxy; } #else // _ITERATOR_DEBUG_LEVEL == 2 _Myproxy = _Parent_proxy; #endif is the src of the error, ok
7:27 AM
nope still happens with release build
Avatar
weird, shouldn't happen here
Avatar
do I need to declare hooks? Currently just registering a cmd
7:34 AM
hrm
Avatar
no if you dont use them
7:41 AM
idk what I'm doing wrong. Does the server need to be running as admin or something?
Avatar
no try without debugger maybe
Avatar
same error just no info on why
7:42 AM
1114
Avatar
try removing some parts from your init (edited)
Avatar
this is my load method: void Load() { Log::Get().Init("ArkMod"); try { ArkApi::GetCommands().AddChatCommand("/TestSpawn", &Spawn); } catch (const std::exception& error) { Log::GetLog()->error(error.what()); throw; } } and my dllmain: BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { try { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: Load(); break; case DLL_PROCESS_DETACH: Unload(); break; } return TRUE; } catch (const std::exception& error) { std::cout << error.what(); Log::GetLog()->error(error.what()); } }
7:46 AM
will try to strip it down
7:50 AM
it was removing this line that fixed it: ArkApi::GetCommands().AddChatCommand("/TestSpawn", &Spawn);
7:57 AM
no wait nvm I'm dumb, was still building in debug
Avatar
your code looks fine, in release it should work 🙂
8:00 AM
would be nice to have it throw an error if building in debug or something
8:00 AM
idk why log breaks in debug though
Avatar
whats the best way to validate/check if a dino or item BP path is good (edited)
Avatar
Anyone know why this doesn't seem to work? I'm testing on a local server in a solo tribe. AShooterPlayerState* State = static_cast<AShooterPlayerState*>(player_controller->PlayerStateField()); bool isOwner = State->IsTribeOwner(State->PlayerIdField()); This Tribe Admin check does work though. bool isAdmin = player_controller->IsTribeAdmin();
Avatar
GormusSenex 3/19/2020 5:04 PM
i think i heard something about istribeowner is faulty
Avatar
Anyone have a working method for Tribe Owner?
Avatar
GormusSenex 3/19/2020 5:07 PM
c++ AShooterPlayerState* playerState = static_cast<AShooterPlayerState*>(player->PlayerStateField()); FTribeData* tribeData = playerState->MyTribeDataField(); uint64 tribeOwnerId = tribeData->OwnerPlayerDataIDField();
5:07 PM
compare that to the player id (edited)
Avatar
Ok, I will give that a shot
Avatar
AShooterPlayerState* State = static_cast<AShooterPlayerState*>(player_controller->PlayerStateField()); FTribeData* tribe = State->MyTribeDataField(); if (!tribe) return; uint64 tribeOwnerId = tribe->OwnerPlayerDataIDField(); uint64 playerId = player_controller->GetLinkedPlayerID64(); bool isOwner = (playerId == tribeOwnerId); This is what I ended up with and it works if anyone needs a full example. (edited)
👍 2
Avatar
Simonsays095 3/21/2020 7:13 AM
When I try to build my test plugin, I get a bunch of errors - among them, "FName is not a type name". Is this because I'm not including a file that I should be, or because I don't have the VS project set up correctly?
Avatar
Could be both
Avatar
Can someone point me in the right direction to find the Day/Time information used in Tribe Logs for instance? "Day 21, 05:27:56" for example
Avatar
Simonsays095 3/21/2020 5:09 PM
When making a plugin, how do you tell your VS project where to find UE4 objects/classes? The tutorial in #【🔶】ᴘʟᴜɢɪɴ-ᴛᴜᴛꜱ doesn't explain it.
Avatar
did you include the headers
5:14 PM
and the lib files?
Avatar
Simonsays095 3/21/2020 5:14 PM
I am including #include <iostream> #include <API/ARK/Ark.h> #pragma comment(lib, "ArkApi.lib")
Avatar
Yes but did you actually include them
5:14 PM
in your linker
Avatar
Simonsays095 3/21/2020 5:15 PM
Yeah, when following that tutorial
5:15 PM
you did this (?) (edited)
Avatar
Simonsays095 3/21/2020 5:15 PM
Yes
Avatar
and you did lib?
Avatar
Simonsays095 3/21/2020 5:16 PM
Yep
5:16 PM
But those are linking the API, not UE4 itself, right?
Avatar
Generally, if a class is missing, VS will allow you to import it
5:16 PM
and correct
5:16 PM
you actually can't really use UE4 classes directly like what I am thinking you want to do
5:17 PM
FString in the API isn't a 1:1 exact copy of UE4 FString
Avatar
Simonsays095 3/21/2020 5:17 PM
So I can't use UE_LOG, I just have to cout?
Avatar
UE_LOG is actually a macro
5:17 PM
but the API has it's own logger
Avatar
Log::GetLog()
5:18 PM
for the API logger
Avatar
Log::GetLog()->info(string here);
Avatar
Simonsays095 3/21/2020 5:18 PM
Hmm, that's good to know
Avatar
but yes the original UE4 sources won't work with the api directly.
5:18 PM
#define DEFINE_CONTROL_CHANNEL_MESSAGE(Name, Index, ...) \ enum { NMT_##Name = Index }; \ template<> class FNetControlMessage<Index> \ { \ public: \ template<typename... ParamTypes> \ static void Send(UNetConnection* Conn, ParamTypes&... Params) \ { \ NativeCall<void, UNetConnection*, ParamTypes...>(nullptr, "FNetControlMessage<" #Index ">.Send", Conn, Params...); \ } \ }; DEFINE_CONTROL_CHANNEL_MESSAGE(Netspeed, 4, int32); DEFINE_CONTROL_CHANNEL_MESSAGE(Failure, 6, FString); DEFINE_CONTROL_CHANNEL_MESSAGE(Join, 9, uint64); DEFINE_CONTROL_CHANNEL_MESSAGE(Skip, 12, FGuid); DEFINE_CONTROL_CHANNEL_MESSAGE(Abort, 13, FGuid); DEFINE_CONTROL_CHANNEL_MESSAGE(PCSwap, 15, int32); DEFINE_CONTROL_CHANNEL_MESSAGE(ActorChannelFailure, 16, int32); DEFINE_CONTROL_CHANNEL_MESSAGE(DebugText, 17, FString); DEFINE_CONTROL_CHANNEL_MESSAGE(BuildIdMismatch, 19, uint32); DEFINE_CONTROL_CHANNEL_MESSAGE(InitBattlEye, 22, FString); DEFINE_CONTROL_CHANNEL_MESSAGE(BeaconWelcome, 25); DEFINE_CONTROL_CHANNEL_MESSAGE(BeaconJoin, 26, FString); DEFINE_CONTROL_CHANNEL_MESSAGE(BeaconAssignGUID, 27, FNetworkGUID); DEFINE_CONTROL_CHANNEL_MESSAGE(BeaconNetGUIDAck, 28, FString);
5:19 PM
like I had to define my own FNetControlMessage
5:19 PM
since it was not in the API already.
Avatar
These should be added to the API tbh
Avatar
I will add them
5:19 PM
I just need to make a PR
Avatar
FTribeData* tribe_data = static_cast<FTribeData*>(FMemory::Malloc(0x200)); RtlSecureZeroMemory(tribe_data, 0x200); ArkApi::GetApiUtils().GetShooterGameMode()->LoadTribeData(TribeId, tribe_data, false, false); const string tribeName = tribe_data->TribeNameField().ToString(); Is this the only way to be able to look up a Tribe Name? (edited)
8:25 PM
I only have AShooterGameMode and the TribeId available so just making sure i'm doing the best way.
Avatar
Something else needed to compile for ATLAS? I Switched to use #include <API/Atlas/Atlas.h>
3:44 PM
Also I can't seem to compile the ATLAS Api project either.
3:46 PM
I'm trying to port my ARK plugin to ATLAS
Avatar
it looks like you're including ark.h and atlas.h at the same time
Avatar
Ya, not sure why that is happening though.
4:52 PM
#ifdef ATLAS #include <API/Atlas/Atlas.h> #pragma comment(lib, "AtlasApi.lib") #else #include <API/ARK/Ark.h> #pragma comment(lib, "ArkApi.lib") #endif
4:53 PM
4:54 PM
If I switch back to "Release" the ARK plugin builds just fine.
Avatar
Only difference between the ARK and ATLAS build configs is the preprocessor line for "ATLAS" so it uses the proper includes.
Avatar
Even downloaded a fresh copy of the API and can compile ARK but not ATLAS.
Avatar
Simonsays095 3/27/2020 9:36 PM
I've never really dealt with json files in C++ before, how should I go about incorporating a config file? Is there an API package to help with it, or just a general tutorial somewhere on it?
Avatar
Download plugin source code to see how things are setup.
9:45 PM
Server Plugins for ARK: Server API. Contribute to Michidu/Ark-Server-Plugins development by creating an account on GitHub.
9:46 PM
I used the information here to figure out how to setup my Visual Studio environment. https://ark-server-api.com/threads/tutorial-create-plugins.55/#post-517
any tutorial to create plugins? Thank you
9:46 PM
Not sure if there are other resources/guides to help you.
Avatar
Simonsays095 3/27/2020 10:28 PM
There's a more up-to-date version of that tutorial in #【🔶】ᴘʟᴜɢɪɴ-ᴛᴜᴛꜱ that I followed, and it helped a lot. I'm just still trying to figure out the basics of plugin dev after the environment is set up (like config files, etc.). Should I set up VS to build directly into my plugin folder on my test server, or is there a way to automatically copy it over? Right now, I just build, the manually copy the files to the server to run and it gets tedious.
Avatar
Simonsays095 3/27/2020 11:14 PM
^^ I just learned about post-build events and got that to work 🙂
Avatar
Jestersuave 4/2/2020 6:33 PM
@Lethal Had a question about your Tribe Log Relay plugin
6:34 PM
In the Keywords section, are you able to enter additional checks?
6:35 PM
for example, if I wanted to add one for babies being born
Avatar
Yes, customize as you see fit.
6:37 PM
Don't believe babies being born can be done though.
6:37 PM
Baby dinos are not part of a tribe so there is no tribe log entry for them.
6:38 PM
When you claim them they become part of the tribe.
6:38 PM
@Jestersuave
Avatar
Jestersuave 4/2/2020 6:38 PM
yeah someone let me know just now lol, it logs when you claim it
6:38 PM
but good to know I can add additional custom parameters
6:38 PM
tyvm
Avatar
v1.3 allows you to customize the text on the events I added that were not in ARK already.
6:39 PM
Trying to finish it and test before this weekend.
Avatar
Jestersuave 4/2/2020 6:39 PM
sounds good
Avatar
All of the info is on the forum discussion for it.
Avatar
substitute 4/5/2020 2:01 AM
@Lethal
2:01 AM
You could add babies being born
2:01 AM
For egg based Dinos, when they hatch get a ref to the egg and get the person which dropped it
2:02 AM
It’s implicit and someone dropping an egg for another tribe (like ally or something) could make it incorrect but it is the best solution I can think of off the top of my head
Avatar
@substitute Well couldn't you technically do the same thing for non-egg based dinos? Maybe a reference to its ancestor and check the tribe of that dino?
Avatar
substitute 4/5/2020 3:11 AM
Possible but you have issue of trading Dino
3:12 AM
For non egg I’m sure there’s a birth event since the Dino gestates
Avatar
@substitute I have non-egg based dinos working using the Gestation timer. I have not quite figured out egg hatched dinos.
Avatar
substitute 4/6/2020 7:06 PM
@Lethal Nice!
7:13 PM
@Lethal check, ADroppedItemEgg::UpdateEgg
7:13 PM
you will need to check for MyItem->ItemDurability (edited)
7:14 PM
basically, check if the associated item is "broken"
7:16 PM
so you can do like
7:16 PM
if (MyItem->ItemDurabilityField() <= 0.f) { auto playerID = MyItem->DroppedByPlayerIDField(); //do something with player id } (edited)
Avatar
Can I hook something not in the API? So far I have only used things which I could find in the API source or through the Hook Creator. /* public: void __cdecl ADroppedItemEgg::UpdateEgg(float) __ptr64 */ void __thiscall UpdateEgg(ADroppedItemEgg *this,float param_1) { @substitute
Avatar
substitute 4/6/2020 9:22 PM
@Lethal Yes it should be possible
9:24 PM
This is my def from IDA
9:24 PM
void __usercall ADroppedItemEgg::UpdateEgg(ADroppedItemEgg *this@<rcx>, float DeltaSeconds@<xmm1>, float a3@<xmm0>) I think a3 might be IDA error btw (edited)
9:25 PM
so you can do like so
9:26 PM
DECLARE_HOOK(ADroppedItemEgg_UpdateEgg, void, ADroppedItemEgg*, float DeltaSeconds*); ArkApi::GetHooks().SetHook("ADroppedItemEgg.UpdateEgg", yourCallback, &ADroppedItemEgg_UpdateEgg_original);
9:27 PM
Avatar
@substitute ADroppedItemEgg is undefined so I need to pull the class definition in as well?
Avatar
struct ADroppedItemEgg : ADroppedItem { float& IndoorsHypoThermalInsulationField() { return *GetNativePointerField<float*>(this, "ADroppedItemEgg.IndoorsHypoThermalInsulation"); } float& IndoorsHyperThermalInsulationField() { return *GetNativePointerField<float*>(this, "ADroppedItemEgg.IndoorsHyperThermalInsulation"); } float& EggThermalInsulationTemperatureMultiplierField() { return *GetNativePointerField<float*>(this, "ADroppedItemEgg.EggThermalInsulationTemperatureMultiplier"); } double& LastInsulationCalcTimeField() { return *GetNativePointerField<double*>(this, "ADroppedItemEgg.LastInsulationCalcTime"); } float& HyperThermalInsulationField() { return *GetNativePointerField<float*>(this, "ADroppedItemEgg.HyperThermalInsulation"); } float& HypoThermalInsulationField() { return *GetNativePointerField<float*>(this, "ADroppedItemEgg.HypoThermalInsulation"); } BitFieldValue<bool, unsigned __int32> bIsEggTooHot() { return { this, "ADroppedItem.bIsEggTooHot" }; } BitFieldValue<bool, unsigned __int32> bIsEggTooCold() { return { this, "ADroppedItem.bIsEggTooCold" }; } };
Avatar
GormusSenex 4/6/2020 10:37 PM
any1 experienced getting server crash calling the GetSteamIdFromController like this ? c++ if (playerController) { uint64 steamId = ArkApi::GetApiUtils().GetSteamIdFromController(playerController); } I get a crash from time to time calling it ??
Avatar
that's because playerController is nullptr
10:57 PM
you should check it
Avatar
Never fires when dropping an egg what am I missing? DECLARE_HOOK(ADroppedItemEgg_UpdateEgg, void, ADroppedItemEgg*, float*); void Hook_ADroppedItemEgg_UpdateEgg(ADroppedItemEgg* _this, float* DeltaSeconds) { std::cout << "Hook_ADroppedItemEgg_UpdateEgg FIRING BEFORE" << std::endl; ADroppedItemEgg_UpdateEgg_original(_this, DeltaSeconds); std::cout << "Hook_ADroppedItemEgg_UpdateEgg FIRING AFTER" << std::endl; } ArkApi::GetHooks().SetHook("ADroppedItemEgg.UpdateEgg", &Hook_ADroppedItemEgg_UpdateEgg, &ADroppedItemEgg_UpdateEgg_original); ArkApi::GetHooks().DisableHook("ADroppedItemEgg.UpdateEgg", &Hook_ADroppedItemEgg_UpdateEgg);
Avatar
GormusSenex 4/6/2020 11:15 PM
@WETBATMAN isnt that what im doing with the IF (playerController) ?
Avatar
ah yes
11:15 PM
what happens before ?
Avatar
GormusSenex 4/6/2020 11:16 PM
nothing. its the first thing i do in the call
Avatar
you sure it crashes there tho
Avatar
GormusSenex 4/6/2020 11:16 PM
yup. got 2 crash log to proof it 🙂
11:17 PM
with linenum
11:17 PM
but...
11:17 PM
it happends inside a DelayExecute. could that be the reason ?
11:18 PM
im wondering if the player logs out be4 its triggered there is still a playercontroller maybe for a short while, but no FUniqueNetIdSteam ?
Avatar
Stopping typing so much your pushing my problem off the screen...🤣
Avatar
if player is logged out PlayerController is null
Avatar
GormusSenex 4/6/2020 11:19 PM
yes. thats what i thought too
Avatar
yes but that's true
Avatar
GormusSenex 4/6/2020 11:20 PM
sry @Lethal 😄
Avatar
i also use DelayExecute to kill handcuffed players after 15 min lol
11:20 PM
and it doesn't trigger if they're logged out or dead
Avatar
GormusSenex 4/6/2020 11:20 PM
but how can it break there i dont get it. it breaks exactly at that call
Avatar
@Lethal is ADroppedItemEgg in the API ?
Avatar
no sir
Avatar
that's your issue heh
Avatar
I made a structure for it
Avatar
you need to add it to PdbConfig.json
Avatar
GormusSenex 4/6/2020 11:22 PM
well, it actually break here (inside the GetSteamIdFromController call): c++ auto* steam_net_id = static_cast<FUniqueNetIdSteam*>(player_state->UniqueIdField().UniqueNetId.Get()); this is the crash log: VERSION.dll!ArkApi::IApiUtils::GetSteamIdFromController() (0x00007ffbc58c2f2b) + 8 bytes [C:\Users\Meduz\source\repos\ArkServerAPI\version\Core\Public\Ark\ArkApiUtils.h:195]
Avatar
otherwise API won't dump it
Avatar
when testing you should have DumpAll enabled
11:23 PM
so this doesn't happen
11:23 PM
😄
11:23 PM
in the main API config.json set DumpAll to true
11:23 PM
and restart your server
Avatar
How would I give this functionality in a plugin to someone without that in their api config?
Avatar
if your hook works then all you have to do is made a pdbconfig.json file for it
11:23 PM
the PdbConfig.json file will have to be bundled with your plugin
Avatar
placed in the same dir as the dll
Avatar
Do I need to still define my "struct ADroppedItemEgg : ADroppedItem"
Avatar
yes
11:26 PM
you will need this in plugin folder
11:26 PM
except i put a , there
11:26 PM
remove it 😄
11:27 PM
{ "structures": [ "ADroppedItemEgg" ] }
11:27 PM
needs to look like this
11:27 PM
is ADroppedItem also not in the API ?
Avatar
ADroppedItem is in there
11:28 PM
ADroppedItemEgg extends it
Avatar
GormusSenex 4/6/2020 11:28 PM
i guess ill have to make a try-catch around that call even tho it shouldnt be needed
Avatar
ah then this json should be correct
11:28 PM
you should test with DumpAll enabled regardless
11:29 PM
yes but it shouldn't be crashing there
11:29 PM
so it's weird
11:29 PM
are you building with the latest API ?
Avatar
GormusSenex 4/6/2020 11:29 PM
yup. got it 6 days ago
11:29 PM
i added my own struct but nothing regarding this
11:30 PM
besides that its clean
Avatar
@WETBATMAN It works now...FML 🙂
Avatar
GormusSenex 4/6/2020 11:31 PM
fml ? fuck my life ?
Avatar
ya lol
Avatar
GormusSenex 4/6/2020 11:32 PM
i usually say fml when shit doesnt work... been saying that a lot lately 😂
Avatar
are u reloading the plugin alot ?
Avatar
GormusSenex 4/6/2020 11:32 PM
me ?
Avatar
yes
Avatar
GormusSenex 4/6/2020 11:32 PM
not reloading at all.
Avatar
hm
Avatar
GormusSenex 4/6/2020 11:33 PM
how can i check that FUniqueNetIdSteam is present. can that cause it ? (edited)
11:33 PM
if theres no UniqueIdField then it calls an empty container ?
Avatar
possibly
Avatar
GormusSenex 4/6/2020 11:34 PM
how I check its not null ?
11:34 PM
apparently i cant do != NULL
Avatar
why not pass the PC in the DelayExecute as an argument though
11:35 PM
or are you doing this already ?
Avatar
GormusSenex 4/6/2020 11:35 PM
no im passing the AShooterPlayerController
Avatar
PC = PlayerController
11:36 PM
maybe try to pass steamID and then find the PC from SteamID ?
11:36 PM
this guarantees it won't be null
Avatar
GormusSenex 4/6/2020 11:36 PM
im calling it from Hook_AShooterGameMode_HandleNewPlayer
Avatar
also from experience with HWIDBans the PC address seems to change so it sounds like you might have the same isue
Avatar
GormusSenex 4/6/2020 11:37 PM
so ig even if the player logs out immidately there should still be a steam id. yea, that might work
11:37 PM
ohh ok
Avatar
well in HWIDBans i had a TMap of PlayerController pointers and the thing was it would be null even if the player was ingame sometimes
11:37 PM
so since then i just keep track of players by SteamID
Avatar
GormusSenex 4/6/2020 11:38 PM
thats wierd. like the game null's the controller and creates a new one. maybe it does so when a player changes map ?
Avatar
if you keep track of BeginPlay events and such you can probably make it work
Avatar
GormusSenex 4/6/2020 11:39 PM
actually !!!! heureka !!!
11:39 PM
if i change map and then back again, i get two messages from the delayed call. like theres two controllers present !!!
11:39 PM
ohh
Avatar
@Lethal
12:27 AM
did that PDB thing fix your issue?
Avatar
I added it to the other api json
12:33 AM
Starting up the server now with the pdbconfig.json and my logging added
12:35 AM
It was the reason the hook wasn't getting executed though. (edited)
Avatar
try { UPrimalItem* item = _this->MyItemField(); if (item) { if (item->ItemDurabilityField() <= 0.f) { FString itemName = item->DescriptiveNameBaseField(); AShooterPlayerController* pc = ArkApi::GetApiUtils().FindControllerFromCharacter(item->GetOwnerPlayer()); if (pc) { AShooterPlayerState* State = static_cast<AShooterPlayerState*>(pc->PlayerStateField()); if (State) { FTribeData* tribe = State->MyTribeDataField(); (edited)
1:16 AM
@substitute This doesn't seem to get a PC so not sure how else to get to the TribeData.
Avatar
but this would only work if the player is not dead and online
Avatar
I was online and not dead still didn't work.
1:19 AM
I use similar logic elsewhere and works fine.
1:19 AM
Not sure how to get to the tribe data without going through a PlayerState
1:20 AM
I need at the very least a TribeId
Avatar
what are you trying to do ?
Avatar
I need to get the TribeId for who dropped an egg.
Avatar
unsigned __int64& DroppedByPlayerIDField() { return *GetNativePointerField<unsigned __int64*>(this, "ADroppedItem.DroppedByPlayerID"); }
Avatar
I guess technically a dino could lay an egg and it hatch or a player could drop the egg and it hatch.
Avatar
struct ADroppedItem : AActor
1:23 AM
TWeakObjectPtr<AActor> & DroppedByActorField() { return *GetNativePointerField<TWeakObjectPtr<AActor>*>(this, "ADroppedItem.DroppedByActor"); }
Avatar
So I need the TribeId the dino that layed the egg or the player that dropped it.
Avatar
i guess if a dino dropped the egg it would be the last one
Avatar
Ultimately I just need a TribeID so I can add a tribe log entry.
Avatar
you can get it from AActor with TargetingTeamField
Avatar
TargetingTeamField is the TribeId?
Avatar
yes
Avatar
Ok, I didn't know that. Never messed with any of the team fields.
Avatar
thank WC for their great variable naming lol
Avatar
substitute 4/7/2020 5:04 AM
@Lethal
Avatar
substitute 4/7/2020 5:05 AM
you would use the player id (not steam id)
5:05 AM
and you could find the tribe they are in
Avatar
TargetingTeamField() worked
Avatar
substitute 4/7/2020 5:06 AM
👍
5:07 AM
btw
5:07 AM
this may help you a lot
5:07 AM
but gamemode has AddToTribeLog
5:07 AM
which you could hook if you wanted to just get the messages
Avatar
I use that already actually.
5:10 AM
I'm creating new messages for things ARK doesn't already do.
5:13 AM
Using 9 different hooks currently 8 of them are to do things ARK doesn't do already and the 9th is AddToTribeLog 🙂 (edited)
Avatar
substitute 4/7/2020 5:40 AM
ah
5:40 AM
nice
Avatar
Is there a way to have RCON commands stored in a config like "broadcast Hello World!" and executed like it was sent from an RCON client? I'm having a hell of a time trying to get a working RCON client built inside a plugin do this through actual RCON. So, maybe there is a way I didn't see that someone else knows about? Since the following adds new commands and calls a function that does whatever its supposed to do. So this would require writing code for every built in rcon command so it knows the parameters and what to do. There has to be a generic method somewhere right? ArkApi::GetCommands().AddRconCommand (edited)
4:26 PM
Was thinking maybe I could hook ProcessRCONPacket and pass a fake RCONClientConnection or something.
Avatar
Bl4ckSkull666 4/8/2020 8:03 PM
Hey guys, anyone know who i send data for Plugin Cross Server Chat from OwnProx? Format i know is CrossServerKey,UserId,SteamName,Nickname,Tribename,Message with Prefix this will be send to other servers..
Avatar
itsdarkcloud 4/13/2020 4:17 AM
Anyone have issues getting json.hpp to compile in visual studios 2019? It's a third party library used in https://ark-server-api.com/resources/kill-feed.18/
Kill Feed Source: Click Here Features: Player Death Feed Tamed Dino Death Feed Notifications at top of screen Can display Weapon Name and Icon Can display just Weapon Icon Can display just Weapon Name Can display in chat box Can display...
Avatar
@itsdarkcloud what is the error ?
Avatar
itsdarkcloud 4/13/2020 4:32 AM
4:38 AM
Seems value and got concatenated somehow. Fixed that now its just an intellisense error.
Avatar
itsdarkcloud 4/13/2020 4:48 AM
Is there documentation for properties of the classes? APrimalDinoCharacter
4:48 AM
I'm assuming this will get me a true/false value for is a baby. Dino->bIsBaby().Get()
Avatar
Dino->bIsBaby()() I believe should give you a value.
Avatar
Yeah "dino->bIsBaby()();" is what we use in Dino Passive Protection plugin
Avatar
Hello, is there a way to set the value of differents stats of items ? I only saw getters in the API like : item->GetItemStatString(&itemDurability, EPrimalItemStat::MaxDurability); but want to do things like that : item->SetItemStat(&itemDurability, EPrimalItemStat::MaxDurability); Thank you in advance for the help
Avatar
you will have to calculate it and set it
11:47 AM
there is no func for it
Avatar
Yes but how to set it ?
Avatar
if u wait 5 min i can send you my function for it
Avatar
Ok thank you. Take your time
Avatar
void SetItemStatValue(UPrimalItem* item, EPrimalItemStat::Type item_stat_type, const float new_value) { float newStat = 0.f; if (item_stat_type == EPrimalItemStat::Armor || item_stat_type == EPrimalItemStat::MaxDurability) { item->ItemStatValuesField()()[item_stat_type] = 0; float old_stat_modifier = item->GetItemStatModifier(item_stat_type); item->ItemStatValuesField()()[item_stat_type] = 1; newStat = (new_value - old_stat_modifier) / (item->GetItemStatModifier(item_stat_type) - old_stat_modifier); } else if (item_stat_type == EPrimalItemStat::WeaponDamagePercent) { item->ItemStatValuesField()()[item_stat_type] = 0; float min_damage = item->GetItemStatModifier(item_stat_type); item->ItemStatValuesField()()[item_stat_type] = 65535; float max_damage = item->GetItemStatModifier(item_stat_type); float diff = max_damage - min_damage; float multiplier = 65535 / diff; newStat = new_value / 100.f - min_damage; newStat *= multiplier; newStat += 1.f; } if (newStat >= 65536.f) newStat = 65535; item->ItemStatValuesField()()[item_stat_type] = newStat; if (item_stat_type == EPrimalItemStat::MaxDurability) { if (item->bUseItemDurability()()) item->ItemDurabilityField() = item->GetItemStatModifier(item_stat_type); } #ifdef Ark item->UpdatedItem(false); #endif #ifdef Atlas item->UpdatedItem(); #endif } (edited)
11:57 AM
@Neka
Avatar
Thank you very much @WETBATMAN. Really appreciated
Avatar
itsdarkcloud 4/23/2020 8:14 PM
Anyone use third party libraries in their plugins? How do you deploy it? I've tried adding in CPR for making HTTP requests and it fails to load the plugin if I reference the code. My build includes libcurl.dll and zlib.dll. Is there something else required to use third party libraries, any direction would be helpful!
Avatar
you can just do #include <Requests.h>
Avatar
itsdarkcloud 4/23/2020 8:44 PM
That's in the ARK API?
Avatar
yeah
Avatar
I had issues with the curl implementation seemingly not sending my requests sometimes. So I went back to the built in ShooterGameState->HTTPPostRequest method. (edited)
Avatar
itsdarkcloud 4/24/2020 3:18 PM
I think Requests.h requires an additional linked library
Avatar
it doesn't
3:29 PM
API already has CURL
Avatar
itsdarkcloud 4/24/2020 3:35 PM
FString verb = "POST"; const bool result = ArkApi::Requests::Get().CreateRequest(DiscordWebhookURL, verb , &RequestCallback, FString(my_json.dump()), true, "application/json"); (edited)
3:36 PM
C#/JS dev trying to add some functionality to a mod, it's been very slow going
Avatar
@itsdarkcloud Have you looked at the open source plugins on Michidu's repo for any plugin that has similar functionality ?
Avatar
it's easier to send a webhook via UE4
4:33 PM
ShooterGameState->HTTPPostRequest(DiscordWebhook, request.c_str());
4:33 PM
AShooterGameMode* GameMode = ArkApi::GetApiUtils().GetShooterGameMode(); AGameState* GameState = GameMode->GameStateField(); AShooterGameState* ShooterGameState = static_cast<AShooterGameState*>(GameState); std::wstring request;
Avatar
itsdarkcloud 4/24/2020 4:47 PM
where request is a json string?
Avatar
ShooterGameState->HTTPPostRequest(DiscordWebhook, FString(ArkApi::Tools::Utf8Decode(my_json.dump().c_str()));
4:50 PM
based on the code you provided I would do it like that.
Avatar
itsdarkcloud 4/24/2020 4:50 PM
awesome thanks
Avatar
AShooterGameState* ShooterGameState = static_cast<AShooterGameState*>(ArkApi::GetApiUtils().GetShooterGameMode()->GameStateField());
4:52 PM
put that before to get the ShooterGameState pointer
Avatar
itsdarkcloud 4/24/2020 5:05 PM
Winner winner, that worked
Avatar
Is there a trick to disable the plugin unload feature? I have one plugin that I can't get to support unloading because of a library i'm using. I have removed Unload() and return false in the DLL_PROCESS_DETACH but still says it unloaded the plugin.
Avatar
@Lethal what api version are you using ?
Avatar
Hmmm
2:13 AM
Where does it say the plug-in was unloaded ?
Avatar
server console window
Avatar
Check the config files for the api to make sure plug-in hot reloading is disabled although I'm fairly confident it ships with that disabled , if that doesn't work you might need to look into the source code and check how it handles it
2:16 AM
The latter of the two I mentioned will probs give you the answer
Avatar
auto reload is off
Avatar
Check the commit where plug-in hot reloading was fixed that's a good starting point if you do decide to go down that path
Avatar
not a huge deal as I state the plugin is not compatible with plugins.unload
2:18 AM
Only one I can't get to unload though so bugs me a little bit.
Avatar
Is it multi threaded or something ?
Avatar
Ya, its using a threading library etc
2:20 AM
I tried clearing the thread queue and stopping the threads but it locks up the server 🙂
2:20 AM
At least in its current form it just lies and said it unloaded without crashing the server.
Avatar
In #【🤹】ʀᴇꜰᴇʀᴇɴᴄᴇꜱ
Avatar
I used the code from Wooly
2:21 AM
Didn't work with this setup.
Avatar
There is a example at the bottom of how to unload a multithreaded plug-in that might give you a hint how to stop it
2:21 AM
Ah
2:22 AM
rothonk
2:22 AM
The only other thing that comes to mind is maybe do 2 separate plugins and somehow call the one that shouldn't be unloaded
2:23 AM
Or 2 separate dll's
2:23 AM
That's me guessing wildly what might work
Avatar
Well previously you couldn't reload the plugin or the config but I at least fixed the config reload.
Avatar
maybe hook the API and make it display a diff message for your plugin ? 😄
Avatar
Haven't done multithreaded plugins so your best bet is to maybe look at some open source code on unknowncheats.me they usually deal with dll's and you might stumble upon something there
2:26 AM
I'd go with looking at the source code on michindus GitHub and see if you can't stop the unloading that way
Avatar
My other plugins that use threads unload fine it something with this particular library combination i'm using.
Avatar
Spikeydragoon 4/25/2020 7:14 PM
how would one go about changing the base stats of a dino? I tried the Dino->MyCharacterStatusComponentField()->SetMaxStatusValue(type/value here) but on server reboot/transfer they go back to default.
Avatar
GormusSenex 4/25/2020 7:18 PM
i dont know if thats the right method, but have u remembered to save the server before reboot ?
Avatar
Spikeydragoon 4/25/2020 7:18 PM
yep.
Avatar
only way is to set dino stat points
7:19 PM
otherwise it will get reset
7:20 PM
1. make your own system that stores dino stats and points and set the dino points each time the server is about to reset them 2. set dino stats the way the game does it (by putting appropriate points in each stat) this comes with a few limitations tho
7:20 PM
you won't be able to set precise stats and you can only put 255 points in each stat
Avatar
Spikeydragoon 4/25/2020 7:21 PM
id be fine with the 255 for each stat what is the method to do that?
7:21 PM
Well i guess question would be would that mess the player added points up?
Avatar
no, the player added points and the points the dinos get before they're wild are not in the same variables
7:22 PM
also another limitation is that you cannot customize speed btw
7:22 PM
any point put in speed is a wasted point 😛
Avatar
Spikeydragoon 4/25/2020 7:23 PM
yeah thats fine biggest was the other stats anyways.
7:23 PM
Is this a method you call in the api already or is it custom?
7:23 PM
shared by michidu and originally made by Tobias
Avatar
Spikeydragoon 4/25/2020 7:26 PM
cool thank you.
Avatar
GormusSenex 4/25/2020 7:34 PM
wait, @WETBATMAN do one actually have to save the "new" stats separately and re-set it every time ? i might have misunderstood something (i hope)
Avatar
if you wanna go that route you could 😛
7:35 PM
the game will not save dino stats unless you calculate how many points in each stat the dino needs and give it to the dino
7:35 PM
that's the only way to save dino stats without having to make your own dino stat manager
Avatar
GormusSenex 4/25/2020 7:36 PM
the snipit u just provided. diesnt that save the dino. so if u breed it, the children inherits the stats aswell ?
7:36 PM
doesnt*
Avatar
yeah it would
7:37 PM
it sets wild dino points
Avatar
GormusSenex 4/25/2020 7:37 PM
ahh ok. im guessing ur talking about the token-system on eliteark or something where u can buy tokens and put in dino ?
Avatar
@Spikeydragoon forgot to mention, since in ARK dino level is determined by it's stats you cannot provide a custom level for the dino anymore
7:38 PM
dunno how that one works tbh
Avatar
Spikeydragoon 4/25/2020 7:41 PM
ah so you can use the normal spawn dino command then set stats? @WETBATMAN
Avatar
yes you need the pointer to the APrimalDinoCharacter anyway....
Avatar
Spikeydragoon 4/25/2020 7:42 PM
cant not can*
7:42 PM
so if i say spawn 1200 then do max 255 your saying would change that dinos level?
Avatar
you need to spawn the dino first, then modify the stats, the function in my message will adjust the dino level
Avatar
Spikeydragoon 4/25/2020 7:43 PM
Ah good to know.
Avatar
dino level is dictated by stats + 1, for example a wild dino with 255 points in damage and 255 points in HP is a lvl 511 dino (didn't include stat points from other stats in this example)
Avatar
🐨Dream Doctor🦘 4/28/2020 4:29 PM
Does anyone have an example of running a scriptcommand from within a plugin?
Avatar
exactly the same as a console command
4:40 PM
or you can call the ScriptCommand function from UShooterCheatManager
Avatar
Hey, which events (hooks) would be used to detect a player joining and leaving the server, preferably with character name? I'm currently looking at IsFirstPlayerSpawn or HandleNewPlayer and maybe OnLogout - is this correct?
Avatar
GormusSenex 5/5/2020 8:14 PM
@arkin c++ DECLARE_HOOK(AShooterGameMode_HandleNewPlayer, bool, AShooterGameMode*, AShooterPlayerController*, UPrimalPlayerData*, AShooterCharacter*, bool); DECLARE_HOOK(AShooterGameMode_Logout, void, AShooterGameMode*, AController*);
Avatar
Thanks @GormusSenex
Avatar
Rogue Leader 5/6/2020 12:38 AM
I dont think HandleNewPlayer will have the actual character name on a players first login, but the steam name and id should be there.
Avatar
hmm ok
Avatar
@Rogue Leader yes but with this you can add their account id to a map
11:32 AM
And then on player spawn event, if their id is in the map, pull the character name and then pop their id from the map
Avatar
@substitute perfect, which event is that?
11:38 AM
digs
11:39 AM
The above mentioend IsFirstPlayerSpawn ?
Avatar
DECLARE_HOOK(AShooterPlayerState_ServerRequestCreateNewPlayer_Implementation, void, AShooterPlayerState*, FPrimalPlayerCharacterConfigStructReplicated);
12:24 PM
@arkin
12:24 PM
void Hook_AShooterPlayerState_ServerRequestCreateNewPlayer_Implementation(AShooterPlayerState* _this, FPrimalPlayerCharacterConfigStructReplicated PlayerCharacterConfig) { if (_this && !PlayerCharacterConfig.PlayerCharacterName.IsEmpty()) { if ((IsInvalidNameCharacter(PlayerCharacterConfig.PlayerCharacterName) || IsNameInBlackListCharacter(PlayerCharacterConfig.PlayerCharacterName)) && _this->GetShooterController()) { ArkApi::GetApiUtils().SendNotification(_this->GetShooterController(), { 1,0,0,1 }, 2, 5, nullptr, *NameControl::conf::CannotUseCharacterName); _this->GetShooterController()->ClientShowCharacterCreationUI(false); return; } } AShooterPlayerState_ServerRequestCreateNewPlayer_Implementation_original(_this, PlayerCharacterConfig); } (edited)
12:24 PM
i use it for my Name Control plugin
Avatar
Hmm, is that on new character creation or when the player first spawns @WETBATMAN ?
Avatar
it's when you create a character and spawn it
12:25 PM
so that would be first join 😄
12:25 PM
or if they create a new character
Avatar
ahhh ok, I assumed that would only be after designing a new char model, not connection/transfer
12:25 PM
thanks
Avatar
Anyone familiar with blueprints that have a max use on them? It looks like it is using the following in the disassembler to track remaining uses but why it would be using it this way i'm not sure. (edited)
9:54 PM
That last line when true eventually calls "RemoveItem" to delete the blueprint from the inventory.
9:56 PM
This code is contained in the function "FinishCraftingBlueprint"
Avatar
@Lethal Perhaps it has something to do with int IncrementItemTemplateQuantity(TSubclassOf<UPrimalItem> ItemTemplate, int amount, bool bReplicateToClient, bool bIsBlueprint, UPrimalItem * *UseSpecificItem, UPrimalItem * *IncrementedItem, bool bRequireExactClassMatch, bool bIsCraftingResourceConsumption, bool bIsFromUseConsumption, bool bIsArkTributeItem, bool ShowHUDNotification, bool bDontRecalcSpoilingTime, bool bDontExceedMaxItems) { return NativeCall<int, TSubclassOf<UPrimalItem>, int, bool, bool, UPrimalItem**, UPrimalItem**, bool, bool, bool, bool, bool, bool, bool>(this, "UPrimalInventoryComponent.IncrementItemTemplateQuantity", ItemTemplate, amount, bReplicateToClient, bIsBlueprint, UseSpecificItem, IncrementedItem, bRequireExactClassMatch, bIsCraftingResourceConsumption, bIsFromUseConsumption, bIsArkTributeItem, ShowHUDNotification, bDontRecalcSpoilingTime, bDontExceedMaxItems); } ?
Avatar
Perhaps but I was pretty sure that was used for item stacking.
Avatar
Well possibly if it isn't you can hook onto the function and add a throw; statement and find the call hierarchy which might yield some better functions
Avatar
I'm looking in the disassembler I see everything.
3:34 PM
UseItemOnItemSound is a USoundBase class so i'm not entirely sure what the code above is even doing.
3:37 PM
I know it is subtracting one from something then checking if it has become less than 0 to destroy the item. But the class + 4 doesn't make sense to me.
Avatar
substitute 5/8/2020 4:15 PM
@Lethal could be a pointer (edited)
4:16 PM
Class + 0x4 as a pointer would be the field at 0x4
Avatar
In the class?
4:18 PM
USoundBase looks like this..
4:19 PM
FName is 8 bytes though 0x0 and 0x4
4:20 PM
So maybe its looking at the FName.Number
4:21 PM
Just seems like if they have a Max Uses field they would have a Remaining Uses field
4:22 PM
I just wasn't even entirely sure if my code decompiled properly.
Avatar
substitute 5/8/2020 4:27 PM
Check the parent structure
4:27 PM
I can also look later
Avatar
The parent of USoundBase?
Avatar
substitute 5/8/2020 4:28 PM
I mean the actual primal item
4:28 PM
Check it at offset of usoundbase + 0x4 (edited)
4:29 PM
4:29 PM
Looks to me like the address of use item on item sound + 4
4:29 PM
Then dereferenced
Avatar
substitute 5/8/2020 4:30 PM
That’s strange
4:31 PM
I’ll take a look myself
Avatar
Ok, thanks.
Avatar
substitute 5/8/2020 5:18 PM
@Lethal
5:18 PM
use CustomItemIDField (edited)
5:19 PM
if CustomItemIdField < 0 -> the blueprint is removed
Avatar
So does that mean the decompiled source i'm looking at is wrong?
Avatar
substitute 5/8/2020 5:19 PM
It could just be incorrect or incomplete
5:20 PM
is this generated by IDA or did a person make it
Avatar
i'm using Ghidra
Avatar
substitute 5/8/2020 5:20 PM
oh
5:21 PM
never used Ghidra
5:21 PM
it could have made a mistake
5:21 PM
anyway, try item->CustomItemIdField
Avatar
Ok, I will check it
Avatar
substitute 5/8/2020 5:22 PM
@Lethal
5:22 PM
wanna see what I made the other day ?
Avatar
Sure
Avatar
substitute 5/8/2020 5:23 PM
5:23 PM
I wrote a hack for a game
5:23 PM
to add more color palettes
5:23 PM
the normal amount is 8, I increased it to 101
5:23 PM
the colors are just using random data for debugging
Avatar
What system is that game on?
Avatar
substitute 5/8/2020 5:24 PM
PC
5:24 PM
5:24 PM
SweatyNerd
5:24 PM
I wrote mid-function hooks
Avatar
ah, cool
5:25 PM
and a few macros
5:26 PM
@Lethal reversal as a huge pain though
5:26 PM
the game is stripped, so IDA doesn't even know function boundaries
Avatar
I assume no pdb was avaialble?
Avatar
substitute 5/8/2020 5:26 PM
I had to use Cheat Engine and debug it real time
5:26 PM
lol no
5:26 PM
I used the power of breakpoints
Avatar
Reversal from scratch is a lot of work.
Avatar
substitute 5/8/2020 5:27 PM
well normally you have function boundaries and stuff
Avatar
everything is unknown
Avatar
substitute 5/8/2020 5:27 PM
so IDA can at least graph stuff
5:27 PM
since this was stripped IDA wouldn't even have the entry point* *Entry points are the easy part (edited)
Avatar
You know some assembly at least I assume?
Avatar
substitute 5/8/2020 5:28 PM
I knew some absolute basics
5:28 PM
but I learned more to get the hack to work without crashing the game
Avatar
Your suggested field works btw.
5:31 PM
I tried many different fields but that wasn't one of them lol
5:33 PM
5:36 PM
I guess I need to look at getting a proper IDA version setup so i'm not chasing weird decompile issues like this one. This isn't the first time I found something that I thought looked strange.
Avatar
substitute 5/8/2020 6:36 PM
@Lethal np
6:36 PM
and ye
Avatar
I started over from scratch in Ghidra and the source looks much better now.
Avatar
substitute 5/9/2020 1:36 AM
Nice
Avatar
@Lethal Is that a plugin that limits number of crafts per blueprint?
Avatar
That is a really good idea.
Avatar
does anyone know whether it is possible to check if a structure will get placed placed in a cave ...
Avatar
Look at the damage multiplied on this I think someone said @Mr.Salt
Avatar
There should be a way to check
8:54 PM
An is in cave method or the likes
Avatar
GormusSenex 5/20/2020 9:00 PM
I tried looking at the Ghidra code too, but couldnt easily find anything related to caves. if any of u find it, id gladly hear about it. i rly dont wannt go down the path of checking actual damage vs "normal"/non-cave damage
Avatar
I believe you have to look at the ZoneVolume info
9:44 PM
I'm waiting for the function "IsAllowedToBuild" to decompile it is taking awhile.
9:45 PM
"AdjustDamage" is another function of interest as that should be where the damage penalty is applied
Avatar
looks like AdjustDamage field is not added yet when you place the structure aka IsAllowedToBuild
Avatar
is ZoneVolume info or Physics Volume available in the API? (edited)
Avatar
you can always import something if it's not in the API currently
Avatar
Mr. Whitlock 5/21/2020 11:42 PM
Hello. Was wondering how i would go about creating a plugin that increases the amount of food given from kibble to tamed dinos. (edited)
Avatar
AaronBasques 5/23/2020 10:55 PM
hey peoples so i added ArkCrossServerChat to VS but it seems to have an error that my knowledge is lacking on, I've googled for documentation, but i;m just not understanding it or don't know what I'm looking for.
10:57 PM
auto chatIcon = static_cast<ChatIcon>(icon); UTexture2D *iconTexture = nullptr; // get chat icon if (chatIcon == ChatIcon::Admin) { auto engine = Globals::GEngine()(); auto primalglobals = engine->GameSingletonField()(); auto gamedata = primalglobals->PrimalGameDataOverrideField()(); if (!gamedata) gamedata = primalglobals->PrimalGameDataField()(); auto texture = gamedata->NameTagServerAdminField()(); if (texture) iconTexture = gamedata->NameTagServerAdminField()(); } (edited)
Avatar
you must have pointer to function type
Avatar
AaronBasques 5/23/2020 11:28 PM
yeah that much it says, i have no idea what that mean though, i'm inexperienced with C++ The plugin works in the downloadable version precompiled, so i have no idea what this issue is or how to solve it as i have changed nothing in the plugin yet this error exists
Avatar
@AaronBasques
12:13 AM
if (chatIcon == ChatIcon::Admin) { auto engine = Globals::GEngine()(); auto primalglobals = static_cast<UPrimalGlobals*>(engine->GameSingletonField()); auto gamedata = primalglobals->PrimalGameDataOverrideField(); if (!gamedata) gamedata = primalglobals->PrimalGameDataField(); auto texture = gamedata->NameTagServerAdminField(); if (texture) iconTexture = gamedata->NameTagServerAdminField(); }
12:13 AM
try this
12:14 AM
the chat plugin was using an older API version which seemed to return a DataValue<Type*> instead of a raw pointer. (edited)
12:15 AM
GEngine still returns DataValue<UEngine*>, but GameSingletonField returns UObject* directly.
Avatar
AaronBasques 5/24/2020 12:15 AM
ahh interesting, so a pointer is a valid object reference? and casting it to its correct type was the issue?
Avatar
no
12:16 AM
the original data type was a structure that contained the pointer as a field
12:16 AM
now it just returns the pointer directly
Avatar
AaronBasques 5/24/2020 12:16 AM
oh ahh yeah i see
12:17 AM
its no longer showing an issue, much appreciated
12:17 AM
mucho to learn i has
Avatar
GEngine() returns DataValue<UEngine*> DataValue<T>() I believe is overloaded to return the pointer contained in that structure GEngine()() is the same as doing auto EngineDV = GEngine(); auto Engine = EngineDV();
12:17 AM
it's just chaining the () to reduce the need for variables
12:18 AM
12:18 AM
T& operator()() const { return *value_; }
12:18 AM
The problematic fields were because a function used to use DataValue but does not now
12:19 AM
12:19 AM
Avatar
AaronBasques 5/24/2020 12:19 AM
yeah so be weary of older plugins thanks for the help
12:19 AM
pepelaughW
12:20 AM
@AaronBasques honestly you're better off scraping this plugin and making your own
Avatar
AaronBasques 5/24/2020 12:20 AM
lol, love depreciation
Avatar
If you wrote a very basic relay server you could simply have the machines send the chat messages to the relay
12:21 AM
which then would relay back to other servers
12:21 AM
That would also fix the "works on a single machine only" issue as well
Avatar
AaronBasques 5/24/2020 3:51 AM
Anyone happen to know why creating an FName would end up being None? FName funcname = FName(TEXT("TestA"), EFindName::FNAME_Find, true); FString nameString; funcname.ToString(&nameString); Log::GetLog()->warn("Function Check: {}", nameString.ToString());
3:53 AM
@substitute I'm not using that plugin, I'm just learning from it, some of the plugins have good ways of doing things
Avatar
AaronBasques 5/26/2020 4:29 PM
@𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 have you run in to the issue i posted a couple of days ago about creating an FName and it being None?
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 5/26/2020 5:20 PM
Could you link me that question please?
Avatar
AaronBasques 5/26/2020 5:21 PM
its the one above my last
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 5/26/2020 5:23 PM
Is there another constructor or maybe even a static function which returns you a FName by given string?
Avatar
AaronBasques 5/26/2020 5:23 PM
i tried the two constructors available and couldn't find any other way of creating one
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 5/26/2020 5:24 PM
because I remember using FName's somewhere but not this way I guess
Avatar
AaronBasques 5/26/2020 5:25 PM
there are more constructors listed on unreal website, but they aren't in the api, maybe the listed ones are for newer versions i'm stuck with this, i need an FName to call a ufunction from an object
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 5/26/2020 5:25 PM
FName(TEXT("TestA")) try this
Avatar
AaronBasques 5/26/2020 5:25 PM
please no, not that simple 😮
5:26 PM
will test
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 5/26/2020 5:26 PM
I think it was smth like that.. it wasn't big 😄
Avatar
AaronBasques 5/26/2020 5:27 PM
nah :(
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 5/26/2020 5:29 PM
Let me look it up for you 🙂
Avatar
AaronBasques 5/26/2020 5:29 PM
i would be most grateful
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 5/26/2020 5:38 PM
Seems like I stopped using FName.. at the point I thought it would be 😄
5:39 PM
Why do you need it? Maybe there is another way to get to that (edited)
Avatar
AaronBasques 5/26/2020 5:40 PM
I'm getting an actor in the worlds and using FindFunctionChecked
5:40 PM
well, trying to
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 5/26/2020 5:40 PM
And what actor? what is special about that actor? lol
Avatar
AaronBasques 5/26/2020 5:41 PM
Its a singleton in a mod that i use so i can call a function and pass values from the plugin to the mod
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 5/26/2020 5:42 PM
Ah okay I see now
5:42 PM
FName::Init(&v146, L"None", 0, FNAME_Add, 0, 0);
5:43 PM
Thats how ARK does it internally when it loads all FNames
5:43 PM
FName::Init(&v146, L"None", 0, FNAME_Add, 0, 0); FName::Init(&v147, L"ByteProperty", 0, FNAME_Add, 0, 1); FName::Init(&v148, L"IntProperty", 0, FNAME_Add, 0, 2); FName::Init(&v149, L"BoolProperty", 0, FNAME_Add, 0, 3); FName::Init(&v6, L"FloatProperty", 0, FNAME_Add, 0, 4); FName::Init(&v76, L"ObjectProperty", 0, FNAME_Add, 0, 5); FName::Init(&v8, L"NameProperty", 0, FNAME_Add, 0, 6); .... FName::Init(&v135, L"InterpCurveVector", 0, FNAME_Add, 0, 408); FName::Init(&v137, L"InterpCurveTwoVectors", 0, FNAME_Add, 0, 409); FName::Init(&v139, L"InterpCurveQuat", 0, FNAME_Add, 0, 410); FName::Init(&v141, L"AI", 0, FNAME_Add, 0, 450); FName::Init(&v143, L"NavMesh", 0, FNAME_Add, 0, 451); FName::Init(&v145, L"PerformanceCapture", 0, FNAME_Add, 0, 500); (edited)
Avatar
AaronBasques 5/26/2020 5:44 PM
well shiit
5:45 PM
i'm just having no luck with this
5:46 PM
wait, do i have to add before i can find?
Avatar
𝓐𝓭𝓻𝓲𝓪𝓷𝓖𝓪𝓶𝓲𝓷𝓰 5/26/2020 5:46 PM
Seems like that 🙂
Avatar
AaronBasques 5/26/2020 5:46 PM
hmm
Avatar
AaronBasques 5/26/2020 5:55 PM
nah i tried with this and no joy.. FName(TEXT("TestFunctionA"), EFindName::FNAME_Add, true); FName funcname = FName(TEXT("TestFunctionA"), EFindName::FNAME_Find, true); even no joy with this.. FName funcname = FName(TEXT("TestFunctionA"), EFindName::FNAME_Add, true); also with ...FNAME_Add, false); no joy
Avatar
@AaronBasques you can try finding the function in the global objects list
6:27 AM
void APrimalDinoCharacter::BrakeDinoBP(float val) { static auto fn = UObject::FindObject<UFunction>("Function ShooterGame.PrimalDinoCharacter.BrakeDinoBP"); APrimalDinoCharacter_BrakeDinoBP_Params params; params.val = val; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; }
6:27 AM
this is one way for example
6:27 AM
This was computer generated^
6:28 AM
I'm working on writing some templates and macros to reduce the overall amount of code required to call functions.
6:28 AM
struct Packed { char* parameters; char* returnValue; int size; }; template<typename ...Ts> Packed f(Ts&&... args) { int i = sizeof...(Ts); Packed packed; packed.size = (sizeof(Ts) + ...); char* memoryBlock = (char*)calloc(1, packed.size); packed.parameters = memoryBlock; auto pack = [&memoryBlock, &packed](auto& item) { memcpy(memoryBlock, &item, sizeof(item)); packed.returnValue = memoryBlock; memoryBlock += sizeof(item); //move pointer forward }; (pack(args), ...); return packed; }
6:28 AM
my C++17 template for packing args into the same memory layout as if they were a structure.
Avatar
AaronBasques 5/30/2020 6:43 AM
I'm not really sure how i would go about using that, I'm not overly experienced. here is what i have so far, called in Hook_AShooterGameMode_BeginPlay after AShooterGameMode_BeginPlay_original auto engine = Globals::GEngine()(); auto primalglobals = static_cast<UPrimalGlobals*>(engine->GameSingletonField()); auto gamedata = primalglobals->PrimalGameDataOverrideField(); // if (!gamedata) gamedata = primalglobals->PrimalGameDataField(); auto singletons = gamedata->ServerExtraWorldSingletonActorClassesField(); for (auto singleton : singletons) { if (singleton.uClass) { FString className; singleton.uClass->GetDescription(&className); if (className.Equals("Singleton_TestSingleton")) { TArray<AActor*> SingletonActors; UGameplayStatics::GetAllActorsOfClass(reinterpret_cast<UObject*>(ArkApi::GetApiUtils().GetWorld()), singleton, &SingletonActors); for (auto singletonactor : SingletonActors) { // works if i use the name of the class as the fucntion name // FName funcname = singletonactor->NameField(); FName funcname = FName(TEXT("TestA"), EFindName::FNAME_Find, true); FString nameString; funcname.ToString(&nameString); if (nameString.ToString() == "None") { Log::GetLog()->warn("Function Check: {} for {}", nameString.ToString(), "TestA"); return; } UFunction* Func = singletonactor->FindFunctionChecked(funcname); if (Func) { int Args[] = { shooter_game_mode->ServerIDField() }; singletonactor->ProcessEvent(Func, Args); } else { Log::GetLog()->warn("No Function with name"); } } } } } (edited)
Avatar
AaronBasques 5/30/2020 6:51 AM
and then i have the singleton in the dev kit
Avatar
Does somebody know how to show cyrillic? What I doing wrong?
2:32 PM
for now it's printed as many rectangles
Avatar
Hello, can someone tell me how I can get the bool value from functions like this one : BitFieldValue<bool, unsigned __int32> bIsBlueprint() Thank you in advance for your help !
Avatar
bIsBlueprint()()
Avatar
bIsBlueprint()()
@Lethal Thank you very much 🙂
Avatar
Is there any way via a plugin to loop all structures on map, and repair them?
6:59 PM
I'm switching from SS to S+ and the side effect seems to be all structures are damaged..
Avatar
Just looking for a way to loop over all structures in the world tbh, I think I can do the rest from there... something to do with GetWorld() then actors
Avatar
UGameplayStatics::GetAllActorsOfClass
Avatar
Whey thanks Michidu
Avatar
Not a development related question... Anyone else running ARK Shop on a server? We seem to have all players on the map sharing the same pool of points. Wondering if we're a one-off or if there is an issue due to epic ID stuff
Avatar
this has been plently discussed, you need to update your Ark API to be able to getch the correct SteamID/EpicID
👍 1
Avatar
I have a FString but I need a std::wstring, how could I go for? (edited)
Avatar
ArkApi::Tools::Utf8Decode()
Avatar
When I try to use it, I get this error message
11:03 PM
Avatar
std string isn’t a wide string
11:16 PM
It would need to be std::wstring (edited)
Avatar
So from a FString to a std string or std wstring how could I do it?
Avatar
FString.ToString() gives a std::string
Avatar
It gives the error that type name is not allowed
Avatar
Because std string isn’t std wstring
1:57 AM
You said you needed wstring
1:58 AM
You could probably just read the raw buffer of FString without any issues
1:58 AM
Internally the buffer is wchar_t (edited)
Avatar
Yeah fixed it, thanks 😄
thumbs 1
Avatar
FUniqueNetIdSteam* steam_net_id = static_cast<FUniqueNetIdSteam*>( _this->GetPlayerData()->MyDataField()->UniqueIDField().UniqueNetId.Get()); const uint64 victim_steam_id = steam_net_id->UniqueNetId;
9:07 PM
trying to update this for the new ID's
Avatar
Why do that when you can ask the API to give you the steam id?
Avatar
honestly @Lethal it's because I'm butchering some stuff together and its to get the victims steam id on the Hook_AShooterCharacter_Die(AShooterCharacter* _this
9:20 PM
I did see GetSteamIdFromController but that wants AController
Avatar
Try this: const uint64 victim_steam_id = ArkApi::GetApiUtils().GetSteamIdFromController(_this->GetOwnerController());
Avatar
Thanks, going to give it a go
9:32 PM
previous code was crashing the server, but with the auto reboot plugin could not understand why
Avatar
Rogue Leader 6/16/2020 3:32 AM
Formally requesting that https://github.com/barnwellrd/Max-Imprint be added to #【💻】ᴘʟᴜɢɪɴꜱ (edited)
Contribute to barnwellrd/Max-Imprint development by creating an account on GitHub.
Avatar
GSH | MrOwlSky 6/17/2020 3:15 AM
Added
Avatar
AaronBasques 6/22/2020 8:12 AM
Does anyone know the hook i would need for the create character screen so i can ensure names are correct? Like: New Character Screen > filter name > incorrect > cancel create character ... (until correct)
Avatar
you can't do that without doing a mod on the game
8:25 AM
best close approach would be to change the character's name after creation to somethin like "bannedname" or something like that and let them take the hint
Avatar
AaronBasques 6/22/2020 8:25 AM
what direction would you take for the dev kit?
8:29 AM
like, what would a mod look like that does what i need?
Avatar
hmmm not sure about mods
Avatar
AaronBasques 6/22/2020 8:53 AM
oh ok, well thanks for the tip 🙂
Avatar
@Hsilamot it could be possible
9:12 AM
if you intercept the right stage of character creation and abort the creation
Avatar
only trough server side? no mods? that would be interesting ,,,
Avatar
the client requests to the server to make a character
9:13 AM
there's no reason I don't think you can't simply abort that procedure early
9:14 AM
you could then send a message with the chat box or something as a direct message to the client.
Avatar
but, after the client sends the new character info to the server, i'm guessing there's no way for the server to tell the client to re-open that window, im not actually sure of this
9:14 AM
but it would be interesting if someone develops something like that
Avatar
server restart player
9:15 AM
should work to reopen the window
Avatar
nice
Avatar
@AaronBasques it’s possible with a plugin, infact i made a name control plugin that does what u want already
Avatar
AaronBasques 6/22/2020 7:07 PM
@WETBATMAN oh cool, is that open source?
Avatar
void Hook_AShooterPlayerState_ServerRequestCreateNewPlayer_Implementation(AShooterPlayerState* _this, FPrimalPlayerCharacterConfigStructReplicated PlayerCharacterConfig) { if (_this && !PlayerCharacterConfig.PlayerCharacterName.IsEmpty()) { if ((IsInvalidNameCharacter(PlayerCharacterConfig.PlayerCharacterName) || IsNameInBlackListCharacter(PlayerCharacterConfig.PlayerCharacterName)) && _this->GetShooterController()) { ArkApi::GetApiUtils().SendNotification(_this->GetShooterController(), { 1,0,0,1 }, 2, 5, nullptr, *NameControl::conf::CannotUseCharacterName); _this->GetShooterController()->ClientShowCharacterCreationUI(false); return; } } AShooterPlayerState_ServerRequestCreateNewPlayer_Implementation_original(_this, PlayerCharacterConfig); }
Avatar
AaronBasques 6/22/2020 7:33 PM
oh i see, thank you i had already tried this function but it always crashed, maybe i did something wrong
Avatar
AaronBasques 6/22/2020 7:40 PM
@WETBATMAN yeah there must be something wrong here
7:42 PM
7:44 PM
and the crash
Avatar
What a plugin name lol
Avatar
AaronBasques 6/22/2020 7:45 PM
xD
Avatar
struct FPrimalPlayerCharacterConfigStructReplicated {} is blank in the API so you need to define it in your plugin
Avatar
AaronBasques 6/22/2020 7:47 PM
how would i even begin to do something like that lol?
Avatar
decompiler or ask wetbatman to share his definition of it as well
7:49 PM
I think Michidu is planning on adding the rest of the missing structures along with defaulting DumpAll to true.
Avatar
AaronBasques 6/22/2020 7:50 PM
oh ok, well thanks for the advice, i hope wetbatman is kind enough to share it
Avatar
maybe someone would need it you will have to fix some errors in files though
Avatar
AaronBasques 6/22/2020 7:52 PM
i'm just a beginner, i know very little about decompiling
Avatar
you will find your struct here also
Avatar
AaronBasques 6/22/2020 7:53 PM
yeah i have it, but, where do i put it?
Avatar
anywhere actually
7:55 PM
you can put whole file to your project folder and include it
7:55 PM
or just copy struct
Avatar
AaronBasques 6/22/2020 7:55 PM
you mean just paste it in any class?
Avatar
struct FPrimalPlayerCharacterConfigStructReplicated { char __padding[0xb8L]; FieldArray<FLinearColor, 4> BodyColorsField() { return {this, "FPrimalPlayerCharacterConfigStructReplicated.BodyColors"}; } FString& PlayerCharacterNameField() { return *GetNativePointerField<FString*>(this, "FPrimalPlayerCharacterConfigStructReplicated.PlayerCharacterName"); } FieldArray<float, 22> RawBoneModifiersField() { return {this, "FPrimalPlayerCharacterConfigStructReplicated.RawBoneModifiers"}; } int& PlayerSpawnRegionIndexField() { return *GetNativePointerField<int*>(this, "FPrimalPlayerCharacterConfigStructReplicated.PlayerSpawnRegionIndex"); } // Functions FPrimalPlayerCharacterConfigStruct * GetPlayerCharacterConfig(FPrimalPlayerCharacterConfigStruct * result) { return NativeCall<FPrimalPlayerCharacterConfigStruct *, FPrimalPlayerCharacterConfigStruct *>(this, "FPrimalPlayerCharacterConfigStructReplicated.GetPlayerCharacterConfig", result); } FPrimalPlayerCharacterConfigStructReplicated * operator=(FPrimalPlayerCharacterConfigStructReplicated * __that) { return NativeCall<FPrimalPlayerCharacterConfigStructReplicated *, FPrimalPlayerCharacterConfigStructReplicated *>(this, "FPrimalPlayerCharacterConfigStructReplicated.operator=", __that); } };
Avatar
AaronBasques 6/22/2020 7:56 PM
yeah thats what i found too?
Avatar
Nice Michidu the UUI_ stuff is defined here
Avatar
yeah, but in general they still need a lot of fixes
7:59 PM
probably you won't need UI stuff also
Avatar
AaronBasques 6/22/2020 8:00 PM
i'll see if i can get this working, thank you so much for your help peoples 🙂
8:06 PM
So i put that struct in the top of the file that is using it, and i still get the same error
8:11 PM
@Michidu so if i include the file i get this
8:12 PM
and if i paste the struct into the class that is using it, there error is the same as the original one, as though its not there at all
8:14 PM
i removed the #include "BaseDeclarations.h" and that error went away, but the class i'm including the file, still has these errors
8:16 PM
and then i get this on compile
8:16 PM
I'm losing the will to live.
Avatar
this struct is already declared as blank in the API, you have to remove the definition from base.h and redefine it
Avatar
AaronBasques 6/22/2020 8:18 PM
so i would have to use a custom compiled version of the API?
Avatar
no, you have to modify a header not recompile it
Avatar
AaronBasques 6/22/2020 8:21 PM
i commented out struct FPrimalPlayerCharacterConfigStructReplicated {}; in Base.h and now i get errors everywhere
8:22 PM
Michidu said i just needed to include it
8:22 PM
i dont understand
8:27 PM
do i replace struct FPrimalPlayerCharacterConfigStructReplicated {}; with the struct from the dump file?
Avatar
put it in the header of your plugin
8:28 PM
DrCleanTheColon.h is what I imagine you have as the header name 😛
Avatar
AaronBasques 6/22/2020 8:32 PM
so in the header, i have a struct and when i include the char config struct it breaks the other struct
8:32 PM
8:36 PM
@WETBATMAN when you say remove the definition from base.h and redefine it, what exactly do you mean?
Avatar
AaronBasques 6/22/2020 8:44 PM
@Lethal i included it in my header and its still got errors galore
Avatar
Read the errors
8:50 PM
8:50 PM
You have this defined twice somewhere
Avatar
it's defined in base.h
Avatar
AaronBasques 6/22/2020 8:52 PM
i am trying to understand, i know its frustrating helping noobs it is defined in Base.h and in my header file If i remove the definition from Base.h i get all sorts of other errors. i dont know what wetbatman meant by remove the definition from base.h and redefine it
Avatar
like i said, it should be undefined and left only declared in base.h
Avatar
AaronBasques 6/22/2020 8:53 PM
i dont understand that
Avatar
do you see the {} after FPrimalPlayerCharacterConfigStructReplicated ?
Avatar
AaronBasques 6/22/2020 8:54 PM
yeah i see that
Avatar
remove it
8:54 PM
just remove the {}
Avatar
AaronBasques 6/22/2020 8:55 PM
yup, i did that still i get this
8:55 PM
Avatar
now you have to define it
Avatar
AaronBasques 6/22/2020 8:56 PM
is that not defined in my header? should it be somewhere else?
8:57 PM
i also get these
Avatar
because it's not defined now
8:59 PM
😄
8:59 PM
{} was the definition
8:59 PM
you removed it
8:59 PM
now it's just declared
Avatar
AaronBasques 6/22/2020 8:59 PM
yeah but i redefined it in my header no?
Avatar
define it in the API header instead
Avatar
Actor.h is where you should put i t
9:00 PM
can place it at the top above struct FChatMessage
Avatar
AaronBasques 6/22/2020 9:01 PM
how do we go from just include the file to all this lol?
9:04 PM
that compiled thank you peoples, actor.h and base.h report like 200+ errors, but compiles 😕
9:05 PM
Thank you @Lethal and @WETBATMAN
9:06 PM
btw wetbatman, i never did manage to get that FindFunctionChecked on a custom function in a custom actor on a mod to work 😦 (edited)
Avatar
AaronBasques 6/22/2020 9:23 PM
lol FML
9:23 PM
all that for nothing, same crash
9:24 PM
i'm done for the night... i'm burned out
Avatar
hm
9:25 PM
why does your plugin not have a .pdb file ?
Avatar
AaronBasques 6/22/2020 9:26 PM
it needs it? hmm
9:27 PM
i'll add it and retry
Avatar
AaronBasques 6/22/2020 9:37 PM
Wetbatman, you're using PlayerCharacterConfig.PlayerCharacterName to get the name from the struct in your example but the struct has no member PlayerCharacterName
9:38 PM
i can only see FString& PlayerCharacterNameField()
9:42 PM
why does your differ?
9:46 PM
so i added the .pdb
9:46 PM
line 369
9:50 PM
@WETBATMAN what does your FPrimalPlayerCharacterConfigStructReplicated look like?
Avatar
PlayerCharacterNameField() and PlayerCharacterName
9:53 PM
are the same field
Avatar
AaronBasques 6/22/2020 9:54 PM
but i have an error when i try to do it the same way as you .. and it crashes if i use PlayerCharacterNameField() (edited)
9:54 PM
(edited)
Avatar
crashes where ?
Avatar
what is on that line ? 😄
Avatar
AaronBasques 6/22/2020 10:11 PM
so now i get this
10:12 PM
Avatar
try PlayerCharacterConfig.PlayerCharacterNameField().ToString() in your log line (edited)
10:21 PM
or const FString name = PlayerCharacterConfig.PlayerCharacterNameField(); and leave your log line the same
Avatar
AaronBasques 6/22/2020 10:25 PM
working on it, takes a while to start up an such for it to just crash lol
10:31 PM
so the first one suggested PlayerCharacterConfig.PlayerCharacterNameField().ToString()
10:31 PM
and the second
10:32 PM
@Lethal no joy with that 😦
Avatar
Post your code?
Avatar
AaronBasques 6/22/2020 10:33 PM
DECLARE_HOOK(AShooterPlayerState_ServerRequestCreateNewPlayer_Implementation, void, AShooterPlayerState*, FPrimalPlayerCharacterConfigStructReplicated); void Hook_AShooterPlayerState_ServerRequestCreateNewPlayer_Implementation(AShooterPlayerState* _this, FPrimalPlayerCharacterConfigStructReplicated PlayerCharacterConfig) { if (_this && !PlayerCharacterConfig.PlayerCharacterNameField().IsEmpty()) { //FString name = PlayerCharacterConfig.PlayerCharacterNameField(); const FString name = PlayerCharacterConfig.PlayerCharacterNameField(); Log::GetLog()->warn(" >>>> AShooterPlayerState_ServerRequestCreateNewPlayer_Implementation: - PlayerCharacterNameField:{}", name.ToString()); FString human = "Human"; if (PlayerCharacterConfig.PlayerCharacterNameField().Equals(human)) { ArkApi::GetApiUtils().SendNotification(_this->GetShooterController(), FColorList::Green, 1.3f, 15.0f, nullptr, "Failed to create new player..."); return; } } AShooterPlayerState_ServerRequestCreateNewPlayer_Implementation_original(_this, PlayerCharacterConfig); }
10:34 PM
this in Actor.h struct FPrimalPlayerCharacterConfigStructReplicated { char __padding[0xb8L]; FieldArray<FLinearColor, 4> BodyColorsField() { return { this, "FPrimalPlayerCharacterConfigStructReplicated.BodyColors" }; } FString& PlayerCharacterNameField() { return *GetNativePointerField<FString*>(this, "FPrimalPlayerCharacterConfigStructReplicated.PlayerCharacterName"); } FieldArray<float, 22> RawBoneModifiersField() { return { this, "FPrimalPlayerCharacterConfigStructReplicated.RawBoneModifiers" }; } int& PlayerSpawnRegionIndexField() { return *GetNativePointerField<int*>(this, "FPrimalPlayerCharacterConfigStructReplicated.PlayerSpawnRegionIndex"); } // Functions FPrimalPlayerCharacterConfigStruct* GetPlayerCharacterConfig(FPrimalPlayerCharacterConfigStruct* result) { return NativeCall<FPrimalPlayerCharacterConfigStruct*, FPrimalPlayerCharacterConfigStruct*>(this, "FPrimalPlayerCharacterConfigStructReplicated.GetPlayerCharacterConfig", result); } FPrimalPlayerCharacterConfigStructReplicated* operator=(FPrimalPlayerCharacterConfigStructReplicated* __that) { return NativeCall<FPrimalPlayerCharacterConfigStructReplicated*, FPrimalPlayerCharacterConfigStructReplicated*>(this, "FPrimalPlayerCharacterConfigStructReplicated.operator=", __that); } };
10:35 PM
ArkApi::GetHooks().SetHook("AShooterPlayerState.ServerRequestCreateNewPlayer_Implementation", &Hook_AShooterPlayerState_ServerRequestCreateNewPlayer_Implementation, &AShooterPlayerState_ServerRequestCreateNewPlayer_Implementation_original); ArkApi::GetHooks().DisableHook("AShooterPlayerState.ServerRequestCreateNewPlayer_Implementation", &Hook_AShooterPlayerState_ServerRequestCreateNewPlayer_Implementation);
Avatar
void Hook_AShooterPlayerState_ServerRequestCreateNewPlayer_Implementation(AShooterPlayerState* _this, FPrimalPlayerCharacterConfigStructReplicated PlayerCharacterConfig) { if (_this && !PlayerCharacterConfig.PlayerCharacterNameField().IsEmpty()) { FString human = FString("Human"); if (!PlayerCharacterConfig.PlayerCharacterNameField().Contains(human)) { ArkApi::GetApiUtils().SendNotification(_this->GetShooterController(), FColorList::Green, 1.3f, 15.0f, nullptr, "Failed to create new player..."); return; } } AShooterPlayerState_ServerRequestCreateNewPlayer_Implementation_original(_this, PlayerCharacterConfig); }
10:38 PM
Try that to see if it will block any name that does not contain "Human"
Avatar
AaronBasques 6/22/2020 10:38 PM
I need to be able to get the value of PlayerCharacterNameField though
10:39 PM
i was just using Human to test with
Avatar
its just a test
Avatar
AaronBasques 6/22/2020 10:40 PM
yeah i'm making the changes now
Avatar
Just attach the visual studio debugger it will stop on the error.
Avatar
AaronBasques 6/22/2020 10:40 PM
i've been testing it on a server on another machine
Avatar
AaronBasques 6/22/2020 10:49 PM
10:49 PM
10:50 PM
@Lethal nope
10:54 PM
i dont know what the issue is
10:56 PM
i dont get it how can this pass OK: !PlayerCharacterConfig.PlayerCharacterNameField().IsEmpty() on line 368 and then some null pointer on line 371 😠 (edited)
Avatar
AaronBasques 6/23/2020 2:44 AM
_ So i get this Exception thrown at 0x00007FFFBFAB122E (vcruntime140.dll) in ShooterGameServer.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
2:49 AM
the PlayerCharacterConfig isn't null, but not sure why its not getting the name value
Avatar
Try removing this "char __padding[0xb8L];" from the "struct FPrimalPlayerCharacterConfigStructReplicated {" definition you added.
Avatar
@AaronBasques
Avatar
AaronBasques 6/23/2020 3:14 AM
i removed it, still crashes with this info now
Avatar
is this for the character name thing?
Avatar
AaronBasques 6/23/2020 3:15 AM
@substitute yeah you can see in that screen what i'm trying to do
Avatar
AaronBasques 6/23/2020 3:48 AM
@Lethal what would removing that line help with?
Avatar
@AaronBasques
4:00 AM
4:00 AM
I added a test hook, working for me.
4:01 AM
void Hook_validateNames(AShooterPlayerState* _this, FPrimalPlayerCharacterConfigStructReplicated* playerCharacterConfig) { LOG->info(playerCharacterConfig->PlayerCharacterName.ToString()); validateNames_original(_this, playerCharacterConfig); }
4:01 AM
This is my structure definition
4:01 AM
struct FPrimalPlayerCharacterConfigStructReplicated { uint8 bIsFemale : 1; FLinearColor BodyColors[4]; FString PlayerCharacterName; };
Avatar
AaronBasques 6/23/2020 4:17 AM
@substitute interesting and looks so simple. where is your struct located?
4:18 AM
@AaronBasques
4:19 AM
I put FPrimalPlayerCharacterConfigStructReplicated in Actor.h and I changed struct FPrimalPlayerCharacterConfigStructReplicated {}; in Base.h to struct FPrimalPlayerCharacterConfigStructReplicated;
Avatar
AaronBasques 6/23/2020 4:29 AM
now that i see you gave isFemale there, I've seen this before, just didn't occur to me
4:30 AM
so you just put the struct fields yourself like in the dev kit version? and if so, what is the one from the dump all about that i was using eairler?
Avatar
not exactly no
Avatar
Idk I didn’t make that
Avatar
AaronBasques 6/23/2020 5:24 AM
I fell asleep there lol, its been a long day. i'll compile it all up and test it tomorrow, thanks @substitute i really appreciate the help.
Avatar
Hey guys, im trying to made some modifications to an old plugin's source code i found One issue im running in to is it has AActor* Actor = player->GetPlayerCharacter()->GetAimedActor(ECC_GameTraceChannel2, nullptr, 0.0, 0.0, nullptr, nullptr, false, false); But apparently that method requries a FHitResult * outHitResult How or where do i come up with that? I thought passing in FHitResult* result would do it? Sorry if stupid question, my CPP is super rusty
Avatar
Just neeed to added another "false" parameter on the end. AActor* Actor = player->GetPlayerCharacter()->GetAimedActor(ECC_GameTraceChannel2, nullptr, 0.0, 0.0, nullptr, nullptr, false, false, false);
🤦 1
Avatar
player_controller->GiveItem(&out_items, &fblueprint, default_amount, quality, force_blueprint, false, MinRandomQuality);
4:19 PM
Can't MinRandomQuality be used?
4:19 PM
Can anyone tell me. Thank you
Avatar
@Lethal
9:37 PM
He should just use nullptr (edited)
9:37 PM
false just happens to equal nullptr but nullptr is more clear
Avatar
The version he was referencing had the field he mentioned however the new version of GetAimedActor has an extra parameter which is why I directed to add another false.
Avatar
How should i go about trying to display a colored Server name as part of ingame messages? (edited)
Avatar
Ark Markup Language (or ArkML for short) is a markup language seen in several instances within ARK. It is a type of SGML, and currently has only one known element, the "RichColor" element, which is used to add color to text. There is no official documentation for this markup l...
12:58 AM
@Kal
Avatar
thanks for the link, was realizing how dumb my question was right after asking it
Avatar
How have other plugins managed to format color of player names? It seems to only work in the message
Avatar
What do you mean
1:48 AM
Do you mean on the ui for picking a server?
1:48 AM
Or player names on the chat box?
Avatar
the markup is only processed on the message itself
1:49 AM
not the other components
Avatar
It depends @Hsilamot
1:49 AM
It depends on the component
Avatar
on the chat box i was never able to make it process markup on the players name
Avatar
If it supports the markup
1:49 AM
I can try something (edited)
1:50 AM
I’ll look into it
1:50 AM
that's why there's that space on the map and the name
1:50 AM
that's the name field
1:50 AM
the name is concatenated in the message as a hackl to make markup work
Avatar
Yes but it is still possible to colorize the name
Avatar
without mods?
Avatar
It’s why ally chat is cyan names
1:50 AM
And tribe is green
1:50 AM
And neither is yellow
Avatar
yeah but those are client properties
Avatar
They’re all just an flinearcolor
Avatar
those aren't determined by the server, you can "fake" a tribe message but then you'll be loimited to 3 colors only
Avatar
Certain names also show up as white
1:51 AM
Due to breaking the markup
1:52 AM
I’ll work something up in a bit to see if I can’t get it to work
Avatar
you think you can figure out how to make it process markup?
Avatar
Oh, and i guess it isnt even colored green/gray for yourself/tribe?
Avatar
Yeah for you it’s like off white
1:54 AM
If I remember
Avatar
ok, so i either need to reconstruct the name + tribe + (tribe) + (local) + colors or embed any colored part (server name in my case) in the message
Avatar
that's the current hack
Avatar
problem with that tho you're left with ugly spaces and a : in the middle
Avatar
yea, i assume : is still there even if i leave name, tribe blank?
Avatar
yeah
Avatar
it's not the tribe's name, it's the steam name i think
Avatar
oh, right
2:00 AM
is that an ArkApi or Ark limitation? as in should i dig in to ArkApi code and try to change the ClientChatMessage?
Avatar
@Hsilamot it shouldn’t have spaces if you check for blank strings and such first
Avatar
Could be worse
Avatar
Could i please get some help with this method? Trying to get list of SteamIds from a TribeId (ideally regardless of if tribe is online) std::list<int> GetTribeSteamIds(int tribeId) { FTribeData tribeDataResult; ArkApi::GetApiUtils().GetShooterGameMode()->GetTribeData(&tribeDataResult, tribeId); for (auto member : tribeDataResult.MembersConfigsField()) { Log::GetLog()->info("Player in tribe ({})", member.PlayerCharacterName.ToString()); } } Currently failing on the GetTribeData call
Avatar
try to replace your FTribeData struct with this https://pastebin.com/raw/sCAFWnRw
Avatar
@Michidu
8:49 AM
Did you see my comments in the other channel?
Avatar
@Michidu That worked, thanks!!!
8:56 AM
std::list<int> GetTribeSteamIds(int tribeId) { std::list<int> resultList; FTribeData tribeDataResult; ArkApi::GetApiUtils().GetShooterGameMode()->GetTribeData(&tribeDataResult, tribeId); Log::GetLog()->info("Got Tribe Data"); for (auto member : tribeDataResult.MembersConfigsField()) { Log::GetLog()->info("Player in tribe ({})", member.PlayerCharacterName.ToString()); } return resultList; } No members logging, anything im missing?
Avatar
maybe tribe is offline? @substitute sorry, just now. Can you explain?
Avatar
Some variables are only on a child class called playerpawntest
9:09 AM
an example, the number of chibi levels the player has achieved
9:09 AM
as far as I can tell, that class is pure BP
9:09 AM
can't find any stuff for it in IDA.
9:10 AM
without being able to interop with the bp stuff
9:10 AM
that whole area of the game is locked out from for plugins
Avatar
I was using my tribe id and online at the time
9:12 AM
Can you think of a good way to get the list of steam ids for the tribe even if the players are offline (or on another server) If not, any thoughts for trying to keep a SQL tribe membership table in sync
Avatar
ah, there are some functions only in BP also did you try to enumerate those variables? @Kal you can try AShooterGameMode::GetOrLoadTribeData
Avatar
Does the Get contain only online tribe info and load is offline? Sorry I just hopped into ark API development 2 days ago
9:15 AM
I'll try more tomorrow with getting the tribe data
Avatar
@Michidu yeap
9:17 AM
now somethings can be done, like finding the function by find object, but it is not clean to setup, and it would be very tedious
9:18 AM
we could use a tool made by hacking communities to dump a workable "SDK" but it's not exactly up to standards as the rest of the API and we would have a lot of class duplications
Avatar
Tried with GetOrLoad
Avatar
I still think the best middle ground is to fully expand on the parameter packing system, and write a macro/template where a user can simply do something like USE_BP("name")
9:18 AM
This would also have the advantage of not needing to compile a bunch of stuff the user may not be using.
9:19 AM
@Kal looks like a memory issue (edited)
9:19 AM
you may need to manually alloc the memory for the FTribeData
Avatar
Sounds reasonable
Avatar
as-in you may need to use UE4's stuff
9:20 AM
not memalloc
9:20 AM
but like FMemeory::alloc
9:20 AM
or whatever it is.
9:20 AM
I've had to do so before with strings in something unrelated
9:20 AM
but you can see the problem is mainly in Realloc
9:21 AM
which usually happens if the memory isn't allocated by UE4's memory system
Avatar
Thanks for the pointer (ha) (edited)
Avatar
you will need to delete the memory too
9:21 AM
but I figure you know that
9:21 AM
(after you are done using it)
Avatar
Tbh I haven't touch cpp in about 15 years I'm used to higher level languages
9:22 AM
So thanks for the reminder
Avatar
it's not really a c++ issue
9:22 AM
mostly a UE4 issue
9:22 AM
like if you realloc a FString with realloc and not the FMemory version
Avatar
Memory management in general
Avatar
bad things happen
Avatar
I haven't gotten much into the weeds of UE yet either
Avatar
I've been working on a template (which reminds me I need to update it)
9:23 AM
for plugins
9:23 AM
super easy 1-click compile
Avatar
I was about to do same with this when I decided I was too far down route of my impl
9:24 AM
I really want to create a plugin for ASM to list, load, unload, and configure API plugins But ASM codebase is out of date on GitHub and they aren't supportive of new plugins
9:25 AM
mine even supports "debug" and "release" builds
Avatar
low key facts, they're the same.
9:25 AM
there's just an extra define for debug
9:25 AM
so you can conditionally check
Avatar
With breakpoints??
Avatar
with preprocessor blocks
9:26 AM
Was doing same with a json flag
Avatar
This is at compile time
9:26 AM
so no debugging info
9:26 AM
gets sent
Avatar
change the build mode
9:26 AM
completely strips out debug code
9:27 AM
You might find this helpful though
Avatar
Also it would be really nice to build in the database interface from arkshop into your template
Avatar
#include <API/ARK/Ark.h> /* Macro to add a hook easily. */ #define SET_HOOK(functionName, hookName) \ ArkApi::GetHooks().SetHook(functionName, &Hook_ ## hookName, &hookName ## _original) /* Macro to remove a hook easily. */ #define DISABLE_HOOK(functionName, hookName) \ ArkApi::GetHooks().DisableHook(functionName, &Hook_ ## hookName) /* Shortcut */ #define HOOKS \ ArkApi::GetHooks() /* Shortcut */ #define COMMANDS \ ArkApi::GetCommands() /* Shortcut */ #define API_UTILS \ ArkApi::GetApiUtils() /* Shortcut */ #define LOG \ Log::GetLog() /* Shortcut */ #define INIT_LOG(text) \ Log::Get().Init(text)
9:27 AM
macros to make some things a bit easier
Avatar
@substitute only if add functions/variable which are not dumped already (compare names)
Avatar
@Michidu yes but it will still be like a million lines of code
9:27 AM
lol
9:27 AM
well, ~200k
Avatar
you think there are so many bp stuff?
Avatar
for every single BP call it expects the parameters to be a packed structure (pointer)
9:28 AM
it's why I was building the parameter packer
9:28 AM
and yes
9:28 AM
most functions can be called from BP with find object
9:28 AM
but even ones that have C++ implementations, it's still ehh very many
9:29 AM
have to remember how much of the game can be modded with devkit
9:29 AM
anything devkit can easily change === 99% chance it's in BP only
Avatar
actually most of them are duplicates
Avatar
some
9:29 AM
all the playerpawntest stuff
9:29 AM
is pure BP
9:29 AM
example: You can't call defeatboss on a player pawn
9:29 AM
it only exists as a BP function
9:30 AM
it's the function as far as I know that is called when an actual boss is defeated
Avatar
Oh also It seems like only character name is stored in the tribe members? What are my options for getting steamId instead?
Avatar
Nothing is stopping you from making your own
9:30 AM
except the variables are also on that class 😉
9:30 AM
@Kal you could read the files on disk
9:30 AM
MONKASSSSSSSS
9:30 AM
that's O(n) at like best though
Avatar
if we are talking of classes like APlayerController, then most will be duplicates but also IDA doesn't display all functions
Avatar
O(n^2) if you're doing a whole tribe
9:31 AM
not aPlayerController
9:31 AM
PlayerPawnTest
9:31 AM
it's a child of shooter character I believe
9:31 AM
let me boot devkit
Avatar
i got you heh APlayerController would have some funcs which are only in BP too
Avatar
I'd hate to be stuck trying to read that from disk and keep things quick
Avatar
some things could totally be emulated without bp stuff
9:32 AM
some
9:32 AM
but some reference bp variables
9:32 AM
so those are a big rip
Avatar
Server Plugins for ARK: Server API. Contribute to Michidu/Ark-Server-Plugins development by creating an account on GitHub.
Avatar
also
9:34 AM
the bonus of proper bp interop
9:34 AM
= making mods and only having to give clients the client side code
9:34 AM
having all the replicated functions being stubbed and implementing in C++
Avatar
Perfect, tyvm
Avatar
what do you mean with 'proper bp interop'?
Avatar
hooking / calling / etc.
9:35 AM
hooking is easy enough
9:35 AM
since you can just hook a C++ function and determine which BP function is being processed
9:35 AM
hooking ProcessEvent = you can easily redirect / cancel logic of BP Scripts
Avatar
you can also call them
Avatar
Yes, but you have to build a structure and map parameters to the structure for each function
9:36 AM
I mean proper in the sense a developer only has to write a macro with the types, similar to DECLARE_HOOK
9:36 AM
to have it working
Avatar
you made a better solution already though
Avatar
the parameter packing?
Avatar
that only builds the structure
9:37 AM
and it isn't perfect yet
9:37 AM
still need to do FindObject, etc.
9:37 AM
just need to combine it all and ensure it works properly
Avatar
for funcs it's better to use FindFunction
Avatar
My "endgame" is like doing DECLARE_BP_FUNCTION("getLevel", void,int,int) etc. (edited)
9:38 AM
and then you can just do like
9:38 AM
getLevel_BP(4,5); (edited)
9:38 AM
that's what I mean by proper interop
Avatar
that will increase already huge API lol
Avatar
kinda like how UE4 has BLUEPRINT(asdfasdfsdf,asdfasdfasdf)
9:39 AM
na
9:39 AM
the user would define what they want to use
Avatar
it would be a declare and use as you need
9:39 AM
similar to hooks
9:39 AM
Could make predefined headers
9:39 AM
and make them an "extras" package
9:39 AM
for the extra lazy
9:39 AM
pepelaugh
9:39 AM
but compile times for that would be absolutely awful
Avatar
true where is DefeatBoss should be located?
Avatar
PlayerPawnTest
9:41 AM
mine is loading
9:41 AM
I'll show it when it load
9:41 AM
even with PCIe 4.0 SSD
9:41 AM
the devkit is slow as hell
9:46 AM
is the function
9:46 AM
@Michidu
9:46 AM
9:46 AM
this particular one can be rewritten in pure C++
9:47 AM
9:47 AM
would be impossible
Avatar
i see
Avatar
Though curious
9:51 AM
I wonder how the game handles the chibi level ups
9:51 AM
wonder if you could force like 10000000 level ups
9:51 AM
KEKW
9:51 AM
did you try to get playerpawn from plugin?
Avatar
it wouldn't be possible
9:52 AM
those aren't on playerpawn
9:52 AM
9:52 AM
also
9:52 AM
there is no PrimalPlayerDataBP_Base afaik
9:53 AM
so you can't defeat a boss
9:53 AM
the force defeat doesn't do anything.
9:53 AM
(it is effectively a removed function, I asked one of the devs)
9:53 AM
was for debugging
9:53 AM
9:53 AM
9:53 AM
that's completely unused
9:54 AM
bigbrain (edited)
Avatar
via FindObject i meant (edited)
9:54 AM
defeated boss acting like a hook?
Avatar
oooh
9:55 AM
you mean with FindObject
9:55 AM
yeah that could work
9:56 AM
no type checking though on the shooter character
9:56 AM
KEKW
Avatar
there is UShooterCheatManager::DefeatBoss doesnt work?
Avatar
I can check how that works
Avatar
calls bp
Avatar
does it?
9:56 AM
ooo
9:56 AM
still doesn't solve the chibi issue
9:56 AM
KEKW
Avatar
trying to make those wow insta 80 servers over here
9:57 AM
KEKW
9:58 AM
oh wait
9:58 AM
@Michidu
9:58 AM
that won't work
9:58 AM
9:58 AM
like I said
9:58 AM
that particular function is basically a stub
9:58 AM
it was for debugging and I believe they removed it's function
Avatar
calls BP tho
Avatar
yes
9:59 AM
the bp force defeated isn't working
9:59 AM
there's two functions for boss defeating
Avatar
strange that they added it to cheats
Avatar
it was for debugging
10:00 AM
10:00 AM
not even implemented in the primal player data BP_base
Avatar
so need to get pawntest class using findobject
Avatar
meh
10:02 AM
or just find the "set" function
10:02 AM
and call that
10:02 AM
KEKW
Avatar
Good morning guys
10:03 AM
I wonder if maybe someone wanted to create or maybe edit a plugin Foppa made for me a while back 😄
10:04 AM
It basically lets me send a RCON Command and it pumps back Server FPS into the Console
10:04 AM
He was going to add a kind of verbose function so it pumps it out every couple of seconds but im sure he is super busy with other stuff so wondered if someone else maybe had skills to do it
Avatar
if you had the source, you could do it easily enough
10:06 AM
with a thread, counter, and a delay
Avatar
Well i did snoop around on his github but i didnt find it, probably because it was so basic to even bother putting it there 😄
Avatar
you could try your hand at making a plugin
10:06 AM
it's always a good learning experience
Avatar
Oh believe me i tried xD
Avatar
@Michidu do you have an example of find function
10:07 AM
how it is used in the API
Avatar
@Michidu that plugin thing I dm'ed you about
10:08 AM
this is a perfect use-case
10:08 AM
KEKW
10:09 AM
though for multiserver support would require it's own api
Avatar
ya
10:16 AM
I got it kinda working
10:16 AM
weird that UObject::ProcessEvent isn't static though 😉
10:17 AM
oh no
10:17 AM
oh no no no
10:17 AM
10:17 AM
that is VERY wrong
10:17 AM
it just works because the two args are both ints
Avatar
it's fine since type is same
10:19 AM
for (auto& data : AShooterPlayerController::GetPrivateStaticClass()->NativeFunctionLookupTableField()) { FString out; (data.Name).ToString(&out); Log::GetLog()->info(out.ToString()); } i did something like this to dump BP func names also
Avatar
i will check that
10:20 AM
if this doesn't work
10:20 AM
auto data = myPawn->GetPlayerData(); UFunction* bpFunction = data->FindFunctionChecked(FName(L"DefeatedBoss", EFindName::FNAME_Find, false)); if (bpFunction) { DefeatedBoss_Params params; params.DifficultyIndex = 3; params.tagOverride = FName(L"Dragon", EFindName::FNAME_Find, false); params.PC = *(static_cast<AShooterPlayerController*>(_this)); myPawn->ProcessEvent(bpFunction, &params); }
10:20 AM
just so you know
10:20 AM
I hate this
10:20 AM
*(static_cast<AShooterPlayerController*>
10:21 AM
10:21 AM
but it's not passed by reference
10:21 AM
so KEKW
Avatar
oh, you gonna have issues passing by value
Avatar
well, not always no
10:22 AM
I'm passing the whole args by pointer
10:22 AM
but will try it.
Avatar
still it would have to do a copy... a real mess
Avatar
no choice (edited)
10:22 AM
the function expects byValue
Avatar
it won't do a proper copy most likely also
10:24 AM
the devkit is a fat fat program
Avatar
i hate it lol
10:26 AM
you could try memcpy if this doesnt work
Avatar
yeah
10:30 AM
@Michidu alright
10:30 AM
the good
10:30 AM
it found the function no problem
10:30 AM
the bad
10:30 AM
it crashed the server
10:30 AM
KEKW
10:33 AM
wait had wrong owning object
Avatar
but you said that func not working anyway?
10:45 AM
ah, it was force one
Avatar
yea
10:48 AM
I think my structure was off
10:48 AM
gonna test one last thing before bed.
10:49 AM
if I get it to work, would also be a good example on how to find bp functions
10:49 AM
it did want a pointer after all btw
Avatar
pointer of what?
Avatar
struct DefeatedBoss_Params { APrimalDinoCharacter* boss; int DifficultyIndex; FName tagOverride; AShooterPlayerController* PC; };
Avatar
that looks better worked?
Avatar
Nope
10:58 AM
But
10:58 AM
My message showed up
10:58 AM
I put it in chat hook
10:59 AM
Before my chat message didn’t even show
10:59 AM
So it’s a start
10:59 AM
I will attach a debugger tomorrow and see
5:26 PM
well
5:26 PM
the crash isn't from the find function at least.
5:27 PM
Avatar
you still do copy?
Avatar
this isn't even doing anything with find function
5:28 PM
void Hook_chatMessage(AShooterPlayerController* _this, FString ChatMessage, EChatSendMode::Type SendMode) { //LOG->info("got a chat message of %s", ChatMessage.ToString().c_str()); return chatMessage_original(_this, ChatMessage, SendMode); .....
Avatar
looks like issue from copy constructor
Avatar
yea, maybe wrong type in the hook def.
5:30 PM
I might have deleted a * or something
5:30 PM
I gotta check.
5:33 PM
yep
5:33 PM
I had turned my FString pointer into FString
5:33 PM
KEKW
5:40 PM
@Michidu it's working now.
5:40 PM
my issue the entire time was accidently making my FString* into FString on the hook itself.
Avatar
ah great you used pointer on player also?
Avatar
yea
5:44 PM
struct DefeatedBoss_Params { APrimalDinoCharacter* boss; int DifficultyIndex; FName tagOverride; AShooterPlayerController* PC; };
5:44 PM
works fine.
Avatar
great
5:45 PM
would also need to make a dumper
Avatar
yea
5:45 PM
there is a problem btw
5:45 PM
your function name dumper
5:45 PM
you'd need a reference to the bp type for the bp specific function names 😉
5:45 PM
it didn't find one I was able to call KEKW
Avatar
ah damn actually im unsure it is BP funcs anymore heh
Avatar
? why
Avatar
could be native, as it says lol
Avatar
oh
5:46 PM
true.
5:47 PM
luckily the names seem to match 1:1 from the devkit
5:47 PM
so if you have the devkit, it's just a matter of using your eyeballs
Avatar
im not sure why there would be a list of native funcs however.. and how functions would be added to it
Avatar
I think because maybe native functions are mapped to BPScript?
5:48 PM
e.g. functions that are like killPlayer are called that in BP code, but in C++ it's killPlayer_Implementation
5:48 PM
could be related to the reflection system.
Avatar
possibly
5:48 PM
also those exec funcs are all called from bp
Avatar
yep
5:48 PM
func_exec -> BP
5:48 PM
func_implementation -> C++
5:48 PM
func is usually just a wrapper to one of (or both) of those
Avatar
there are some weird cases also.. exec and implementation could do different things
Avatar
yea
5:50 PM
UE4 is certainly strange
5:50 PM
Wish they would provide more digestible documentation about their reflection system.
5:50 PM
i think game devs almost dont use it
Avatar
most don't need too 😉
Avatar
Vanilla Cloning Chamber calls BPServerHandleNetExecCommand to kick off the cloning process which I had to use to intercept a call. Had to add the struct for the parameters but it worked. bool Hook_AActor_BPServerHandleNetExecCommand(AActor* _this, APlayerController* FromPC, FName CommandName, FBPNetExecParams* ExecParams)
6:03 PM
Is the "Clone" code in that structure considered a BPScript?
Avatar
if you can hook it directly from C++
6:07 PM
na
6:07 PM
at least not normally
Avatar
The Clone code calls the NetExec but you can't get to the Clone code that I could find.
Avatar
yeah, the actual code from netexec you can't change
6:09 PM
would be bp stuff
Avatar
I basically decide whether to allow the "Clone" command to exec or not.
Avatar
netexec runs in both contexts as far as I know
Avatar
S+ Cloning Chamber also works completely different and doesn't clone that way.
Avatar
std::list<int> GetTribeSteamIds(int tribeId) { std::list<int> resultList; FTribeData* tribe_data = static_cast<FTribeData*>(FMemory::Malloc(0x128 + 0x28)); RtlSecureZeroMemory(tribe_data, 0x128 + 0x28); ArkApi::GetApiUtils().GetShooterGameMode()->GetOrLoadTribeData(tribeId, tribe_data); auto members = tribe_data->MembersConfigsField(); for (auto member : members) { Log::GetLog()->info("Player in tribe ({})", member.PlayerCharacterName.ToString()); } FMemory::Free(tribe_data); return resultList; } still nothing coming from the tribe_data malloc error is gone though
6:28 PM
nvm, MembersPlayerDataIDField(); works instead
6:28 PM
Any way to get steam id for a given player id?
Avatar
Not sure you can for an offline player.
Avatar
you can hook UPrimalPlayerData::LoadFromFile it loads ALL players on server start up
6:49 PM
so can build offline players cache this way
Avatar
that's such a dirty way though
6:51 PM
lol
Avatar
yeah
6:51 PM
better than read files tho
Avatar
its better than what i was about to try
Avatar
I could see the API doing that though
6:51 PM
it's bad if multiple plugins are doing it
6:51 PM
so maybe the API can precache that data in the future (edited)
Avatar
what bad if multiple plugins do it?
Avatar
data duplication
6:52 PM
everyone has their own cache
Avatar
well, it depends how it gonna be used i don't see big issues with it
Avatar
on tribe msg im generating a list of "intended recipient steam ids" and sending to those players on other servers
6:53 PM
ive got the player id list for the tribe msg now, i need to check if it includes offline players
Avatar
just GetOrLoadTribeData was leaking memory in the past.. so check it
7:03 PM
haHAA
Avatar
Any clue why my SyncApi pulseEvent wouldnt be detected on the other server?
Avatar
Sorry, could you help me a little more with the LoadFromFile? if i get that as initial state, what else do i need to hook in to for character creation after server load?
Avatar
Any idea why none of my players on my fresh wipe have been given Default Permission?
11:10 PM
Im hosting crossplay for what its worth
Avatar
Nm, i got the hook set up, will figure it out
Avatar
How do i use the FObjectReader for the PrimalPlayerData? (edited)
Avatar
completely lost on the FObjectReader and cant find any documentation or examples to speak of
Avatar
nm, i was being dumb
Avatar
@Michidu until I can figure how to use the reflection to find a field
4:10 AM
struct UPrimalPlayerDataBP_Base { unsigned char unk[0x028]; //UObject unsigned char unk2[0x0498]; //PrimalPlayerData int NumAscensions; unsigned char UnknownData00[0x4]; TArray<float> AscensionData; TArray<struct FName> BossDinoNameTagAscensionDataMap; int SavedPlayerDataVersion; int CurrentPlayerDataVersion; int HexagonCount; int NumChibiLevelUpsData; };
4:10 AM
this works as long as everything is aligned
4:10 AM
it's certainly prone to breakage though
Avatar
So going away from the load file, whats gonna be the best hook for "player login and/or new character creation"
Avatar
is this right? void PostLogin(APlayerController* NewPlayer) { NativeCall<void, APlayerController*>(this, "AShooterGameMode.PostLogin", NewPlayer); } (edited)
Avatar
Not sure how to get from APlayerController to AShooterPlayerController so that i can get SteamId and PlayerId
Avatar
const uint64 steamid = ArkApi::GetApiUtils().GetSteamIdFromController(NewPlayer);
Avatar
lol thanks, idk why i thought i needed the shooter contoller
Avatar
@Kal
5:26 AM
For future reference you can cast the controller to shooter controller
5:26 AM
With static_cast
Avatar
ugh, i have so much c++ and UE to learn/re-learn xD
5:27 AM
making it work though, appreciate the help
5:29 AM
void Hook_AShooterGameMode_PostLogin(AShooterGameMode* _AShooterGameMode, APlayerController* NewPlayer) { int steam_id = ArkApi::GetApiUtils().GetSteamIdFromController(NewPlayer); int character_id = ArkApi::GetApiUtils().GetPlayerID(NewPlayer); ... AShooterGameMode_PostLogin_original(_AShooterGameMode, NewPlayer); } Any idea why character_id is 0 should i use a different hook?
5:32 AM
attempting to build a player_id -> steam_id map (regardless of online/offline) by initializing with all players on plugin load add player on login and sync with Sql
5:32 AM
got all of it wired up except the character id in the login hook is coming through as 0
Avatar
@substitute how do you use it?
8:38 AM
@Kal for file load hook, you only need to let it call original function and then read UPrimalPlayerData
Avatar
@Michidu what do you mean?
Avatar
UPrimalPlayerDataBP_Base structure?
Avatar
ah
8:54 AM
I have a dumper that dumped that class
8:54 AM
the main issue though, is your UObject and UPrimalPlayerData aren't using the same structure since they read PDB.
Avatar
@Kal check AShooterGameMode::PlayersIds
Avatar
so I instead take the # of bytes those two classes would use and put a padding and then the fields on the UPrimalPlayerData_BP
8:55 AM
I can set it like so
8:55 AM
AShooterCharacter* myPawn = static_cast<AShooterCharacter*>(playerController->PawnField()); UPrimalPlayerData* data = myPawn->GetPlayerData(); (reinterpret_cast<UPrimalPlayerDataBP_Base*>(data))->NumChibiLevelUpsData = value; /* yolo */
8:55 AM
obviously, this is prone to breaking if they update that structure
8:55 AM
but until we have a way to find a UProperty field and read/set its value, it works for now. (edited)
Avatar
ah, got you
8:56 AM
yeah, would be nice to find it
Avatar
/* yolo */
8:56 AM
pepelaughW
Avatar
new ark dumps have padding for every struct also
Avatar
I'm using injected DLL
8:57 AM
that finds uobjects/unames and dumps it all into a SDK
8:57 AM
I just copied the definition (and put the required padding since I'm not using any parent classes)
8:58 AM
void SetChibi(AShooterPlayerController* playerController, int value) { AShooterCharacter* myPawn = static_cast<AShooterCharacter*>(playerController->PawnField()); UPrimalPlayerData* data = myPawn->GetPlayerData(); UFunction* bpFunction = myPawn->FindFunctionChecked(FName(L"SetNumChibiLevelUps", EFindName::FNAME_Find, false)); int params[] = { value }; myPawn->ProcessEvent(bpFunction, &params); (reinterpret_cast<UPrimalPlayerDataBP_Base*>(data))->NumChibiLevelUpsData = value; /* yolo */ data->SavePlayerData(ArkApi::GetApiUtils().GetWorld()); }
8:58 AM
is the whole function
Avatar
you have full dump of ark? could you send me it?
Avatar
it's not really a good dump
8:59 AM
it's just enough to get bp structs
8:59 AM
it references all functions with UObject::FindObject
Avatar
that fine, you used one of UE dumpers?
Avatar
yea
8:59 AM
Dumped SDK for Ark: Survival Evolved. Contribute to SubstituteR/ArkSDK development by creating an account on GitHub.
8:59 AM
this is a little outdated
9:00 AM
I need to push a new one
9:00 AM
9:00 AM
example of the dump
9:01 AM
it's like 200MB
9:01 AM
and it can not be compiled into a library
9:01 AM
it generates to over 4GB
9:01 AM
pepelaughW
9:01 AM
when I used it for testing stuff, I would just compile individual .obj files.
Avatar
lol thanks
9:01 AM
such dumpers would be very useful for games w/o pdb
Avatar
it is also useful for bp classes
9:01 AM
that don't exist in the pdb
9:02 AM
👍
9:02 AM
I want to see how they are dumping tbh, I need to find the github again
9:02 AM
if I can see how they are reading the fields
9:02 AM
it might be a hint to find them at run-time.
Avatar
Contribute to xyz-1/SDK-Generator development by creating an account on GitHub.
Useful tool to help you fetch and dump Unreal Engine 4 Games information. - CorrM/Unreal-Finder-Tool
Avatar
CorrM/Unreal-Finder-Tool crash for me
9:04 AM
when dumping
Avatar
did you fix sigs?
Avatar
na
9:04 AM
i have one that works
9:04 AM
from like 2017
Avatar
usually they won't work out of the box
9:05 AM
I compiled that a bit ago
9:05 AM
but I didn't change anything
9:05 AM
Needed VS2017 to compile from source.
9:05 AM
Contribute to xyz-1/SDK-Generator development by creating an account on GitHub.
9:05 AM
is the one
9:05 AM
I may have used a different fork though
9:05 AM
can't remember
9:05 AM
I think I used that one though
9:06 AM
9:06 AM
oh
9:06 AM
neat
9:06 AM
never looked that closely at this
9:06 AM
KEKW
Avatar
original repository was removed from github
Avatar
yea
9:08 AM
DMCA or something
Avatar
auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast<const unsigned char*>("\xc7\x05\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x05\x00\x00\x00\x00\x01"), "xx????xxxxxx????x"); auto offset = *reinterpret_cast<uint32_t*>(address + 2); GlobalObjects = (FUObjectArray*)(address + 0xA + offset); auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast<const unsigned char*>("\x33\xdb\x48\x89\x1d\x00\x00\x00\x00\x8b\xc3\x48\x8b\x5c"), "xxxxx????xxxxx"); auto offset = *reinterpret_cast<uint32_t*>(address + 5); GlobalNames = reinterpret_cast<decltype(GlobalNames)>(*reinterpret_cast<uintptr_t*>(address + 0x9 + offset));
10:33 AM
oops
10:33 AM
thats windows 10 ark lol
10:33 AM
one sec
10:33 AM
auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast<const unsigned char*>("\x48\x89\x83\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x48\x89\x1D"), "xxx????x????xxx"); address += 12; auto offset = *reinterpret_cast<uint32_t*>(address + 3); GlobalNames = reinterpret_cast<decltype(GlobalNames)>(*reinterpret_cast<uintptr_t*>(address + 7 + offset));
10:34 AM
auto address = FindPattern(GetModuleHandleW(nullptr), reinterpret_cast<const unsigned char*>("\x89\x0D\x00\x00\x00\x00\x48\x8D\x4D\x00\xE8"), "xx????xxx?x"); auto offset = *reinterpret_cast<uint32_t*>(address + 2); GlobalObjects = (FUObjectArray*)(address + 6 + offset);
10:34 AM
should be for current version of ark
10:34 AM
names pattern hasnt changed since 2015
10:35 AM
10:35 AM
should be up to date
10:36 AM
^i just tested the patterns
Avatar
with pdb you could do easier though 🙂
10:54 AM
i only really update the sigs when needed
10:54 AM
i just use detourfindfunction for everything else
10:55 AM
and i keep the sdk up to date so the variables are correctly aligned
10:55 AM
rProcessEvent = reinterpret_cast<tProcessEvent>(DetourFindFunction("ShooterGame.exe", "UObject::ProcessEvent")); rPostRender = reinterpret_cast<tPostRender>(DetourFindFunction("ShooterGame.exe", "UGameViewportClient::PostRender"));
10:55 AM
detourfindfunction makes it so easy lol
10:56 AM
before that i was manually updating the offsets when they changed
10:56 AM
but when i joined ur discord i saw ur pdbreader and i really like it lol
Avatar
@Michidu if u wanted a more up to date sdk gen i put the files to my modified one up https://github.com/doug147/ARK-SDK-Gen (edited)
Current ARK SDK gen with up to date signatures. Contribute to doug147/ARK-SDK-Gen development by creating an account on GitHub.
11:10 AM
saw you asking about it above
Avatar
thank you
11:21 AM
detourfindfunction is similiar to how api works
Avatar
how do i add an icon to chat messages? this is the code i had commented out if (chatIcon == ChatIcon::Admin) { auto engine = Globals::GEngine()(); auto primalglobals = engine->GameSingletonField(); auto gamedata = primalglobals->PrimalGameDataOverrideField(); if (!gamedata) gamedata = primalglobals->PrimalGameDataField(); auto texture = gamedata->NameTagServerAdminField(); if (texture) iconTexture = gamedata->NameTagServerAdminField(); } but im getting UObject has no member PrimalGameDataOverrideField
6:50 PM
and once i have that working, how do i use a different (i.e. donator) icon
Avatar
Kill Feed is a free plugin by OwnProx that is open source and uses icons I believe start there
Avatar
good idea, thanks
Avatar
Where can i find the updated Permissions.lib to compile with? https://github.com/Michidu/Ark-Server-Plugins/tree/master/Permissions seems to be 16 months old Getting Error 126 when i add #pragma comment(lib, "Permissions.lib")
Server Plugins for ARK: Server API. Contribute to Michidu/Ark-Server-Plugins development by creating an account on GitHub.
Avatar
Code is the same just recompile it against the updated API source
Avatar
Hmm, i built a new Permissions.lib it seemed to work for like 10 mins then my server crashed and it fails to load plugin on startup Error 126 each time if i remove calls to Permissions (i.e.): auto isDonor = Permissions::IsPlayerInGroup(steamId, FString("Donor1")); it is fine (edited)
Avatar
I recall seeing something about loading permissions.lib late in a different project? is that a requirement?
Avatar
Nm, i got it working 😛
3:47 AM
i didnt end up adding that though
3:47 AM
but come to think of it, i didnt reboot with final build
3:47 AM
just re-load plugin
Avatar
If your plugin starts with a letter after P the delay is not needed but might as well add it for safety.
Avatar
oh, it starts with A i just got lucky with loading/unloading plugin to get it in right order
Avatar
Anyone willing to share some HWID snippets, how you are verifying, etc
Avatar
substitute 7/1/2020 5:38 AM
HWID verification is 👎
5:38 AM
I’m all about FOSS
5:38 AM
SC_pepeD SC_pepeD SC_pepeD
Avatar
FOSS?
Avatar
free and open source 😛
Avatar
I would prefer FOSS, but also would like a little bit of kick back from my effort
Avatar
that's a bit of a meme " can i have free HWID verificatin snippets" 🤣
Avatar
@Kal @Mr.Salt
11:15 PM
We all know anti-cheats employ HWID tracking to monitor cheaters/developers, and prevent them from continuing to cheat in the video games they protect...
11:15 PM
if you still want HWID stuff
11:15 PM
and don't care that this is unknowncheats
11:15 PM
this thread should have useful information
Avatar
Thx for the link
Avatar
While that is obviously a cheating site, info you can find in the C++ forums is totally useful and relevant to making plugins too
Avatar
Haha, and yes salt, I very much appreciate the irony
Avatar
since this API is technically a hack
11:17 PM
(well, it works the same way as game hacks do)
11:17 PM
(which also work the same way overlays work, etc...)
Avatar
I was mainly curious if there was an accepted normal way of doing paid plugins or if everyone is building their own solution
Avatar
it's going to be build your own most likely
11:19 PM
the issue with making a standardized way (e.g. like API::AuthPC()) is that it becomes trivial to crack
Avatar
Fair enough
Avatar
it is trivial for two reasons
11:20 PM
1. same signature across plugins = easy sigscan/patch, like really easy. Literally crack one plugin, you'd crack them all. 2. the API ships with debugging symbols (and most plugins do as well)
Avatar
How much security do you guys bother building into paid plugins Or just assuming the 1% of people that by pass it is negligible
Avatar
with debugging symbols, you can find the function the same way the API finds functions in ark.
11:20 PM
@Kal tbh I don't charge for anything of mine.
11:20 PM
I have one plugin released, totally free.
Avatar
Like I said, I would prefer FOSS But at same time I'm looking for a small sum to pump into my servers
11:21 PM
If people voluntarily donated for free plugins I'd be fine with that (edited)
Avatar
You could try
11:22 PM
there's also shareware setup
Avatar
make a lite version for free
11:23 PM
or even better, FOSS with strict anti-commercial use licenses
11:23 PM
basically, something like, Free for personal use must get a paid license for commercial use
11:24 PM
Then if someone uses it for a server that makes $$$ you can go after them
11:24 PM
laughpoint
Avatar
What about free for servers with < X pop lol
Avatar
i have no problem paying for plugins. but then it should be maintained ... (edited)
Avatar
Small guys get free good plugins, bigger servers buy unlocked version
11:25 PM
With the paying users getting priority feature requests
Avatar
Plugin stops working when 30 people are online....lol
Avatar
kind of funny
Avatar
Entertaining thought, prob too much hassle to bother with
Avatar
plugin licensing per server slot like server rentals
Avatar
Not trying to rake in cash Like $50-200 total would be nice just to help my servers
Avatar
We need a gitwiki for the api tbh
11:29 PM
I know there is a "wiki" but it's not uh
11:29 PM
great
11:29 PM
lots of missing stuff too
Avatar
i mean the plugins are a hack too. and lets assume wildcard change some function signatures that are relevant for the plugins hooks. And mabey then they stop to give out the pdb... idk
Avatar
Yeah Standardized snippets/plugin template would be nice
Avatar
@Mr.Salt well, that's never going to be a 100% problem
11:29 PM
many, MANY functions never change, we can generate sigs for those.
11:30 PM
Additionally, FindFunction will always work
11:30 PM
as long as you can get FNames and GObjects references, you can find any other object
11:30 PM
and run processevent
Avatar
@Kal set up a shop and give out some points for donations....
Avatar
it's actually how "SDK" generators usually work for UE games
Avatar
Strongly not a pay 2 win servers
Avatar
PDB just gives a much better (performance-wise) cleaner (by code) solution
Avatar
then throw chibis into the shop
Avatar
chibis offer +5 bonus levels
Avatar
That's why I'm getting other (non point) things to donate for And considering selling plugins
Avatar
he could give everyone +5 by default
11:31 PM
but he'd have to do something like this
11:31 PM
void SetChibi(AShooterPlayerController* playerController, int value) { AShooterCharacter* myPawn = static_cast<AShooterCharacter*>(playerController->PawnField()); UPrimalPlayerData* data = myPawn->GetPlayerData(); UFunction* bpFunction = myPawn->FindFunctionChecked(FName(L"SetNumChibiLevelUps", EFindName::FNAME_Find, false)); int params[] = { value }; myPawn->ProcessEvent(bpFunction, &params); (reinterpret_cast<UPrimalPlayerDataBP_Base*>(data))->NumChibiLevelUpsData = value; /* yolo */ data->SavePlayerData(ArkApi::GetApiUtils().GetWorld()); }
Avatar
Only thing wrong with Chibis is ark gives them out like candy every time there's an event
Avatar
Would also need this structure struct UPrimalPlayerDataBP_Base //This is 101% an unclean solution. :| gonna find to find a way to find the field a little bit easier. { unsigned char unk[0x028]; //UObject unsigned char unk2[0x0498]; //PrimalPlayerData int NumAscensions; unsigned char UnknownData00[0x4]; TArray<float> AscensionData; TArray<struct FName> BossDinoNameTagAscensionDataMap; int SavedPlayerDataVersion; int CurrentPlayerDataVersion; int HexagonCount; int NumChibiLevelUpsData; };
11:32 PM
which can break between versions
11:32 PM
@Kal disallow them and only give them on survivor spawn as part of the default items list.
11:32 PM
that would work
Avatar
If I could reliably dissallow them (no free Chibis from wild card events) They'd be a great option for raid bases, events, shop, donation, etc
11:34 PM
But that's beside the point Best I've got atm to generate money for the server is to get something out of the plugins I make Which goes against my preference for free plugins So was trying to think of solution
Avatar
:\
11:35 PM
if you are not opposed to any mods
11:35 PM
custom skins that are only granted by your plugin
Avatar
And remove the skins from player spawn?
Avatar
ufff you work to do all the admin stuff for your server and then you work to crate some plugins so you can pay the bill 😩
Avatar
you can load references to them in the api like so, ///assume these are paths to YOUR skins const wchar_t* skins[] = { L"Blueprint'/Game/XXXX'", L"Blueprint'/Game/XXXX'", L"Blueprint'/Game/XXXX'" }; //let's assume the player owns skin 0 const wchar_t* skin = skins[0]; //you can load here UClass* skinClass = UVictoryCore::BPLoadClass(&FString(skin)); (edited)
11:38 PM
@Kal
Avatar
Also I was curious How bad do you think it would be to override the hexagons and hexagon store to replace with ArkShop Would need a client side mod paired with it right?
Avatar
Yes
11:38 PM
just for the content
11:38 PM
you don't need any code, just content (skins) only
11:38 PM
(for the mod)^
Avatar
Is the hexagon store listing client side or server side? And what hooks are available
Avatar
you'd have to really dig deep
11:40 PM
a lot of it is in BP
Avatar
I'll poke around at it some later I'd like to get help if I try to make in-game store front for arkshop from the hexagon ui
Avatar
@Kal
11:44 PM
untested
11:44 PM
void doSkins(AShooterPlayerController* playerController) { ///assume these are paths to YOUR skins const wchar_t* skins[] = { L"Blueprint'/Game/XXXX'", L"Blueprint'/Game/XXXX'", L"Blueprint'/Game/XXXX'" }; //let's assume the player owns skin 0 const wchar_t* skin = skins[0]; //you can load here UClass* skinClass = UVictoryCore::BPLoadClass(&FString(skin)); playerController->GetPlayerInventory()->AddItemObject(skinClass->GetDefaultObject(true)); }
11:44 PM
but you could use this to grant your custom skins
11:44 PM
i havent really looked at mods to see if there are any custom skins that i like
Avatar
oiops
11:44 PM
it should be
11:44 PM
playerController->GetPlayerInventory()->AddItemObject(static_cast<UPrimalItem*>(skinClass->GetDefaultObject(true)));
11:45 PM
you need to cast
11:45 PM
default object is UObject* and not UPrimalItem*
Avatar
void ServerRequestHexagonTrade_Implementation(int RequestedTradableItemIndex, int Quantity) { NativeCall<void, int, int>(this, "AShooterCharacter.ServerRequestHexagonTrade_Implementation", RequestedTradableItemIndex, Quantity); } void ServerRequestHexagonTrade(int RequestedTradableItemIndex, int Quantity) { NativeCall<void, int, int>(this, "AShooterCharacter.ServerRequestHexagonTrade", RequestedTradableItemIndex, Quantity); } Might be useful in overriding hexagon store (edited)
Avatar
RequestedTradableItemIndex they use a table/array
12:06 AM
so you'll have to figure out if you can override that list
Avatar
yea, im trying to find where they load that list it might just be a static list thats both client & server side
Avatar
it's not possible via just plugin
2:34 PM
i'm working on this and making a mod + plugin combo
Avatar
Wet do you know how to detect if building on a platform saddle?
2:42 PM
I'm pretty sure i'm doing it the correct way but maybe my FPlacementData structure is wrong.
Avatar
did you add it to pdbconfig ?
Avatar
I did
2:43 PM
struct FPlacementData { char __padding[0x60L]; FVector& AdjustedLocationField() { return *GetNativePointerField<FVector*>(this, "FPlacementData.AdjustedLocation"); } FRotator& AdjustedRotationField() { return *GetNativePointerField<FRotator*>(this, "FPlacementData.AdjustedRotation"); } bool& bSnappedField() { return *GetNativePointerField<bool*>(this, "FPlacementData.bSnapped"); } bool& bDisableEncroachmentCheckField() { return *GetNativePointerField<bool*>(this, "FPlacementData.bDisableEncroachmentCheck"); } int& MySnapToIndexField() { return *GetNativePointerField<int*>(this, "FPlacementData.MySnapToIndex"); } int& TheirSnapToIndexField() { return *GetNativePointerField<int*>(this, "FPlacementData.TheirSnapToIndex"); } AActor* FloorHitActorField() { return GetNativePointerField<AActor*>(this, "FPlacementData.FloorHitActor"); } APrimalStructure* ParentStructureField() { return GetNativePointerField<APrimalStructure*>(this, "FPlacementData.ParentStructure"); } APrimalStructure* ForcePlacedOnFloorParentStructureField() { return GetNativePointerField<APrimalStructure*>(this, "FPlacementData.ForcePlacedOnFloorParentStructure"); } APrimalStructure* ReplacesStructureField() { return GetNativePointerField<APrimalStructure*>(this, "FPlacementData.ReplacesStructure"); } APawn& AttachToPawnField() { return *GetNativePointerField<APawn*>(this, "FPlacementData.AttachToPawn"); } FName& AttachToBoneField() { return *GetNativePointerField<FName*>(this, "FPlacementData.AttachToBone"); } APrimalDinoCharacter* DinoCharacterField() { return GetNativePointerField<APrimalDinoCharacter*>(this, "FPlacementData.DinoCharacter"); } };
2:45 PM
if(OutPlacementData) { if (OutPlacementData->DinoCharacterField()) { APrimalDinoCharacter* theDino = OutPlacementData->DinoCharacterField(); if (theDino && theDino->IsA(APrimalDinoCharacter::GetPrivateStaticClass())) { crashes on the IsA()
Avatar
huh
2:46 PM
how can it 😄
Avatar
let me double check 😛
2:47 PM
ShooterGameServer.exe!UObjectBaseUtility::IsA()(0x00007ff68699a045)+0bytes[f:\build\live312jenkins\engine\source\runtime\coreuobject\private\uobject\uobjectbaseutility.cpp:265]
Avatar
seems it's null then
Avatar
Top line in the crashstack
Avatar
try to enable DumpAll in your API for testing
2:48 PM
and check if it still crashes
Avatar
struct FPlacementData look correct?
2:50 PM
Starting it up with Dump All now but I do have a pdbconfig.json in place
2:52 PM
same crash
Avatar
hm yea it seems correct
3:20 PM
for me it crashes until i enabled DumpAll
3:20 PM
i forgot to add a subclass of APrimalBuff when i was using it
Avatar
getting closer I think
3:36 PM
Ya, I got it fixed the struct I posted above was part of the issue.
3:36 PM
struct FPlacementData { FVector AdjustedLocation; FRotator AdjustedRotation; bool bSnapped; bool bDisableEncroachmentCheck; int MySnapToIndex; int TheirSnapToIndex; AActor* FloorHitActor; APrimalStructure* ParentStructure; APrimalStructure* ForcePlacedOnFloorParentStructure; APrimalStructure* ReplacesStructure; APawn* AttachToPawn; FName AttachToBone; APrimalDinoCharacter* DinoCharacter; }; Seems to work fine.
Avatar
ah makes sense
4:16 PM
you check the parent structure ?
Avatar
Wet, could I offer my help in exchange for free use when it's finished?
Avatar
My new plugin released today 🥳
Avatar
Nice lethal, looks like some good work
6:28 PM
one thing im missing on your description is what exactly the /pvp command is used for i see the "/pvp ?" to show available options but nothing in the post about what they options are
6:29 PM
One thought is that this doesnt completely block dick racering a base i.e. ride that dick in and shoot rockets (edited)
Avatar
/pvp command is for players to set floating damage text on/off
6:40 PM
the command system works very similar to my NoWander+ tribe override system
6:44 PM
i didnt even pay attention that No Wander was yours
6:44 PM
really like that one, especially the random names 😛
Avatar
substitute 7/2/2020 6:46 PM
@Lethal
6:46 PM
reinterpret_cast<UPrimalPlayerDataBP_Base*>(data))->NumChibiLevelUpsData = value; /* yolo */
6:46 PM
the yolo is quite literal
Avatar
substitute 7/2/2020 6:47 PM
if you get reinterpret_cast wrong, shit crashes
6:47 PM
there is zero type checking or conversion when using that.
Avatar
I didn't think you were a fan of using reinterpret_cast 🙂
Avatar
substitute 7/2/2020 6:47 PM
I needed to use it :\
6:48 PM
I wanted to change a value on a bp object. Normally you'd just make the child structure with the right fields and call it a day, since it should have all the inherited fields
6:48 PM
but the API doesn't work that way (since it uses PDB)
6:48 PM
so I needed to build a separate structure (with proper padding) and cast to that
6:48 PM
but I 1. also don't want data loss 2. am not going to rewrite that whole api class, fuck that
6:48 PM
struct UPrimalPlayerDataBP_Base //This is 101% an unclean solution. :| gonna find to find a way to find the field a little bit easier. { unsigned char unk[0x028]; //UObject unsigned char unk2[0x0498]; //PrimalPlayerData int NumAscensions; unsigned char UnknownData00[0x4]; TArray<float> AscensionData; TArray<struct FName> BossDinoNameTagAscensionDataMap; int SavedPlayerDataVersion; int CurrentPlayerDataVersion; int HexagonCount; int NumChibiLevelUpsData; };
6:49 PM
void SetChibi(AShooterPlayerController* playerController, int value) { AShooterCharacter* myPawn = static_cast<AShooterCharacter*>(playerController->PawnField()); UPrimalPlayerData* data = myPawn->GetPlayerData(); UFunction* bpFunction = myPawn->FindFunctionChecked(FName(L"SetNumChibiLevelUps", EFindName::FNAME_Find, false)); int params[] = { value }; myPawn->ProcessEvent(bpFunction, &params); (reinterpret_cast<UPrimalPlayerDataBP_Base*>(data))->NumChibiLevelUpsData = value; /* yolo */ data->SavePlayerData(ArkApi::GetApiUtils().GetWorld()); }
6:49 PM
one of the few times I'll use reinterpret_cast
6:49 PM
the SetNumChibiLevelUps bp function is for updating the pawn, but NumChibiLevelUpsData on UPrimalPlayerDataBP_Base is where it's actually persisted.
Avatar
I'm excited to see what new API changes come from Michidu and anyone else contributing to the effort.
Avatar
substitute 7/2/2020 6:52 PM
I talked to him about better timers
Avatar
I like reading your late night conversations when I get up in the morning lol
Avatar
I'd like to get more involved, havent had a non-work project in a while
Avatar
substitute 7/2/2020 6:52 PM
I would like to also build out a much easier system to call bp functions using findFunctionChecked
Avatar
had fun making my plugin
Avatar
substitute 7/2/2020 6:52 PM
the main issue with bp functions is that their parameters are passed as a pointer to structure.
6:52 PM
which is way different than just a list of args
6:53 PM
I was working on a system to take N args with T types and repacking them into the same memory layout as a structure
6:53 PM
but I need to make sure it works properly 100000% before I want to use it.
6:54 PM
my idea was to let people do something like BP_FUNCTION("name", "function", type1, type2, ...., typeN) (edited)
6:54 PM
and be able to call it like name_BP(arg1, arg2, ....., argN
6:55 PM
because right now, you have to do stuff like this
6:55 PM
UFunction* bpFunction = data->FindFunctionChecked(FName(L"DefeatedBoss", EFindName::FNAME_Find, false)); DefeatedBoss_Params params; params.boss = nullptr; params.DifficultyIndex = difficulty; params.tagOverride = FName(boss.c_str(), EFindName::FNAME_Add, false); params.PC = playerController; data->ProcessEvent(bpFunction, &params);
6:55 PM
if you want to use a lot of bp function calls, it can get cumbersome
Avatar
Its just like using SQL StoredProcs its not that bad
Avatar
substitute 7/2/2020 6:56 PM
i don't like it
6:56 PM
6:56 PM
I didn't write these macros for fun
6:56 PM
I don't like writing more than I have too ;P
Avatar
How do i get permissions in arkserverapi.com to post free plugin
Avatar
Someone listed as [Head Staff] will need to give you permission to create a resource.
Avatar
substitute 7/2/2020 7:00 PM
Just bug Michidu
7:00 PM
KAPPA (edited)
Avatar
Then after you post it they have to then approve it before others can see it for download.
7:00 PM
lol
Avatar
ill open source it as a fork of https://github.com/ark-mod/ArkCrossServerChat whenever i clean it up
Cross Server Chat support for ARK Survival Evolved servers. - ark-mod/ArkCrossServerChat
Avatar
substitute 7/2/2020 7:00 PM
Kappa1Kappa2 Kappa3Kappa4
Avatar
What did you change about it?
Avatar
removed syncapi, added cross tribe chat
Avatar
I'm not running or a server or playing ARK 😛
Avatar
added icons, [Admin], [VIP] tags
7:03 PM
stuff like that
7:03 PM
cross tribe chat is what i was mainly after
Avatar
@Kal i don't need help with this project but if you're willing to help with our next big project i can give it to you for free (the UI)
7:03 PM
😄
Avatar
What are you cooking up Wet?
Avatar
we wanna revive ark sotf
Avatar
now gonna add discord bot and/or webhooks for 2 -way-global, 2-way-tribechat, tribelog (edited)
Avatar
rip some assets from sotf devkit
7:04 PM
import into ark evolved
7:04 PM
do backend with a plugin
Avatar
ah cool
Avatar
I had a thought about a clientside mod that would allow server side plugins to sync normally clientside only stuff to the client or anything really. Not really sure how all that would work but it was an idea at least.
Avatar
that would work
7:07 PM
actually
7:07 PM
make a mod that runs server side and replicates to clients
7:07 PM
then call a mod function from the plugin to replicate
7:07 PM
you can even pass args
7:07 PM
and receive return
Avatar
Would be a lib type mod that other mods could use like permissions plugin.
Avatar
bit more difficult
Avatar
I hate the ADK though
Avatar
would have to call funcs by name
7:08 PM
@substitute showed me this
7:09 PM
you could make a wrapper plugin
7:09 PM
and other plugins could include it to replicate
Avatar
substitute 7/2/2020 7:09 PM
ya
7:09 PM
it's the basis of my idea that you can make a mod where the server functions are all stubs in the mod, and hooked on the server and implemented there
Avatar
Well, if either of you wanted to join up and work on something like this let me know.
7:13 PM
Would be cool to be able to change client side weight values that are displayed for example.
Avatar
client side weight values and stack sizes would be a great proof of concept
Avatar
Stack Sizes are already built in which is why I removed the feature from Items+
7:19 PM
Weight is the key missing piece which I handle the only way possible currently server side only.
7:20 PM
i still need to ditch my stack mod
Avatar
built in stack system is the safest since mods can break
Avatar
removing mod wasnt easy since it uses a diff blueprint for the items, they all go poof if i delete mod
Avatar
Ya, I played on a server back in the day that used a stack mod and it broke and the server lost basically everything.
7:22 PM
I think it was like a 10k stack or something too so so much was deleted.
Avatar
Oh, one thing is im using StructureSaver mod to autospawn raid bases would like to replicate that as a server plugin instead
Avatar
Anyone know if it is possible to add data points to the in game map to show tribemates for example? I plan to investigate if possible but thought I would just see if anyone already knew before I spend the time.
Avatar
i thought i saw a mod that was adding stuff to the map
Avatar
https://ark-server-api.com/resources/bounty-hunt.64/ This plugin might do that but hard to set a bounty on yourself on a solo dev server 🙂
BountyHunt made By Michidu for MatichaPvp This plugin will choise a player randomly and put a Bounty on him, if another player kill him he will get the rewards Its quit simple as plugins so im not going to take 500 years to explain...
7:31 PM
Also I really like the concept of this plugin its not open source so I can't extend it sadly 😦 (edited)
Avatar
Would be cool to redo that with some slight changes player command /addBounty amount Name and on the interval bounty add a minOnlinePlayers
7:33 PM
and just do it points based
Avatar
Hardcore feature: Set a bounty on a player and when that player dies the death bag is teleported to the player that set the bounty 🙂
Avatar
another thing ive got is RareSpawners which gives auto msgs about where a rare dino is if you have a radio in certain hotbar slot would be neat to get similar for a different hotbar slot to get where the bounty target is (/setTarget BountyName)
7:36 PM
oh that would be a cool option you pay 5x for setting that type of bounty "/giveMeHisHead rewardAmount Target"
7:37 PM
He apparently had option to not give tribemates bounty reward, but nothing to stop them from leaving tribe to kill and get it
Avatar
Ya, would need a timed exclusion list to prevent that.
Avatar
still, allies or friends
7:38 PM
and for the GiveMeHisHead he would just go naked to blue ob until bounty is gone?
Avatar
Ya, not sure lots of balance issues and caveats but cool concept at least.
7:40 PM
btw lethal, one thing my players reported was that when i added MAGA plugin the babies started to wander again MAGA also has a noWander option, regardless of true or false babies wandered
Avatar
Playerscommand : /Bounty : show the actual bonty and their position "The position is not working good" Wonder if this means it shows on the map?
Avatar
probably just a msg with coords
Avatar
I heard disabling the Maga wandering feature fixes the issue if using mine.
7:42 PM
I think there was a post on the forums stating that IIRC.
Avatar
i thought i had tried that, i might be crazy and imagined it
Avatar
Awesome Update! Thanks again for such an Epic Plugin!! Thanks for adding in conscious only ;)
7:44 PM
Avatar
alright thx, not to get support in this channel
7:51 PM
@Michidu Could i get permissions to post a plugin please?
7:55 PM
Whats the best way to prevent players from firing any projectile/weapon? (Making slight modifications to the EventManager, having issue where players are killing each other before event starts after tping in, or instantly after, and using grapples before they are supposed to move) Also would like a way to prevent team damage in TDM as well as hide tribe names and show event team names instead Any thoughts or pointers would be appreciated (edited)
Avatar
Try AShooterWeapon::AllowFiring
Avatar
k, and for hiding tribemate names and showing event team names instead?
Avatar
no clue 🙂
7:57 PM
1 problem at a time i suppose
Avatar
another tip StartUnequip() will put the weapon away
Avatar
doesnt stop them from pulling it back out xD
Avatar
but if you are blocking the weapon use each time they try and fire it puts it away
Avatar
ohh gotcha
7:59 PM
nice
Avatar
I do something similar in an "undisclosed" plugin i've been working with @Foppa on for a couple months.
Avatar
gonna add a "WeaponsActivationDelay" to block fire and de-equip if they try during first few seconds
Avatar
Looks like I can add stuff to the map.
Avatar
nice, what are you doing that for?
Avatar
PvP+ plugin feature to show Tribemates on the map.
Avatar
how quickly does it update the position of marker? i figured that would all be client side
Avatar
Not sure I just started looking at the decompiled source.
8:11 PM
what all features you adding in PvP+ if you dont mind me asking? (edited)
Avatar
It does several things already.
8:12 PM
Adding features as they come up.
8:13 PM
I have a decent size discord community to help with ideas.
Avatar
i recently bought and started using Maga just curious how much overlap you were thinking of I love FOSS and really not a fan of his 1 year renewal thing
8:14 PM
basically hoping to replace it before i need to re-buy
Avatar
I try and not step on others toes that are doing paid plugins but sometimes there is some overlap. I don't plan on building an ORP system at this time 🙂
Avatar
orp is tricky obviously
8:15 PM
mainly interested in the pvp cooldown on items
Avatar
taking suggestions/feature requests on my discord for all of my plugins
Avatar
seems like it would fit well with what you have built
8:16 PM
i dont think im in yours yet
8:17 PM
oh jeez, tribelog relay is yours too i need to pay more attention
8:17 PM
Was my first plugin.
Avatar
now that i have cross server global & tribe chat (in Mysql) i want to add 2 way discord<->Ingame for tribe&global chat
8:19 PM
i shoulda just started by talking with you xD
Avatar
Ya, that's a cool thing so people not in game can still participate as part of the community.
Avatar
the cross tribe chat has been a big hit so far
8:19 PM
and i think the discord will make it even better
8:21 PM
gonna try to extend tribelog relay to also do the 2 way tribe chat then have a version with no tribe or logs for 2 way
8:21 PM
hadn't really dug into whats possible with the discord webhook yet though probably better to do the discord->ingame with a bot
8:22 PM
then can restrict discord global chat to VIP or Donor roles
Avatar
seems like a lot of work to replicate everything it does to add in chat
Avatar
from my perspective i plan to build the 2 way tribe&global chat anyways tribe log is a bonus to go with tribe chat havent really looked into much or decided on discord webhooks/bot
8:30 PM
but if i do the tribe log it completely overlaps your plugin
8:30 PM
except for servers that dont want the cross chat i suppose
8:31 PM
so it'd be nice to work with you to figure out a ideal solution
Avatar
I guess i'm not seeing the overlap with tribe logs and tribe chat. While they both use discord webhooks to send the information to discord they are completely different internally.
Avatar
i guess you're right, just would be weird to do those through 2 separate plugins
8:38 PM
maybe ill just add a very similar TribeChatRelay command
/TCR <Discord Webhook>
8:40 PM
webhook is push only? makes sense i guess, not sure what i expected there (edited)
Avatar
You POST to a webhook
8:44 PM
webhooks have message size and frequency limitations on them as well you will need to consider.
Avatar
server hosted discord bot invited to tribe discords then i guess
8:56 PM
linking it all will be tricky
Avatar
something along the lines of "Invite bot to tribe discord" /linkTribe in discord, responds with "tell your tribe owner to use /linkTribe asdgii324n52n3i4uqwaiue5AQ53 ingame tribe owner ingame does /linkTribe asdgii324n52n3i4uqwaiue5AQ53 plugin inserts discordId+channelId+tribeId into sql (edited)
Avatar
cool, nice idea
7:58 AM
while you are messing the dino loot... wanna take a stab at figuring out why rag bosses occasionally dont give element? they give everything else in the modified drop list all the time, but element disappears somewhat often
Avatar
TArray<UObject*, FDefaultAllocator> masterList; Globals::GetObjectsOfClass(UPrimalCharacterStatusComponent().ClassField(), &masterList, true, EObjectFlags::RF_NoFlags); Should this return back a list of all UPrimalCharacterStatusComponent's or am I missing something?
Avatar
substitute 7/6/2020 6:16 PM
you don't need to do this TArray<UObject*, FDefaultAllocator> masterList;
6:16 PM
TArray<FString> strings; command->ParseIntoArray(strings, {L" "}, true); TArray the DefaultAllocator by default (edited)
6:17 PM
anyways, it should return a list all instances of UPrimalCharacterStatusComponent that are on the server.
Avatar
masterList.num() is always 0
Avatar
substitute 7/6/2020 6:24 PM
have you tried a different class?
Avatar
No, since i'm trying to pull that one 🙂
Avatar
substitute 7/6/2020 6:24 PM
UPrimalCharacterStatusComponent may not actually exist in it's pure form, not sure if Globals::GetObjectsOfClass returns only classes that exactly match, or if children classes match too.
6:25 PM
Try getting a list of dinos with that function
6:25 PM
and see what happens
6:27 PM
TActorIterator looks like the C++ version
6:27 PM
void FindAllActors(UWorld* World, TArray& Out) { for (TActorIterator It(World, T::StaticClass()); It; ++It) { T* Actor = Cast(*It); if (Actor && !Actor->IsPendingKill()) { Out.Add(Actor); } } }
6:32 PM
Globals::GetObjectsOfClass(APrimalDinoCharacter().ClassField(), &masterList, true, EObjectFlags::RF_NoFlags); returned 0 as well
Avatar
substitute 7/6/2020 6:39 PM
yea
6:39 PM
that func might be goofed
Avatar
Going to try this UGameplayStatics::GetAllActorsOfClass()
Avatar
substitute 7/6/2020 6:43 PM
that is what you'd want
6:43 PM
that should work
6:43 PM
that also includes child classes
6:43 PM
if you did like UObject, it'd get all objects for example
Avatar
substitute 7/6/2020 6:49 PM
check pdb
6:49 PM
might be missing
6:50 PM
@Lethal
6:50 PM
6:50 PM
my IDA (older database) shows it existing
6:50 PM
worst case, you could always try calling the blueprint version
Avatar
Goal is to modify the Status Component values the server is using.
6:52 PM
I can do it during runtime but settings are not saved when server restarts
6:56 PM
Inheritance of these objects UPrimalCharacterStatusComponent : UActorComponent : UObject AActor : UObject
6:59 PM
I don't think that can be used for this purpose since there is no inheritance to AActor.
Avatar
substitute 7/6/2020 7:02 PM
why not get all the actors
7:02 PM
all the primal characters
7:02 PM
and get their status comps?
Avatar
UGameplayStatics::GetAllActorsOfClass(world, APrimalDinoCharacter().ClassField(), &masterList); Crashes as well
Avatar
substitute 7/6/2020 8:23 PM
@Lethal
8:23 PM
where are you running it (edited)
8:24 PM
commands should be in the game thread, but ensure it's running in a game thread
Avatar
I ended up getting it to work for dinos at least.
8:44 PM
My class was not being set correctly.
Avatar
Hey guys, im trying to add Unicode support to my cross chat plugin I naively converted the crap out of strings left and right with no discernable pattern But even this simple example chat_message.Message = FString(L"3: медведь"); aShooterPC->ClientChatMessage(chat_message); is saying [][][][][][] ingame
12:35 AM
any tips?
Avatar
substitute 7/7/2020 1:49 AM
@Kal
1:50 AM
Do you have a font on your game that supports the cyrillic alphabet
Avatar
^^
1:50 AM
if it was non unicode it would be ?????????
1:51 AM
[][][][][] means it's unicode but not shown on your client
Avatar
substitute 7/7/2020 1:53 AM
[] just means the symbol doesn’t exist in the current font
Avatar
so i saw both, depending on where i tried to add a u16string passed directly into ClientChatMessage im seeing [][][][] coming from Sql it gets changed to ????? assuming thats my fault
2:26 AM
im not sure how to add cyrillic fonts to ark, havent messed with it before
Avatar
substitute 7/7/2020 2:31 AM
Well for starters there’s nothing you need to do with fstrings and text encoding
2:31 AM
They’re utf16 already
Avatar
followed: https://steamcommunity.com/sharedfiles/filedetails/?id=732646921 ill probably see the right characters now
Are you tired of seeing squares instead of letters in the nicknames or chat messages from other players? You know several languages ​​and want to use your knowledge to keep your tribe informed, or
Avatar
substitute 7/7/2020 2:31 AM
Yeah that’s my font actually
Avatar
i think the issue i have is in all my needless conversions
Avatar
substitute 7/7/2020 2:32 AM
That one is older but it should work for this
Avatar
i just gotta figure out how/where im supposed to use FString, U16String, WString, std::string i think a good part of the issue is because the mysql11++ query method takes a std::string and im attempting to format for insert, then again on select
2:34 AM
ok ty, i no longer see [][][] and see the actual word with fancy letters
Avatar
substitute 7/7/2020 2:34 AM
also
Avatar
just gotta get the rest of the plugin to stop breaking it
Avatar
substitute 7/7/2020 2:34 AM
for sql
2:34 AM
1. make sure your charset supports the characters
2:34 AM
this means you're going to need to set it to like unicode_ci
Avatar
yea, i can insert the characters manually and its fine
Avatar
substitute 7/7/2020 2:34 AM
2. std::string should work fine for insertion
Avatar
changed the table to utf16
Avatar
substitute 7/7/2020 2:35 AM
then it should be fine
2:35 AM
i was also at one point thinking of making a cross-server chat plugin
2:35 AM
but I was not going to use a database
Avatar
database made it easy to add discord as optional extension
Avatar
substitute 7/7/2020 2:35 AM
I was thinking of making a very basic chat server that would get and relay messages
2:35 AM
which also would have the same ease of use for discord (edited)
Avatar
and do it with http calls to your hosted server?
Avatar
substitute 7/7/2020 2:36 AM
no
2:36 AM
i would use actual sockets
2:36 AM
http is so much extra overhead
2:36 AM
yeah, was gonna say
Avatar
substitute 7/7/2020 2:37 AM
the server would probs be written in C# for simplicity's sake
2:37 AM
but that's something to worry about in the future
Avatar
not a simple refactor at this point, atleast for my plugin/discord bot
Avatar
substitute 7/7/2020 2:38 AM
it would be a lot of extra work too
2:38 AM
as you would need to write client/server logic
2:38 AM
and have some basic auth system
Avatar
well, i guess it is i have insert and handleDbMsg methods
2:39 AM
that i could swap out
2:39 AM
the auth would be rough
Avatar
substitute 7/7/2020 2:39 AM
na, you'd have to write the socket client and chat server
2:39 AM
i'd just use a token tbh KEKW
2:39 AM
then you have to worry about plaintext but stitch_shrug
2:39 AM
who cares
Avatar
substitute 7/7/2020 2:39 AM
no one is going to sniff the traffic from server a to b
2:39 AM
could also ip whitelist
Avatar
whitelist on sql has made that not a concern so far
Avatar
substitute 7/7/2020 2:40 AM
sql imo should never be accessed on the internet directly
2:40 AM
but if it's only being used for this
2:40 AM
and only this
2:40 AM
i guess it's not so bad
Avatar
i certainly made several mistakes and its not the most ideal solution
2:41 AM
bot seems to be working decently so far
Avatar
substitute 7/7/2020 2:41 AM
yeah i mean just stuff to consider working on after you finish the initial stuff (edited)
Avatar
im not entirely convinced on the benefit of switching to a hosted server and sockets to communicate if MySql is sufficient (so far) (edited)
Avatar
substitute 7/7/2020 2:42 AM
I’m talking from a security standpoint
2:42 AM
I would never grant my sql server internet access
Avatar
for security im not super worried, since its only chat
Avatar
substitute 7/7/2020 2:43 AM
So that’s a trade off people will have to make
2:43 AM
Yes but the whole sql server has to be internet accessible
Avatar
substitute 7/7/2020 2:43 AM
So if you run other databases that’s a security hole
2:43 AM
It’s a trade off people would have to make
Avatar
i suppose you could host 2 seperate sql servers on diff ports
2:43 AM
and have a local only one
Avatar
substitute 7/7/2020 2:43 AM
If the servers are on the same lan it’s not an issue
Avatar
i was anticipating this working for servers on different machines
Avatar
substitute 7/7/2020 2:45 AM
Different machines can be on the same lan (edited)
Avatar
Whats best way to get an std::string out of an FString FString(msg.ToString()) converted it to ????????
Avatar
Finding all kinds of references to TCHAR_TO_UTF8 but cant seem to find what to import to get the method
Avatar
substitute 7/7/2020 3:31 AM
why are you trying to convert to utf8?
3:31 AM
TCHAR should be utf-16 (edited)
Avatar
uhh, good point, ignore the TO_UTF8 but, was just googling at trying shit
3:53 AM
need FString().ToString() without it replacing with random characters
Avatar
i cant find anything to properly convert FString to std::string so i can use it in my mysql.query()
5:13 AM
the only thing i have found is FString().ToString() but it is replacing all the characters with ?
Avatar
ToString() is the correct thing
Avatar
Try these: std::string to FString FString myFString = FString(ArkApi::Tools::Utf8Decode(myString)) FString to std::string std::string myString = ArkApi::Tools::Utf8Encode(myFString)
Avatar
that goes to and from wstring not FString
5:55 AM
or at least for the Encode it takes wstring, not FString
Avatar
it does take FString or my TLR plugin wouldn't be working lol
6:04 AM
Search Discord for "unicode" and back in March when I made my first plugin I was dealing with this same topic
Avatar
it wasn't happy with it for me 😦
6:06 AM
std::wstring w(*myFString); std::string msg = ArkApi::Tools::Utf8Encode(w); this worked
6:06 AM
i guess struct of wstring and Fstring are same?
Avatar
Only use FString and std::strings
6:12 AM
no need for anything else
Avatar
substitute 7/7/2020 6:12 AM
Fstring tostring gives std string
6:12 AM
You can do c_str on std string for const char*
Avatar
I bet this works for your example std::string msg = ArkApi::Tools::Utf8Encode(**myFString);
Avatar
substitute 7/7/2020 6:16 AM
He doesn’t need utf encode
6:16 AM
Fstrings are utf 16
Avatar
I'm pretty sure I had to do encode to send to discord properly.
6:18 AM
actually for that its decode
6:19 AM
void sendDiscordMessage(std::string message, std::string url) { nlohmann::json j; try { j["content"] = message; const std::string jsonMessage = j.dump().c_str(); const std::string webHookURL = url.c_str(); AShooterGameState* ShooterGameState = static_cast<AShooterGameState*>(ArkApi::GetApiUtils().GetShooterGameMode()->GameStateField()); ShooterGameState->HTTPPostRequest(FString(webHookURL), FString(ArkApi::Tools::Utf8Decode(jsonMessage))); } catch (std::exception ex) { Log::GetLog()->error(ex.what()); } }
6:22 AM
Writing to the database you should only need to use FString.ToString() though
Avatar
I was able to get it working thanks 😄
7:45 AM
FString.ToString() was giving ????? every time std::wstring wideStr(*msg.Message); std::string msgStr = ArkApi::Tools::Utf8Encode(wideStr); ended up working
Avatar
TopArkServers 7/9/2020 1:26 AM
Hello, are there any plans to update the voting rewards plugin? Reached out to ownprox a few times via DM on the site and haven't heard back.
Avatar
substitute 7/9/2020 1:47 AM
@Michidu I made a PR
Avatar
did you mean to add the enums to atlas?
Avatar
substitute 7/9/2020 5:52 AM
@Kal no
5:52 AM
It should have been in the ark enums
5:52 AM
Is it in atlas?
Avatar
PR says it is
Avatar
substitute 7/9/2020 5:52 AM
Oh
5:53 AM
I’m sure they’re similar but I’ll update it
👍 1
Avatar
Anyone have a working/tested struct FStatusValueModifierDescription?
12:31 AM
I'm getting some gibberish ᣠ翷 ⢐翷 output
Avatar
@Lethal I can look in a bit
Avatar
@substitute Thanks. I've tried several variations now but nothing seems to output any expected data.
Avatar
Nobody has working code to check buff information?
Avatar
it's not possible
7:44 PM
all fields for buffs are empty
Avatar
API doesn't have the structs built in by default I know.
Avatar
no i mean, if you import them and try to access buff fields they're empty
Avatar
but are you saying even with those in place it still won't work?
Avatar
it's weird they do most of buffs with BP
Avatar
I'm getting some data just not what the ADK shows should be the data.
Avatar
@WETBATMAN
9:05 PM
It’s possible
9:06 PM
You said so yourself with bps
Avatar
yea but i meant the fields are empty
9:07 PM
maybe impossible wasn't the right word hah
Avatar
So not possible to get any of this information?
9:43 PM
BuffType or Modifier Name
Avatar
TArray<APrimalBuff*> theBuffs; _this->GetBuffs(&theBuffs); Log::GetLog()->info("Buff Count: {}", theBuffs.Num()); Shows when a buff is active. Just need some identifier to know what buff.
Avatar
@Lethal let me look for both of the structures we are looking for
9:58 PM
I know buffs have to be readable somewhat from C++
Avatar
I've tried different variations of this. struct __declspec(align(8)) FStatusValueModifierDescription { char __padding[0x50L]; UTexture2D* ModifierIconField() { return GetNativePointerField<UTexture2D*>(this, "FStatusValueModifierDescription.ModifierIcon"); } FString& ModifierNameField() { return *GetNativePointerField<FString*>(this, "FStatusValueModifierDescription.ModifierName"); } FString& ModifierDescriptionField() { return *GetNativePointerField<FString*>(this, "FStatusValueModifierDescription.ModifierDescription"); } FColor& ModifierColorField() { return *GetNativePointerField<FColor*>(this, "FStatusValueModifierDescription.ModifierColor"); } bool& bDisplayHUDMessageField() { return *GetNativePointerField<bool*>(this, "FStatusValueModifierDescription.bDisplayHUDMessage"); } FString& HUDMessageField() { return *GetNativePointerField<FString*>(this, "FStatusValueModifierDescription.HUDMessage"); } FColor& HUDMessageColorField() { return *GetNativePointerField<FColor*>(this, "FStatusValueModifierDescription.HUDMessageColor"); } bool& bPreventDrawingBuffDescriptionField() { return *GetNativePointerField<bool*>(this, "FStatusValueModifierDescription.bPreventDrawingBuffDescription"); } int& BuffTypeField() { return *GetNativePointerField<int*>(this, "FStatusValueModifierDescription.BuffType"); } // Functions FStatusValueModifierDescription * operator=(FStatusValueModifierDescription * __that) { return NativeCall<FStatusValueModifierDescription *, FStatusValueModifierDescription *>(this, "FStatusValueModifierDescription.operator=", __that); } };
10:00 PM
removed padding removed align (edited)
Avatar
I wouldn't use get native XXX
10:04 PM
because if the field isn't in the pdb
10:04 PM
it won't find it
Avatar
I tried the version directly from IDA as well.
10:05 PM
struct __cppobj __declspec(align(8)) FStatusValueModifierDescription { UTexture2D *ModifierIcon; FString ModifierName; FString ModifierDescription; FColor ModifierColor; bool bDisplayHUDMessage; FString HUDMessage; FColor HUDMessageColor; bool bPreventDrawingBuffDescription; int BuffType; }; Have to remove __cppobj for it to compile
Avatar
maybe try
10:09 PM
struct FStatusValueModifierDescription { UTexture2D* ModifierIcon; FString ModifierName; FString ModifierDescription; FColor ModifierColor; bool bDisplayHUDMessage; FString HUDMessage; FColor HUDMessageColor; bool bPreventDrawingBuffDescription; int BuffType; }; (edited)
10:12 PM
@Lethal
10:12 PM
maybe your APrimalBuff is wrong
10:12 PM
so when you do buff->field you're not getting the actual field.
Avatar
APrimalBuff is already defined in the API
10:13 PM
this doesn't work?
Avatar
FStatusValueModifierDescription test; buff->GetBuffDescription(&test);
Avatar
hm
10:15 PM
oh
10:15 PM
have you tried calling the bp function directly?
10:15 PM
v2 = UObject::FindFunctionChecked(v5, SHOOTERGAME_GetBuffDescription);
Avatar
do you have the devkit installed?
Avatar
v5 is the buff pointer
10:16 PM
Ya, I have it open
Avatar
Can you take a picture of GetBuffDescription ?
10:16 PM
it should be a node on a buff in the event graph
Avatar
well that's not a super helpful node
10:18 PM
hahaha
Avatar
oh
10:20 PM
I think I found a problem?
10:20 PM
you declare TArray<APrimalBuff*> theBuffs; yeah?
Avatar
so then why
10:20 PM
FStatusValueModifierDescription test; buff->GetBuffDescription(&test);
10:20 PM
wait (edited)
10:20 PM
I misread
10:22 PM
alright
10:22 PM
I'm gonna test 4u (edited)
Avatar
Just about to try the class you said to try.
10:23 PM
err struct
Avatar
@substitute Any luck?
Avatar
Na (edited)
6:12 PM
One tough cookie to crack
6:13 PM
I have a few other ideas though
Avatar
Well I feel a little better I couldn't get it to work 🙂
6:26 PM
I was able to accomplish what I wanted without it but its not as elegant as interfacing with the buffs directly.
Avatar
AaronBasques 7/14/2020 9:48 PM
hi, does anyone know what would cause this compile error?
9:49 PM
TMap<FString, int64, FDefaultSetAllocator, TDefaultMapKeyFuncs<FString, int64, 0> > CommandCoolDowns; CommandCoolDowns.Add(FString::Format("{}:{}", steam_id64, __FUNCTION__), (DrClean::DrTools::SystemEpochMillis() - 3600000)); const int64 time_stamp_millis = DrClean::DrTools::SystemEpochMillis(); int64 previous_time_stamp_millis; CommandCoolDowns.RemoveAndCopyValue(FString::Format("{}:{}", steam_id64, __FUNCTION__), previous_time_stamp_millis);
9:53 PM
int64 SystemEpochMillis() { using namespace std::chrono; return duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count(); }
Avatar
yes, you're calling the function wrong
10:13 PM
none of your parameters match one of the functions properly
10:13 PM
10:13 PM
Avatar
AaronBasques 7/14/2020 10:18 PM
i mean.. that's what it says.. but what has the shared pointer of Fhttp.. go to do with an FString being used as a Map key?
10:19 PM
i dont see any hash function in FString so maybe its that, i'll try wrapping and give it a hash function it and see if that helps
10:25 PM
@Lethal @substitute (i'm not sure i read things correct & I'm not sure if its helpful .. but) the node @Lethal posted is to override the buff description at runtime within the owning buff itself so it would not be useful unless you are setting a custom description on the fly from graph.
10:28 PM
the way to get the buff description in graph is like this
10:30 PM
or
Avatar
@AaronBasques TMap supports only simple types as key
10:49 PM
like int,uint and so on....
Avatar
AaronBasques 7/14/2020 10:49 PM
thats not true
Avatar
i mean in the API
10:49 PM
the hashing function for FString is not implemented
Avatar
AaronBasques 7/14/2020 10:51 PM
yeah i saw the hash on FString isnt implemented as long as you provide an equals and hash functions anything can be used, i just wrapped the FString and gave it its overrides, its all good now its taught me to check if the type i'm using as a key is implementing GetTypeHash an basic operators
Avatar
@AaronBasques I don't believe that is accurate , the GUI has to get buff info
Avatar
AaronBasques 7/15/2020 4:50 AM
you mean the client HUD?
Avatar
Yes
Avatar
AaronBasques 7/15/2020 4:52 AM
the info isnt passed from the server afaik, buffs are both server side and client side
4:53 AM
you can get buff info on both, so do display info on the client you really only need the client side reference
Avatar
...
4:53 AM
you missed the point
4:53 AM
There is a function to get the BUFF info to display it on the HUD
4:53 AM
so it exists
Avatar
AaronBasques 7/15/2020 4:55 AM
so are you looking to change the buff info on the server from the plugin that is displaying on the client?
4:56 AM
in other words, you wanna update the displayed info of a buff from the api?
Avatar
I was just trying to read the buff information.
Avatar
AaronBasques 7/15/2020 6:10 AM
@Lethal i played around with it a bit and could get anything useful, sorry man all i managed to get was
6:10 AM
just the actor class of the buff
6:10 AM
¯\_(ツ)_/¯
Avatar
Yep, as far as I got with it as well.
Avatar
When I add the Kals Cross Chat with Discord & Tribes plugin the rcon does not appear the chat of the people who speak in the game.
Avatar
That's cause i forgot to pass it along to RCON after displaying the msg someone else mentioned it and i forgot to change, sry
5:07 AM
@Lethal How were you getting the players from boss arena? i'm trying to make an "BossEngramsOverride" but can't think of a reliable way to get the players from the arena (cant trust killer, i.e. dino dmg or tick dmg from like a dienon)
5:09 AM
is there a better hook you could think of instead of Hook_APrimalDinoCharacter_Die
5:09 AM
nm, im dumb void DefeatBoss(int playerID, FName bossName, char difficulty) { NativeCall<void, int, FName, char>(this, "UShooterCheatManager.DefeatBoss", playerID, bossName, difficulty); }
5:10 AM
What about blocking it from giving the regular tek unlocks?
Avatar
nm, that hook was for the rcon defeatBoss method
5:54 AM
any help would be appreciated
Avatar
use arena coordinates and scan for players
Avatar
FTribeAlliance::MembersTribeID() seems to return garbage anyone familiar with FTribeAlliance? TArray<FTribeAlliance> alliances = player_state->MyTribeDataField()->TribeAlliancesField(); for (FTribeAlliance alliance : alliances) { Log::GetLog()->info(fmt::format("Tribes Found: {}", alliance.MembersTribeIDField().Num())); } Some sample output Tribes Found: -1515365888 Tribes Found: 1670472240
Avatar
None of the big brains wanna chime in on this one? 😛
3:57 AM
I'm working around it but its a lot of work if I can't read the Tribe Id's of the alliance members.
Avatar
Maybe it’s an unsigned int?
Avatar
But MembersTribeIDField().Num() should just give the number of tribes found
4:01 AM
for (auto TribeId : alliance.MembersTribeIDField()) { //do stuff }
4:01 AM
pretty sure this crashes
Avatar
Oh wait
4:02 AM
That is strange
4:05 AM
And if I pull the Alliance data a different way like _this->MyTribeDataField()->FindTribeAlliance(AllianceID); It just gives me back junk Tribe Ids that don't exist.
4:06 AM
So, my thought is something is wrong with the API struct for this data.
Avatar
I swapped the struct in the API for a different version and I think its working properly now.
4:53 AM
Is there a way to supersede the API struct from a plugin? I made the struct change compiled it and booted the server with it.
Avatar
Na
6:43 AM
You gotta change headers
6:43 AM
But that stays in your plugin
6:43 AM
Like others don’t need your edits
6:43 AM
@Lethal
6:44 AM
You should fork the api and make a pr with the fix
Avatar
So, no need for a new version.dll?
6:50 AM
I have a fork and have changes in the API already. (edited)
Avatar
Yep, you are correct the updated DLL wasn't needed for the header change.
Avatar
Any ideas on how I would reduce cannon damage to structures by a percentage instead of disabling it?
Avatar
i'm soon about to release an plugin on that, maybe wana beta test it? 🙂 (edited)
Avatar
PvP+ has this as it was suggested by you @Kal just hadn't pushed it out yet.
Avatar
oh, never saw a response so i was starting to write it
5:08 PM
and Foppa, maybe, whats the functionality?
Avatar
Looking for some brainstorming ideas here. I have a new plugin concept i've been working to allow dino stat modification and allow flyer speed leveling again. Everything is working so far except ARK will not save the flyer speed stat between reboots. Instead it refunds the points as levels which you can use to relevel speed. This is only the case on flyers that are not in upload or cryo. I have tried many different hooks and looked through tons of decompiled source code. Not sure the piece i'm missing yet to accomplish this. I plan to implement a work around to save the flyer speed player added levels and force add them back in if need be but I would really like to solve this natively if possible. Anyone have thoughts or ideas on this?
Avatar
Sorry man I don't know, but I did see your post about FTribeAlliance and I'm curious to know what changes you made to make it work. I came across that issue before and didn't need to bother but well, since you got it to work, I'm curious 🙂
10:54 PM
Although your point above about making the flyers stats persistent is interesting too... (edited)
Avatar
I just pulled the FTribeAlliance struct from IDA directly and used it basically.
Avatar
Alright, I'll try that. Thx!
Avatar
Well, I have the structure under the eyes and the code from the API and I'm not really seeing what's wrong. I'm not new to programming but got to c++ this year only, and to IDA very recently so I may not have the eyes for it yet. Variable names and types seem right. I think I also figured out what those 'dd' and 'db' instructions are, but that doesn't seem to get me much further.
12:21 PM
That's what I'm looking at:
12:21 PM
12:23 PM
AllianceIDField() always returns the same int, regardless of the alliances my character is into. AllianceNameField() is always empty. Same for GetDescriptiveString(). I keep questionning what I'm looking at to keep digging, but I'm not sure where to step next.
Avatar
simple as this struct FTribeAlliance { FString AllianceNameField; unsigned int AllianceIDField; TArray<FString> MembersTribeNameField; TArray<unsigned int> MembersTribeIDField; TArray<unsigned int> AdminsTribeIDField; };
1:19 PM
I kept the naming the same the API uses but not required
1:30 PM
ok then
1:31 PM
so you replaced the API struct definition in Tribe.h, regenerated the lib and used it in your plugin?
Avatar
I just commented out the old struct and put mine in and recompiled my plugin. Shouldn't need a new lib
Avatar
cool! ok, thanks for the help man, I appreciate!
Avatar
So I've been trying to use the hook UPrimalItem.EquippedBlueprintTick but it doesn't seem to fire when something is equipped on the player. I've also tried to use UPrimalItem.EquippedTickIs there anything I am misunderstanding here? (edited)
Avatar
Deleted User 7/22/2020 8:05 PM
Is the plugin dev only in c++ is there no other language?
Avatar
Yup, only C++
Avatar
Any idea what hook I should use to post a message to the player once they are connected and able to move around... I've tried so many hooks with no avail...
8:39 PM
There must be something I am missing 😦
Avatar
Deleted User 7/22/2020 8:43 PM
is there any plugin that reloads the game ini and gus during runtime? the current one on the store doesnt seem to work
Avatar
Any idea what hook I should use to post a message to the player once they are connected and able to move around... I've tried so many hooks with no avail...
@ShadowEvil There is the AShooterGameMode.HandleNewPlayer that would fire when a player joins, but you'll have to do your checks for when player controller or character is valid
Avatar
So
9:03 PM
9:03 PM
Wouldn't be enough to test?
9:10 PM
Does HandleNewPlayer fire multiple times with different data for just 1 login?
Avatar
Just 1, but you should check if NewPlayer != nullptr, cause in some cases (if not all of them) until player spawns in server, cause this and all similar hooks fire when player joins and is still loading his client, returns a nullptr and will crash most likely. (edited)
Avatar
Okay well I did that but my SendNotification never fired 😦
9:37 PM
The documentation for this stuff is almost non-existent lol
Avatar
the hook im using for chat appears to have a 1s spam prevention built in But i've implemented a separate configurable spam timer, is there a different hook i can use before the built in one?
Avatar
Which hook are you using?
Avatar
@ShadowEvil HandleNewPlayer is called when you see snapshot_16 on your client, if you send the message that early players won't see it
9:47 PM
unless they load super fast
Avatar
So if I call it then - I would need a delay?
9:48 PM
Because I tried to hook into the MOTD but that didn't work - as I did not have a message of the day setup... However should that matter?
Avatar
yes, or find a different hook
9:48 PM
Server Plugins for ARK: Server API. Contribute to Michidu/Ark-Server-Plugins development by creating an account on GitHub.
9:48 PM
have a look at ArkAdverts
9:49 PM
it already does what u want
Avatar
So, does HandleNewPlayer handle the existing players that have logged out but are logging back in?
9:49 PM
Oh kool thanks 🙂
Avatar
it handles anyone that connects
Avatar
Awesome. Thank you so much! 🙂
Avatar
@Pelayori commands.AddOnChatMessageCallback("ChatMessageCallback", &ChatMessageCallback);
Avatar
Haven't messed with chat callbacks yet sorry :p
Avatar
@WETBATMAN it worked thank you 🙂
Avatar
@Foppa @GSH | MrOwlSky who am I talking to to buy the full version of the ark plugin KalsCrossChat?
Avatar
AaronBasques 7/24/2020 7:00 AM
does anyone happen to know which hook is used when the server reports there is a player character that already exists on the server when trying to transfer into a server where you already have a character? or the hook that can be used to detect if a character is overwritten?
Avatar
@Cuasar You talk with @Kal
👍 2
Avatar
Anyone know what error code 193 is?
Avatar
Never seen that error
Avatar
Anyone know how i should output chat to rcon? Using AddOnChatMessageCallback for chat (which seems to have an unavoidable 1s spam timer) When i return true to prevent default chat, chat stops going to rcon Cant seem to find a way to get the RconClient other than adding rcon commands?
Avatar
The callback has the built in 1s spam code in it.
10:20 PM
I think you need URCONServer::AddToChatBuffer(FString *Message) but it is not defined in the API.
Avatar
do you know if there is a different hook to use instead of the register callback?
3:00 AM
i guess i should dig into the api code and see how thats working
3:05 AM
looks like i need to do void Hook_AShooterPlayerController_ServerSendChatMessage_Impl( AShooterPlayerController* player_controller, FString* message, EChatSendMode::Type mode) to bypass the built in chat spam
Avatar
Ya, that would work if thats all you need to bypass.
Avatar
Curious if anyone else knows about the plugin auto reload system built into the API. I stumbled upon it today looking through the source code. If you are not familiar you can place a plugin DLL renamed to be like ItemsPlus.dll.ArkApi and within 5 seconds the plugin will unload the old DLL and rename/load the new DLL. I created the following in VS to build the file needed to use the feature automatically on build. Pre-Build Event: del "$(SolutionDir)$(PlatformName)\$(ConfigurationName)\*.ArkApi" Post-Build Event: copy "$(SolutionDir)$(PlatformName)\$(ConfigurationName)\*.dll" "$(SolutionDir)$(PlatformName)\$(ConfigurationName)\*.dll.ArkApi" /y
🆒 1
Success 1
Avatar
AaronBasques 7/27/2020 9:52 PM
@Lethal yeah i use it for a while now rem deployment.bat @ECHO OFF CLS setlocal enabledelayedexpansion set SolutionDir=%1 set Platform=%2 set Configuration=%3 set ProjectName=%4 for %%x in ( INSTALL_TESTSERVERA, INSTALL_TESTSERVERB, INSTALL_TESTSERVERC, INSTALL_THEISLAND, INSTALL_SCORCHEDE, INSTALL_ABERATION, INSTALL_RAGNAROK, INSTALL_THECENTER, INSTALL_CRYSTAL, INSTALL_EXTINCTION, INSTALL_VALGUERO, INSTALL_GENESIS1 ) do ( rem LOCAL rem set _directory=D:\ARK_SERVER\%%x\ShooterGame\Binaries\Win64\ArkApi\Plugins\%ProjectName% rem Mapped Network Drive set _directory=W:\%%x\ShooterGame\Binaries\Win64\ArkApi\Plugins\%ProjectName% if not exist "!_directory!" mkdir !_directory! rem will not overwrite dll if server running but will be overwritten by auto reload dll.ArkApi... copy /y "%SolutionDir%%Platform%\%Configuration%\%ProjectName%\%ProjectName%.dll" "!_directory!\%ProjectName%.dll" copy /y "%SolutionDir%%Platform%\%Configuration%\%ProjectName%\%ProjectName%.dll" "!_directory!\%ProjectName%.dll.ArkApi" copy /y "%SolutionDir%%Platform%\%Configuration%\%ProjectName%\%ProjectName%.pdb" "!_directory!\%ProjectName%.pdb" copy /y "%SolutionDir%%Platform%\%Configuration%\%ProjectName%\PluginInfo.json" "!_directory!\PluginInfo.json" copy /y "%SolutionDir%%Platform%\%Configuration%\%ProjectName%\config_defaults.json" "!_directory!\config_defaults.json" ) EXIT Build Events > Post Build Events > Command Line start $(SolutionDir)deployment.bat "$(SolutionDir)" "$(Platform)" "$(Configuration)" "$(ProjectName)" (edited)
Avatar
AaronBasques 7/27/2020 10:04 PM
deployment.bat is located in the root dir, so as long as the child project is within, any project can be deployed easily (edited)
thumbsup_eft 1
10:11 PM
ofc this works for my dir structure, anyone else would have to modify
Avatar
For my development environment I built everything into the Post-Build Event which does all the same tasks each time I build.
3:52 AM
batch file is great idea though
Avatar
i had a problem with Kals CrossChat (edited)
Avatar
look dm plz
Avatar
I'm trying to get if structure is obstructed with this function: int Hook_APrimalStructure_BPIsAllowedToBuild(APrimalStructure* _this, FPlacementData* OutPlacementData, int CurrentAllowedReason) { bool isObstructued = _this->IsPointObstructedByWorldGeometry(ArkApi::GetApiUtils().GetWorld(), OutPlacementData->AdjustedLocation, false, false, false, 300); if (isObstructued) { Log::GetLog()->info("Is OBSTRUCTUED"); return -2; } Log::GetLog()->info("Is NOT OBSTRUCTUED"); return APrimalStructure_BPIsAllowedToBuild_original(_this, OutPlacementData, CurrentAllowedReason); } but it always returns false, despite being inside mesh, or in the middle of mesh/world. I also tried to raise the obstruction check radius up to 30k but it still had the same output.
9:03 PM
I want to prevent certain structures being placed when obstructed if the server collision is disabled
Avatar
AaronBasques 7/29/2020 9:53 PM
it could be that, if the server collision is disabled it always returns false regardless. try with collision enabled to rule it out
9:53 PM
@Pelayori
Avatar
Yeah the thing is I wanted to make only some structures to have collision. I know it's possible but I have to figure out how
Avatar
take a look at the NoCollision plugin by michidu
10:08 PM
Server Plugins for ARK: Server API. Contribute to Michidu/Ark-Server-Plugins development by creating an account on GitHub.
👍 1
Avatar
Ohh didn't remember about that! Tytyty!
Avatar
@Pelayori you could invert the logic
10:15 PM
Keep the collision check on
10:15 PM
And skip it for some structures
Avatar
Wouldn't that make the client show as obstructed and not being able to place? Already thought about that but didn't do it because of that
Avatar
Good question
10:29 PM
Try it
Avatar
Yeah it does, client didn't care of the server returning 1, it couldn't be built
Avatar
Hi kinda a noob question but for Kals Crosschat to know what permissions group each player has been added to do i need to set it up so that it connects to the same database as the permissions plugin or is it a seperate database ?
Avatar
I got a question about the Permissions Plugin that comes with ArkServerApi, i cannot seem to add players to a group. After restarting the server pc finally another error popup up: 08/01/20 18:36 [Permission][error] (d:\programs\ark\plugins\permissions\permissions\private\hooks.cpp Permissions::Hooks::Hook_AShooterGameMode_HandleNewPlayer) Couldn't add player I dont have a d: storage so i have no idea where this is coming from, any suggestions? (edited)
Avatar
heya i need help with how to install plugins and use them on my ark single player server if you might’ve known how? I play on steam btw.
Avatar
Did anyone try to prevent grappling? I know about AShooterCharacter::AllowGrappling_Implementation() hook, but it doesn't give me the player who tries to grapple someone. I need to have targeting team fields of both the players. APrimalCharacter::OnBeginDrag(...) hook called only for dead bodies, not for alive players/dinos. I tried AShooterCharacter::UpdateGrapHook() hook, but it always shows no grappled/dragged characters currently (it works for corpses and dinos though) Probably I have to use APrimalWeaponGrapplingHook somehow, but it isn't in API
Avatar
RunningBearYarrr 8/7/2020 1:00 PM
Got a new problem. Here's the file attatched. Whenever i /buy ArgyTalon or anything else in the /shop list, it says Recieved item, but there's nothing in inventory (empty) and I have multiple items in the starter kit but when I bought it I only recieved 2 And if anyone is on Ark, you can test it yourself on my servers, I'm running that file right now. HighTecRedneck is the servers name, valg, crystal and ragnarok. I'm willing to donate for a file fix, I just want to get it working properly lol. I used JSON Editor Online to edit the config.
Avatar
@RunningBearYarrr your blueprint paths in the starter kit are incorrect
1:09 PM
{ "Quality": 100, "ForceBlueprint": false, "Amount": 1, "Blueprint": "\"Blueprint'/Game/PrimalEarth/CoreBlueprints/Weapons/PrimalItem_WeaponPike.PrimalItem_WeaponPike'\"" },
1:09 PM
the \'s are messing it up (edited)
Avatar
"Blueprint": "Blueprint'/Game/PrimalEarth/CoreBlueprints/Weapons/PrimalItem_WeaponPike.PrimalItem_WeaponPike'" This would be the proper format for that line.
Avatar
RunningBearYarrr 8/7/2020 1:23 PM
Thank you both
GOGCHECK 1
Avatar
NukeDragon 8/9/2020 8:58 PM
Hello everyone, I have been working on updating Vote Rewards from OwnProx due to the changes to TopArkServers.com. Unfortunately, the source code is a little older and I am not really a programmer (Electrical Engineering degree, but not a programmer). I cannot see what is wrong with what I have done. Trackyservers works and I don't use bestserver, so I am unsure if that part of the code is good or not. The other 2 do not appear to be configured correctly to return the needed response to allow for a reward to be given. Everything else works, as far as I can tell. Can anyone share some insight here? Any help would be greatly appreciated. Thanks.
Avatar
AaronBasques 8/10/2020 7:11 PM
@NukeDragon HttpVoteCallBack is only handling a basic response that expects a single integer, TopArkServers API now returns a JSON response that requires parsing.
Avatar
Okay, thanks for that information. That doesn't seem clear to me when I look at their API page. I'll look into that though. Is that also what is going on with Ark-servers then?
Avatar
AaronBasques 8/10/2020 7:35 PM
ark-servers.net seems ok, just a single integer is still returned
Avatar
Hmm, I wonder why that one isn't working in my code then.
Avatar
AaronBasques 8/10/2020 7:45 PM
double check your API keys, use Postman to check your API access https://www.postman.com/
Avatar
Okay, will do thanks. I'll probably be back with more questions.
Avatar
So, I have been trying to use Fiddler to see the response for TopArkServer with a manual entry of the ServerID and SteamID. I am using the GET function. Doing this gives me a 404 Not Found code and no data. When I try with the other servers, I do see a response and can indeed confirm that it returns a single value. So, my question is how do I actually see the JSON so that I can begin to code to parse it? Thanks again.
Avatar
AaronBasques 8/11/2020 12:47 AM
so you're using like? http://toparkservers.com/api/rewards/<API_KEY>/<STEAM_ID>/status http://toparkservers.com/api/rewards/<API_KEY>/<STEAM_ID>/claim you should see a response like { "username": "Bonjela", "votetype": "like", "rewardvalue": "2", "reason": "The player has already claimed their reward or they have not voted in the last 12 hours." }
Avatar
Thanks, that is probably the issue. I have it that way in the code, but was testing what is actually on their API page in Fiddler.
12:56 AM
Yep, definitely that. Thanks.
Avatar
AaronBasques 8/11/2020 12:57 AM
The actual API Documentation is https://toparkservers.com/api-docs
12:59 AM
that url in your screenshot is discontinued
Avatar
Yeah, I have both and was looking at the wrong one.
Avatar
Is there an exception that can be caught or something when using external Libs if they are not available? Lets say i'm using the Permissions plugin but I unloaded it and another plugin calls a function from the Permission plugin the whole server just crashes. How would I go about ignoring this type of crash and instead just log a message about it at the very least?
3:32 PM
catch (...) works?
Avatar
no, you can't do it with c++ exceptions. You can try SEH, but it's better not to access invalid memory..
3:37 PM
@substitute not sure if overloading new would not break existing code..
Avatar
So, updating a plugin that is used by other plugins requires unloading them all to prevent a crash then?
Avatar
Was hoping for a graceful solution where I detected an external call fails. Then to return a default value in place of the external call and just log the failure. (edited)
Avatar
there might be a way, just other plugins should support it (basically check if plugin is loaded before making call) (edited)
3:49 PM
or don't unload old plugin and just redirect calls (that should be supported inside plugin) (edited)
3:55 PM
you want to build such plugin or just safely making calls to other ones?
Avatar
I'm building callable functions like the scenario above but I don't care if call fails I just want the server to no crash. The call failing isn't so important as it will always be a temporary issue while unloading/loading the plugin that has the exposed lib calls.
3:58 PM
Much harder to explain to users that you must Unload plugin X before you Update plugin Y.
3:59 PM
Since X relies on a call to Y
Avatar
or just restart :) so if you are building a plugin and other plugins should safely use it, i can think only if idea of not unloading old version. Or reload it fast and hope for the best heh
Avatar
lol ok
Avatar
actually if you use GetProcAddress in API funcs you should be able to do it..
Avatar
just thought about it if dll not loaded it will return 0
4:08 PM
so won't crash and you can return any other value instead
Avatar
i'm looking up how to call that
Avatar
just will be a bit slower
Avatar
PluginManager::IsPluginLoaded
4:22 PM
Wouldn't this accomplish the same thing?
4:23 PM
I don't think it is an exposed public method though.
Avatar
maybe, try can replace with GetModuleHandle
Avatar
HMODULE api = GetModuleHandle(NULL); using pfnIsPluginLoaded = bool(__fastcall*)(const std::string& plugin_name); const auto isLoaded = reinterpret_cast<pfnIsPluginLoaded>(GetProcAddress(api, "PluginManager::IsPluginLoaded")); if (isLoaded != nullptr) { loaded = isLoaded("PluginNameHere"); }
Avatar
i meant using GetModuleHandle you can check if some plugin is loaded 🙂 (edited)
4:46 PM
GetProcAddress can get only exported functions
Avatar
So I need full path to use GetModuleHandle() right?
Avatar
nope, example GetModuleHandleA("ntdll.dll")
4:48 PM
just pass dll name
4:49 PM
well was my code above at least close to working 🙂
4:49 PM
if it was an exported function
Avatar
almost, just c++ names are mangled, so it won't be just 'PluginManager::IsPluginLoaded'
4:50 PM
but probably you won't even need to use GetProcAddress in this case
Avatar
If return from GetModuleHandleA is null its not loaded
Avatar
yes just this function (where you gonna do check) should be local to every plugin
4:52 PM
not imported
4:53 PM
so you can wrap imported functions or just use GetProcAddress instead
Avatar
auto loaded = GetModuleHandleA("Plugin.dll"); if(loaded) Flag = Plugin::Function(Params); else Log::GetLog()->info("Plugin Unloaded?");
Avatar
it's correct
Avatar
Thanks for the help.
4:57 PM
If this turns out too slow I will build a cached object and only check every so often for updates using this method.
Avatar
probably it won't be too slow you gonna use getprocaddress also?
Avatar
Would I need to?
Avatar
how you gonna make it? i mean you can't add this check to your plugin
5:01 PM
other way is if you have imported func like this SHOP_API bool CanUseKit(AShooterPlayerController* player_controller, uint64 steam_id, const FString& kit_name); should wrap it
Avatar
I have the call working already and the wrapped code will be in the plugin using the lib
Avatar
good then
Avatar
Once the lib plugin is used it can't seem to be unloaded anyways it seems.
Avatar
if it's not static then no because you will be calling your unloaded plugin
5:38 PM
basically you should do it as ark api functions
Avatar
I have this in my public header #define ARK_API __declspec(dllimport)
5:44 PM
and ARK_API bool MyFunction(int param);
Avatar
check code should NOT be in imported function. Actually, you may be required to use GetProcAddress.. i'm unsure address will be updated correctly otherwise.
5:47 PM
ah, seems delay dll load already uses GetProcAddress internally
5:47 PM
not sure if it caches address however
Avatar
The above code is what I have to expose the functions to other plugins.
Avatar
you need another function which would not have dllimport attribute
5:48 PM
which would call imported one
Avatar
I do that from the Plugin that is using the exposed Function
5:50 PM
which all seems to work fine however once the Exposed Function is used once by another plugin. The plugin with the exposed function won't unload.
Avatar
because you need to do as i wrote
5:51 PM
can you send full file where you define api funcs?
Avatar
sure can I pm you?
Avatar
yeah
Avatar
@Lethal Thanks very much for that GrapplingHook file. How did you dump the fields of structure? I'm newly with IDA, so I know how to explore methods/decompile them, but I don't know how to grab the fields and how to understand the inheritance hiearhies of the ark classes
Avatar
Michidu shared this at some point in the last few months.
11:21 PM
In IDA you can look at the Local Types and find what you are looking for then right click and edit
Avatar
about limit dino plugin
5:52 PM
is that correct ? (edited)
5:52 PM
{ "General": { "MaxAmount": 150, "NotificationDisplayTime": 4, "NotificationScale": 1.3 }, "Dinos": { "Blueprint'/Game/Extinction/Dinos/Gacha/Gacha_Character_BP.Gacha_Character_BP'": { "Name": "Gacha", "Count": 5 },
Avatar
You should use the other discord for support
Avatar
ok sry
Avatar
@Lethal
4:43 AM
🙂
4:44 AM
some progress on dynamically dumping properties from BP structures without needing anything other than the API
4:44 AM
number = offset in the structure
Avatar
@Lethal
5:27 AM
5:27 AM
I can implement a property search-style system
5:27 AM
where you say like FindProperty("name") and it returns a pointer to the UProperty* by name
5:27 AM
it'll be O(n) for the first search (edited)
5:28 AM
but it can cache the result
Avatar
So this will allow finding and changing values at the BP level
Avatar
yes, changing fields
5:28 AM
you'll have to know the type before hand though
5:28 AM
there is no types for like UIntProperty
5:28 AM
but I can write some wrappers
5:28 AM
like ReadInt
5:29 AM
arrays will take some investigation
Avatar
Sounds great so far
Avatar
for (UProperty* Property = data->ClassField()->PropertyLinkField(); Property = Property->PropertyLinkNextField();) { LOG->info(Property->Offset_InternalField()); FName aName; FString aString; FString bString; Property->GetID(&aName); aName.ToString(&aString); LOG->info(aString.ToString()); Property->GetCPPMacroType(&aString, &bString); LOG->info(aString.ToString()); LOG->info(bString.ToString()); aName = static_cast<UObject*>(Property)->NameField(); aName.ToString(&aString); LOG->info(aString.ToString()); }
Avatar
@Lethal I have basic read/write working.
7:29 AM
at least for integers.
Avatar
UProperty* FindProperty(FName name, UObject* object) { for (UProperty* Property = object->ClassField()->PropertyLinkField(); Property = Property->PropertyLinkNextField();) { FName propName = ((UObject*)(Property))->NameField(); if (propName.Compare(&name) == 0) return Property; } return nullptr; } template<typename T> T Get(UProperty* prop, UObject* object) { if (sizeof(T) != prop->ElementSizeField()) throw "Bad Size"; //users can handle this if they so choose. return *((T*)(object + prop->Offset_InternalField())); }
8:38 AM
gonna test these wrappers
8:40 AM
they workin 🙂
8:40 AM
8:40 AM
Avatar
forgot to post, this is for set
10:16 AM
template<typename T> void Set(UProperty* prop, UObject* object, T value) { if (sizeof(T) != prop->ElementSizeField()) throw "Bad Size"; //users can handle this if they so choose. *((T*)(object + prop->Offset_InternalField())) = value; }
10:19 AM
works with advanced properties too. Had no issue reading a TArray of FNames
10:19 AM
@Michidu let me know how you'd want me to add this to the API (I could add Get/Set to UProperty and maybe FindProperty to UObject similar to the FindFunctionChecked is)
Avatar
it sounds great :) maybe combine FindProperty and get/set together? So you would have overload T Get(FName name, UObject* object)
Avatar
my only issue with that is if the property doesn't exist on the object.
6:20 PM
can't return what doesn't exist 🙂
6:20 PM
that's why I'd like to make it similar to the find function where you get the UProperty* and then read the data if it isn't nullptr (edited)
Avatar
bool or throw but yeah, that fine too
Avatar
it would have to be either throw, or bool with the dataout as pointer
6:23 PM
I feel like second isn't intuitive, and first is problematic as you'd want to read/write for variable assignment
6:23 PM
I'd prefer to not litter my code with try {} catch {} everywhere PepeLaugh
Avatar
could also do std::optional
Avatar
anyone plan to do a plugin that backlist some bad words
6:30 PM
?
Avatar
from chat?
7:15 PM
with some kick or ban application
Avatar
wooly has discord integrator which mutes people who use banned words
Avatar
i mean in game
Avatar
yes, it mutes them in game
Avatar
Does anyone know what does this do? _this being APrimalStructure (edited)
Avatar
template<typename T> T Get(UObject* object) { if(!object->StaticClass()->HasProperty(this)) throw std::invalid_argument("Object does not contain this property.") if (sizeof(T) != this->ElementSizeField()) throw std::invalid_argument("Expected size does not match property size.") return *((T*)(object + this->Offset_InternalField())); } template<typename T> void Set(UObject* object, T value) { if (!object->StaticClass()->HasProperty(this)) throw std::invalid_argument("Object does not contain this property.") if (sizeof(T) != this->ElementSizeField()) throw std::invalid_argument("Expected size does not match property size.") *((T*)(object + this->Offset_InternalField())) = value; }
4:54 AM
@Michidu I'm adding it to my PR.
4:54 AM
these two templates will be in the UProperty structure in UE.h
4:54 AM
so you can just take the property->get<T>
Avatar
@Michidu added
Avatar
merged, thank you
Avatar
Anybody there can help me out with permissions tho? Everything is working except actual permissions lol. Roles with * can’t use a single command tho.
Avatar
Has anyone ever tried to to a LineTraceSingle called from UWorld? I keep crashing always. I've tried making FHitResult* allocating memory and without it being a pointer but no luck
Avatar
@Pelayori the function might be broken in API call
5:17 PM
Let me check first in IDA. Some functions literally only exist to crash
5:17 PM
I had a bunch in UProperty that just FLowLevelFatalError
5:17 PM
what is the exact function name?
Avatar
UWorld::LineTraceSingle
Avatar
side note, if it isn't easily fixable (at least right now), you can always use the blueprint versions of line trace with find function
Avatar
this one
5:18 PM
should work
5:19 PM
it just really forwards to RaycastSingle
5:19 PM
how do you allocate your struct?
Avatar
what I mean is, just doing FHitResult res; might not work because this function may expect that memory to already be allocated, which isn't done properly this way
5:19 PM
you may need to use FMemory
5:20 PM
When I was making my UProperty stuff, some of the functions that expected pointers for results required them to already be allocated by FMemory
5:20 PM
try like this
5:20 PM
static_cast<FItemNetInfo*>(FMemory::Malloc(sizeof(FItemNetInfo)))
Avatar
I tried like this, which works once. But I try to do another trace and it fails to allocate memory
Avatar
did you realloc?
Avatar
I allocate it when I declare the pointer, but after the function ends shouldn't it free?
Avatar
it depends
5:21 PM
are you using FMemory version?
5:21 PM
UE4 has a smart pointer system type thing. Only way to be sure it isn't free would be to check with debugger
5:22 PM
you said it works find when you alloc once and then it crashes
5:22 PM
so maybe it could be the issue.
Avatar
when realloc or ?
Avatar
That's the second try
Avatar
do you know how to attach a debugger?
Avatar
Not really, but I'll google it
Avatar
you have Visual Studio?
Avatar
Yes
5:23 PM
5:23 PM
when it crash
5:23 PM
it should show stack trace (and other stuff) in Visual Studio
Avatar
I have the test server on other machine, I will run a dedi in my pc
Avatar
Can I free the pointer somehow? I saw Fmemory has a Free() function
5:33 PM
(server downloading)
Avatar
you can try that
5:34 PM
but realloc should work just fine
Avatar
But what to realloc to, if the pointer is being declared?
5:38 PM
realloc takes a pointer
Avatar
But I can't use the variable I am declaring, at least didn't let me. It is a local variable inside a function
5:38 PM
Or should I Malloc, then Realloc? (edited)
Avatar
How are you calling this?
5:54 PM
From a function or ?
Avatar
Yes, it's a command that does a trace
Avatar
@substitute
6:50 PM
That is the second try that fails to allocate
Avatar
hm
Avatar
Which are the trace functions used in BP?
Avatar
would have to check devkit
7:24 PM
I'll see if I can't solve the line trace from C++ though
Avatar
I've had 2 crashes so far with the same function: -Failed to allocate memory after a first succesfull attempt, and then crash. -Crashed on TSet container trying to add something after the trace was succesful.
7:28 PM
I know it is LineTraceByChannel in dev kit, but I can't seem to find it in UKismetSystemLibrary. I think that is not in this UE4 version but in the newer ones and wildcard ported it into devkit
7:28 PM
What does VTrace do vs a normal LineTrace?
Avatar
LineTraceByChannel
7:33 PM
in devkit
7:33 PM
check which object it exist on
7:33 PM
then you can find that object reference and use ->FindFunction
7:33 PM
the parameters for the UFunction are going to be a pointer to a structure
7:33 PM
the structure will be the blueprint function parameters
7:34 PM
e.g. if it takes bool a, int b you would make struct parameters { bool a int b } (edited)
7:34 PM
then you pass all of that into object->processevent(function , parameters pointer)
7:35 PM
here's a worked out example
7:35 PM
UFunction* bpFunction = data->FindFunctionChecked(FName(L"DefeatedBoss", EFindName::FNAME_Find, false)); DefeatedBoss_Params params; params.boss = nullptr; params.DifficultyIndex = difficulty; params.tagOverride = FName(boss.c_str(), EFindName::FNAME_Add, false); params.PC = playerController; data->ProcessEvent(bpFunction, &params);
Avatar
I know in newer ue4 versions it's in Kismet Sys library, but I don't know where did wildcard port it
Avatar
data is UPrimalPlayerData*
7:35 PM
DefeatedBoss_Params is struct DefeatedBoss_Params { APrimalDinoCharacter* boss; int DifficultyIndex; FName tagOverride; AShooterPlayerController* PC; };
Avatar
I will have to mess around with bp calls yeah, thank you 😄
7:36 PM
Can I get return value from those calls?
Avatar
yes, it would be in the struct
7:36 PM
the last members I believe are the return values
Avatar
Cool 😃
Avatar
e.g. if defeatedboss returned a bool like success it would be like struct DefeatedBoss_Params { APrimalDinoCharacter* boss; int DifficultyIndex; FName tagOverride; AShooterPlayerController* PC; bool success; };
7:37 PM
if I am remembering correctly.
7:38 PM
I did write a template function to generate ^ those automatically without needing to define structures. (It copies the parameters into a single block of memory as if it was a structure) but I'm currently having an issue with some advanced types like FName not working properly
7:38 PM
Contribute to SubstituteR/ParamaterPack development by creating an account on GitHub.
Avatar
Well, it isn't much of a hassle to do them if you are in front of devkit
Avatar
yeah, the point was to avoid having to write a structure for each bp call 😄
7:39 PM
it's a work in progress
Avatar
Ohh, yeah. Good work though
Avatar
like i use it in that test program like
7:39 PM
Packed block = packParameters(2, 65, 10., 1337, 1., nullptr, 0, 0); ((void(*)(void*))test)(block.parameters); //just to call by a function pointer
Avatar
I've tried now UVictoryCore::VTraceSingleBP and it crashed at TSet.Add with this call stack, it's the same I got with UWorld::LineTraceSingle
7:40 PM
7:41 PM
the bool* bIsAlreadyInSetPtr says unknown memory or something like that (edited)
Avatar
hm
7:42 PM
interesting
7:42 PM
well bp one should work
7:43 PM
by bp
7:43 PM
I mean from find function
7:43 PM
not the native bp wrapper
7:43 PM
but the actual bp function
Avatar
The LineTraceByChannel I believe it's in UWorld too, cause in UE4 forums, they point that newer ue4 users must change LineTraceSingle to the channel trace one
7:44 PM
Yeah, I was just trying
Avatar
I can check around some functions in IDA to also see what line trace they use in their own code
7:44 PM
part of the problem of them making so many engine changes is some functions are redundant or broken 😄
7:44 PM
there is like 5 world to screen functions in the game
7:44 PM
KEKW
7:45 PM
I decompiled all ida functions into a .c file, it tooks hours and I got a 1mio code lines file lol
Avatar
I ran a dll to dump an SDK for the game (it just uses find function and stuff)
7:45 PM
and it generated like that many lines too
7:46 PM
it was so big, it can't compile into a single dll
7:46 PM
over 4gb
Avatar
mine is 630MB
7:46 PM
Yes, LineTraceByChannel is in UWorld
7:49 PM
Hmm, now that I am thinking
7:50 PM
The original LineTraceSingle function, got overriden by the LineTraceByChannel, as this is actually used in the dev kit. Could this be an issue?
Avatar
not sure
8:25 PM
8:25 PM
Is that right?
8:26 PM
or should the debugTrace be TEnumAsByte<EDrawDebugTrace::Type> debugTrace? (edited)
Avatar
I think that is right
Avatar
Seems LineTraceByChannel isn't in UWorld :/
Avatar
It is in UKismetSystemLibrary, how can I get a reference to that?
Avatar
I'll see if there is a way in the api already
10:22 PM
10:22 PM
it 100% exists
10:22 PM
10:23 PM
at worst case, you can find it from PDB same way the API does for functions you define hooks for.
10:23 PM
10:23 PM
mother fucker that better not be what I think that is
10:23 PM
KEKW
Avatar
Oops, xD
Avatar
it's fine
10:24 PM
10:24 PM
no Get methods
10:24 PM
hm
Avatar
I know that KismetSystemLib exists in api, but how can I get an object ref to it? I looked up ida and it doesn't have a findfunction or something
Avatar
it should be static
10:25 PM
10:25 PM
oh
10:25 PM
of course that exists too (edited)
10:25 PM
wonder the performance between mine and that
Avatar
There is no findfunctionchecked in kismet lib :/ (edited)
10:27 PM
KEKW (edited)
10:27 PM
btw
10:27 PM
UKismetSystemLibrary should be a child of UObject
10:27 PM
API might have that wrong.
10:28 PM
Avatar
Then I can make UKistmetSystemLib a child of UObject?
Avatar
what are you using to get UKistmetSystemLib ?
Avatar
And those deprecated funcs aren't in api
Avatar
adding them isn't hard
10:29 PM
however, what are you using to get UKistmetSystemLib ?
Avatar
like this (edited)
10:30 PM
I have to try that func
Avatar
oh, it's in the global namespace
10:30 PM
UKismetSystemLibrary
10:30 PM
didn't realize
10:35 PM
@Pelayori
10:35 PM
you might be able to just use any UObject for find function
10:35 PM
I believe it expects a reference to the object itself
10:36 PM
nvm
Avatar
i can do like this in the dev kit
Avatar
well
10:37 PM
then maybe use a static construct object
10:37 PM
using the UClass
10:38 PM
ah, it again doesn't have UClass available
10:38 PM
since it is not listed as an object.
10:38 PM
however (edited)
10:38 PM
if you make it UObject
10:38 PM
you can use UObject::StaticClass() probably
10:39 PM
ah, maybe not
10:39 PM
10:39 PM
not in IDA
Avatar
I am still to try kismet lib traces, but seems like a no no
Avatar
You can try VTraceSingleBP maybe?
10:59 PM
in VictoryCore
10:59 PM
UVictoryCore::VTraceSingleBP
Avatar
Already tried, and also crash
Avatar
strange
11:00 PM
in my own single player injected stuff
11:00 PM
if (GetVictoryCore().VTraceSingleBP(GetUWorld(), PlayerLoc, ActorLoc, sdk::ECollisionChannel::ECC_GameTraceChannel3, 0, "None", false, GetShooterCharacter(), 0, &HitResult)) { continue; }
11:00 PM
doesn't crash
11:00 PM
(this isn't API code)
11:00 PM
so maybe let me see
Avatar
Some trace funcs work for the first time, and the second time crashes
11:01 PM
the same exact thing (edited)
Avatar
ShooterGame.VictoryCore.VTraceSingleBP is the function name in BP
Avatar
Hmm, then it's possible that line trace by channel is something similar?
11:04 PM
Something like ShooterGame.KismetSystemLibrary.LineTraceByChannel
11:10 PM
To find those functions, would be just getting a default object (to get UObject) and then find function?
Avatar
maybe, though with the uobject itself just the last part of the name should be needed
11:12 PM
like LineTraceByChannel
Avatar
I will try to find it in UObject (edited)
Avatar
I tried getting the CDO but the thing is it gets the base object of whatever I get the cdo from, for example i got the cdo of a structure and it tried to find function in the structure
Avatar
This now crashes with : Ran out of memory allocating 18446744058824253440 bytes with alignment 0 (edited)
Avatar
@substitute I've tried UVictoryCore::VTraceMulti and this one doesn't crash.
3:20 PM
But I can't make single line traces to work. I guess I'll stick with this (edited)
Avatar
🐨Dream Doctor🦘 8/19/2020 3:22 AM
Does anyone have any examples of how they do exception handling in plugins?
Avatar
@🐨Dream Doctor🦘
3:23 AM
you mean like try / catch ?
3:24 AM
some types of exceptions can't be handled
Avatar
🐨Dream Doctor🦘 8/19/2020 3:25 AM
Yeah, I'm having an issue with a really simple hook on AShooterCharacter.Die that occasionally crashes the server. I tried placing it in a try / catch but it doesn't help.
Avatar
here's an example: This is a command that expects the arg to be an int
3:26 AM
TArray<FString> strings; command->ParseIntoArray(strings, {L" "}, true); if (strings.Num() != 2) return; //invalid args int value = 0; try { value = std::atoi(strings[1].ToString().c_str()); } catch (std::exception what) { return; /* could not parse */}
3:26 AM
@🐨Dream Doctor🦘 are you doing null checking?
3:26 AM
if the pointer is null, it will crash when trying to operate on it.
3:26 AM
you can check in one of two ways if (ptr == nullptr) //or if (!ptr)
3:27 AM
you would want to exit the function if you needed to operate on this pointer and it was null
3:27 AM
something like this
3:27 AM
AShooterCharacter* myPawn = static_cast<AShooterCharacter*>(playerController->PawnField()); if (!myPawn) return;
Avatar
🐨Dream Doctor🦘 8/19/2020 3:27 AM
Thanks @substitute . That's extremely helpful 🙂
Avatar
@Pelayori Did you get a working line trace? It just seems to crash for me regardless of what call I used. world->LineTraceMulti world->LineTraceSingle UVictoryCore::VTraceSingleBP UKismetSystemLibrary::LineTraceSingleForObjects
Avatar
I got UKismetSystemLibrary one to work, but it returned stupid hits. I asked wooly and he told me he uses one from UVictoryCore. I am digging into it but no luck yet
2:54 PM
VTraceSingleBP is what I'm trying now, but if it hits something server closes
2:54 PM
I'm going to attach a debugger
Avatar
Essentially what is happening for me as well.
2:57 PM
UVictoryCore::MultiLinePenetractionTraceByChannel I haven't tried yet
Avatar
I saw that one but the results are given in FPenetration..... and that didn't seem suitable from my point of view (edited)
2:59 PM
Oh, that one was that FPenetrationTraceHit isn't defined in api
2:59 PM
And I couldn't find it in IDA
Avatar
I'm just looking to check if a Turret is meshed at all and block it from being placed.
Avatar
Kind of what I am trying to do too
Avatar
Well, I will post here if I figure it out.
Avatar
I've been with this 3 days straight 🤣
Avatar
I just hate restarting my server when it crashes lol
Avatar
This is where it fails, more trace functions also failed at NativeCall
Avatar
Ya, i'm seeing the same result.
Avatar
I have a version that doesn't crash using UVictoryCore::VTraceIgnoreFoliage but it doesn't detect a hit either. So my collision channel or something else is wrong I think?
Avatar
Try with ECC_Visibility (edited)
Avatar
@Pelayori TArray<FHitResult>* aHit = static_cast<TArray<FHitResult>*>(FMemory::Malloc(0x200)); RtlSecureZeroMemory(aHit, 0x200); FHitResult* hit = static_cast<FHitResult*>(FMemory::Malloc(0x200)); RtlSecureZeroMemory(hit, 0x200); FCollisionQueryParams* Params = static_cast<FCollisionQueryParams*>(FMemory::Malloc(0x200)); RtlSecureZeroMemory(Params, 0x200); Params->bReturnPhysicalMaterial = 0; Params->bTraceComplex = 0; FCollisionResponseParams* OutParams = static_cast<FCollisionResponseParams*>(FMemory::Malloc(0x200)); RtlSecureZeroMemory(OutParams, 0x200); I'm allocating memory like this so it doesn't crash. then doing this after i'm done with them FMemory::Free(hit); FMemory::Free(Params); FMemory::Free(OutParams);
5:27 PM
Still doesn't detect any hits but also doesn't crash
Avatar
Oh, I was only allocating memory for HitResult
Avatar
bool foundHit = world->LineTraceSingle(hit, &AtLocation, &End, ECC_Visibility, Params, OutParams, 0, 0.0f);
Avatar
Anyways, I found a dirty way by declaring a global FHitResult* and securing memory on init so it doesn't even attempt to free it, instead it reuses the memory when doing a new trace. But I'm not really happy with this, I'm searching for other ways
Avatar
What I posted above works fine i'm just not setting location or channel properly I guess.
Avatar
You can use UVictoryCore::MulticastDrawDebugLine
5:30 PM
To see trace line
5:31 PM
About channel, ECC_Visibility should get all visible actors, maybe meshes but you can try other channels. These ones are declared in the DefaultEngine.ini of Ark:
5:31 PM
5:32 PM
But for example, I saw that Structure Limits uses GetAimedActor in channel 12 which is not there and gets everything in sight
Avatar
ECC_GameTraceChannel27 is used for the structure check that doesn't seem to work also.
Avatar
Channel 27 is for terrain trace, maybe try channel 13, or like SL channel 12
5:39 PM
I'll be doing some tests too
Avatar
I have a semi working version it seems
Avatar
Not sure why these 2 were allowed completely under the mesh.
Avatar
hmm
Avatar
Above ground seems pretty solid though
7:58 PM
UVictoryCore::VTraceSphereBP seems more reliable than UVictoryCore::VTraceSingleBP
Avatar
I don't really know how is a sphere trace, never used it anywhere
Avatar
basically call the exact same way
Avatar
So they do the same? I've been testing VTraceSingleBP and it's been pretty reliable for me
8:02 PM
When hitting mesh, it returns StaticMeshActor
Avatar
Those under the mesh turrets don't get hits for some reason.
Avatar
A single trace will stop once it hits something. So I believe it hits the mesh and stops there
8:20 PM
You might want to use a multi trace, and if it hits mesh and a structure do some check to see if it's under the mesh
Avatar
What are you using for "CollisionGroups" for that call?
8:22 PM
Basically the line trace doesn't get hits is what i'm seeing
8:23 PM
oh...if you set that to 0 it doesn't detect any hits I guess
8:23 PM
lol
Avatar
I have 0 for collision groups
8:29 PM
if I set to 1 Line Trace blocks everything
Avatar
this is returned using GetBlueprint on the actor
Avatar
But it is detecting ShooterGame.NPCZoneVolume
Avatar
What do you have for trace tag? I have this
8:30 PM
ç
Avatar
FName(EName::NAME_None)
Avatar
It doesn't hit npc zone, which I had it sometimes trought testing with other funcs (edited)
Avatar
UVictoryCore::VTraceSingleBP(world, hit, &AtLocation, &End, ECollisionChannel::ECC_WorldStatic, CollisionGroups, FName(L"None", EFindName::FNAME_Add,false), true, nullptr);
8:34 PM
i'm testing for 5 different channels still same result of not returning true
8:35 PM
ECC_GameTraceChannel27 ECC_GameTraceChannel10 ECC_GameTraceChannel12 ECC_Visibility ECC_WorldStatic
8:36 PM
I'm just adding 20k to the Z value from AtLocation.Z for End.Z
Avatar
It works for me with ECC_Visibility
Avatar
If you go in ghost and full mesh a turret does it work? (edited)
8:51 PM
If I try and place something sticking into a the side of terrain I get this
8:52 PM
but completely meshed turrets return this
8:54 PM
Regardless I still never get a Line hit for some reason.
Avatar
I'll tell you when I test it, not on ark atm
Avatar
🐨Dream Doctor🦘 8/21/2020 5:12 PM
I don't know if it matters, but line traces done in the dev kit are also extremely unreliable and weird. Especially when it comes to dealing with mesh hits.
Avatar
Well i'm just confused as Pelayori says it was working but I could only get the Sphere trace hits to register for me.
5:14 PM
Was never able to see a Line hit at all.
Avatar
VTraceSingleBP is working extremely well for me, not hits missed on all test I've done. About you asked me yest Lethal, inside the mesh it just detects evrything as if it was outside
5:15 PM
I'm using ECC_Visibility for collision channel
Avatar
I'm using that as well for both Line and Sphere.
Avatar
What I am struggling now is using .Vector() from a FRotator, it gives me unresolved externals
5:17 PM
I tried doing a NativeCall and it returns always the same vector
Avatar
isn't FRotator just a vector?
Avatar
It has different components, like vector has x y z and rotator has pitch, yaw and roll
5:18 PM
But converting it into a vector doesn't seem to work
Avatar
Hmm, did you include arkapilib?
Avatar
ah ok
Avatar
I did
5:19 PM
If not nothing would compile
Avatar
Can you see where the to vector is defined
5:20 PM
Control click it
Avatar
Looks like it’s not defined
5:21 PM
Or
5:21 PM
It’s in a cpp file
Avatar
But in FVector the .ToString() is like that too
5:21 PM
And it works
Avatar
Then it could be in a cpp file
5:22 PM
And vector isn’t defined in the cpp file
Avatar
I tried doing a Native call but it returns always the same vector, which is not even correct
5:22 PM
Like NativeCall<FVector>(this, "FRotator.Vector")
Avatar
What did it give you
5:25 PM
It should be xyz normalized
Avatar
It did give me a xyz but wrong value, and always the same no matter what rotator I gave it
5:26 PM
Something like 2.10e-8
5:26 PM
A very low number in one of the components (edited)
Avatar
So you might not like this
5:26 PM
But you can check the ue4 source
5:26 PM
And implement it yourself
5:26 PM
If it is bugging out
5:27 PM
I’ve done that before
Avatar
I am taking a look where the rotator cpp file is in the source
Avatar
/Engine/Source/Runtime/Core/Private/Math/UnrealMath.cpp
5:27 PM
That’s the file path in the engine
Avatar
I was searching fro Rotator.cpp xD
Avatar
Always check the ue4 docs
Avatar
true
5:28 PM
It will say where (edited)
5:28 PM
Of course you could probably call the blueprint version of vector
5:28 PM
It would work too
Avatar
With find function
Avatar
FRotationMatrix is not defined I guess (edited)
Avatar
That’s an oof
Avatar
ECollisionChannel::ECC_Visibility is what I pass in for CollisionType
Avatar
Collision groups what is the value? I have 0 for mine, dunno if that matters
5:40 PM
Also not complex trace
Avatar
hmm
Avatar
I tried complex true and false
5:40 PM
I will double check that to be 100% sure though
Avatar
@substitute How can I call vector bp version?
5:44 PM
I mean where should I look
5:46 PM
in IDA, FRotator::Vector is like this
5:46 PM
Which is different from what API has
Avatar
With complex off I do get some line hits only above terrain though. If the turret is fully under the mesh it does not seem to get hits.
Avatar
If it's fully undermesh it detects the same as if I was outside
Avatar
Oh, okay I got it now
5:49 PM
Hmm
5:49 PM
Well, if it doesn't hit the turret it means it is undermesh
Avatar
Now, it does get a hit if it hits a rock or something else above it on the terrain that is considered Foliage.
5:52 PM
but the generic line trace like this gets hits in caves also at least with the length i'm using on the End Vector
Avatar
@Pelayori
5:52 PM
bp version won't be listed in IDA
5:52 PM
1 sec
Avatar
I mean, I will try doing a different native call, like this: FVector* Vector(FVector* result) { return NativeCall<FVector*, FVector*>(this, "FRotator.Vector", result); }
Avatar
yes, you should be using the pointer result
Avatar
Let's attach a debugger
Avatar
btw are you just trying to get the forwards?
5:56 PM
KismetMath has a forwards from Rotator
Avatar
Yup, but the get forward vector always return a straight line in front of the player despite the player looking up or down
5:56 PM
oh
5:56 PM
Well Api only has kismet sys
Avatar
you can always try FindObject<UClass>
5:58 PM
there is also StaticFindObject
Avatar
with the new native call
Avatar
add a native call for FindObject
6:00 PM
leave outer as null
6:00 PM
put Class Engine.KismetMathLibrary as name
6:00 PM
and null for exact class
6:01 PM
UObject *__fastcall FindObject<UClass>(UObject *Outer, const wchar_t *Name, UClass **ExactClass, void (__fastcall *a4)()) { UObject *v4; // rsi UClass *v5; // rcx char v6; // bl const wchar_t *v7; // rdi v4 = Outer; v5 = (UClass *)ClassToLookFor; v6 = (char)ExactClass; v7 = Name; if ( !ClassToLookFor ) { GetPrivateStaticClassBody<UClass>(L"/Script/CoreUObject", &word_143CBCDEA, ExactClass, a4); v5 = (UClass *)ClassToLookFor; } return StaticFindObject(v5, v4, v7, v6); }
6:01 PM
let me know if it finds it
6:01 PM
this is a global function
6:02 PM
so Global.FindObject should be the native call I think (edited)
Avatar
Gotcha
Avatar
Like this?
Avatar
yeah try that
6:18 PM
i've got some good test code
6:18 PM
void* donk = packParameters(0, params.tagOverride).parameters; FString test; reinterpret_cast<FName*>(donk)->ToString(&test); LOG->info(test.ToString());
6:34 PM
@substitute
6:34 PM
6:34 PM
It's already defined
6:34 PM
The static construct
Avatar
yeah you just need FindObject
Avatar
Doesn't work
7:02 PM
I'll just stick to what I was doing earlier
Avatar
@Michidu
7:41 PM
7:41 PM
got it working
7:41 PM
for generating structures
7:41 PM
even with FName
7:41 PM
it needed to be a pointer, I guess a class on a structure is stored internally as a pointer
7:41 PM
I also fixed some alignment issue, and fixed issue with computing total size with alignment
7:42 PM
before a 32 byte structure was computing to 28 bytes (and still copying 32 bytes) which would lead to buffer overflow
Avatar
Anyone looked at specifying a load order for plugins? If 2 plugins that modify the same hook that returns a BOOL for instance Plugin A returns "true" and Plugin B returns "false" the hook will always return "false" because Plugin B is executed last always because plugins are loaded alphabetically and processed in order it seems.
11:14 PM
Another way to think about is Priority execution.
Avatar
I have this happen in my plugin where StructureLimits hooks is allowed to build and so does my plugin, and SL overrides it I believe because it's the first one loaded (edited)
Avatar
Yes, ran into the same problem.
Avatar
I ended up checking if SL was loaded, and if it is send a critical log like "SL overrides this feature, it won't work"
11:16 PM
I have planned look into it and see what can I do
Avatar
PvP+ is loaded before but if I change the name to be after S in the plugin list it doesn't cause the issue.
Avatar
My plugin VanillaModifier starts with V, it is loaded after server has inited fully and it still happens
Avatar
(At least when I tested it a few weeks ago)
Avatar
I basically put a "z" on front of the DLL and magically the issue went away.
11:18 PM
Could have been a coincidence I guess.
Avatar
I thought the first one to hook it won, but now I'm not sure
11:20 PM
so it is a bit more complicated
11:20 PM
So load order does affect sort of
11:21 PM
However, whichever plugin is loaded last gets priority. So unloading/loading a plugin puts it at the back of the list with last say on the hook.
11:23 PM
We would need some sort of flag or setting to specify plugin execution order to resolve this I think.
Avatar
Hmm
11:25 PM
You could modify the api itself and add a check at the sethook maybe? Just a thought
Avatar
I think this would need to be something added to the API config.json perhaps so it can control the execution order because it will change based on the server owners needs.
Avatar
hook_vector.push_back(std::make_shared<Hook>(new_target, detour, original)); API does this when setting a hook
11:41 PM
Unfortunately with vectors inserting on the front is not as efficient as push_back/emplace_back because it shifts all the elements otherwise.
Avatar
May not really matter with such a small amount of entries though for a hook. So, I guess the change could be as simple as whether a plugins hook is inserted on the front or back of the list to give one priority over another.
Avatar
@Lethal I now have a terse solution to calling blueprint functions that don't have a return value.
5:43 AM
ExecBP(UObjectRefHere, L"function", 5);
5:44 AM
I'm currently working on one that will return an object (with a smart pointer for the internal data) that you can easily get the return types from.
5:44 AM
template<typename ...Rs, typename ...Ts> void* faf(Ts&&... args) { Packed data = packParameters(sizeof...(Rs), std::forward<Ts>(args)...); //std::unique_ptr<void> returnData = std::unique_ptr<void> } template<typename ...Ts> void ExecBP(UObject* object, std::wstring name, Ts&&... args) { Packed data = packParameters(0, std::forward<Ts>(args)...); if (object) { UFunction* bpFunction = object->FindFunctionChecked(FName(name.c_str(), EFindName::FNAME_Find, false)); if (bpFunction) object->ProcessEvent(bpFunction, data.parameters); } free(data.parameters); } void doof() { ExecBP(nullptr, L"function", 5); faf<int, bool>(12.f, 4, nullptr); }
5:44 AM
faf is my work in progress test for that
5:44 AM
you would supply the return types in <> and the args in ()
5:46 AM
but yea, much easier to interface with
5:46 AM
void DefeatBoss(std::wstring boss, int difficulty, AShooterPlayerController* playerController) { UPrimalPlayerData* data = (static_cast<AShooterCharacter*>(playerController->PawnField()))->GetPlayerData(); ExecBP(data, L"DefeatedBoss", nullptr, difficulty, FName(boss.c_str(), EFindName::FNAME_Add, false), playerController); }
5:46 AM
should work
5:47 AM
5:47 AM
I'll let you know how it goes 😄
Avatar
damn, crash using the ExecBP wrapper, let me attach debugger 😓
Avatar
crash was a nothing burger, I had commented out a line I didn't mean to, everything is good. (edited)
Avatar
@Lethal
7:54 AM
7:54 AM
return values work now too 🙂
7:54 AM
this easy to use
7:54 AM
auto res = ExecBP<FVector>(playerController, L"BPCheckCanDinoSpawnFromLocation", APrimalDinoCharacter::StaticClass(), FVector(69,69,69)); LOG->info("Returned data {0}", std::get<0>(res).ToString().ToString());
7:54 AM
where ExecBP<return values>(args)
7:54 AM
it returns a tuple of the return types.
7:55 AM
gonna try a few other functions for completeness
Avatar
@Lethal
7:00 PM
got it workin
7:00 PM
I adjusted it to return an optional since users can pass invalid function names
7:01 PM
there's 3 versions of ExecBP
7:01 PM
execute without any return value
7:01 PM
execute with a single return value (returns optional<T>)
7:01 PM
execute with N return values (returns optional<tuple<Ts>>)
7:01 PM
auto player = (static_cast<AShooterCharacter*>(playerController->PawnField())); auto result = ExecBP<int>(player, L"GetTheNumChibiLevelUps"); if (result.has_value()) { auto chibiLevels = result.value(); LOG->info("Returned data {0}", std::to_string(chibiLevels)); } example with single value
7:01 PM
and pseudo function example for multiple values
7:02 PM
auto result = ExecBP<int,int>(player, L"GetPlayerStats"); if (result.has_value()) { auto [health, stam] = result.value(); LOG->info("Player has {0} hp and {1} stam.", std::to_string(health), std::to_string(stam)); }
Avatar
substitute 9/4/2020 9:53 AM
@Pelayori
9:53 AM
I think malloc was failing for you
9:53 AM
sizeof(FHitResult) in api is 1 byte
9:53 AM
inside game is 136 byte
9:53 AM
need to either make a fake-buffer, or something
9:53 AM
idk
10:02 AM
is the struct
Avatar
Yeah, I ended up allocating 0x200 and that fixed it
Avatar
substitute 9/4/2020 7:28 PM
@Pelayori I think @Michidu (and anyone that wants to help) should add a virtual method to structures that don't have any "real" fields (like the FHitResult)
7:28 PM
that has the expected size in bytes
7:29 PM
then you can do like FHitResult::Size() (edited)
Avatar
substitute 9/4/2020 7:40 PM
@Pelayori btw size should be 0x88
7:40 PM
for FHitResult
Avatar
substitute 9/4/2020 8:24 PM
void GObj(AShooterPlayerController* pc) { auto a = GObjects(); printf("GObjects %p\n", GObjects()); LOG->info("total objects {0}", a.ObjObjects.NumElements); UClass* myGuy = nullptr; for (int i = 0; i < a.ObjObjects.NumElements; ++i) { UObjectBase* object = a.ObjObjects.GetObjectPtr(i)->Object; if (object == nullptr) continue; FString expt; object->NameField().ToString(&expt); if (expt.ToString().find("KismetSystemLibrary") != std::string::npos) { myGuy = static_cast<UClass*>(object); break; } } UFunctionExec::create(myGuy->GetDefaultObject(true), L"LineTraceSingle_NEW") .add("WorldContextObject", pc) .add("Start", FVector(0, 0, 0)) .add("End", FVector(0, 0, 0)) .add("TraceChannel", 0) //whatever .add("bTraceComplex", false) .add("ActorsToIgnore", TArray<AActor*>()) .add("DrawDebugType", 0) .skip("OutHit") //we know that this isn't quite required, so we force the check to skip this. .add("bIgnoreSelf", true) .add<bool>("ReturnValue") .call(); }
8:24 PM
using the blueprint version of the raytrace with Kismet System Library^
Avatar
🐨Dream Doctor🦘 9/22/2020 10:45 AM
Anyone think this weirdly specific server crash message might belong to them?
Avatar
Maybe... not plugin related discussion, but that looks like you have some corrupted server files. A verify on server files should fix that issue.
Avatar
Hi all - hope you're all doing well! I'm currently looking to test a piece of code executes commands correctly - does anyone have a basic command I can run that I can use for debugging (i.e. I just want to check that I can run generic console commands using my plugin)?
Avatar
🐨Dream Doctor🦘 10/8/2020 12:40 PM
The website is filled with free, open source plugins you could try...
Avatar
Hi @🐨Dream Doctor🦘, I have been looking at other plugins but hadn't noticed anything doing what I was asking - are there any plugins that you know of that might help?
Avatar
Is there a plugin to target a /command in game ?
10:31 AM
for exemple when a player does a /admin
10:32 AM
it sends a mail to the admin to notify that there is a player calling an admin in game
Avatar
🐨Dream Doctor🦘 10/14/2020 11:17 AM
@Shadow There are a number of plugins that will send normal admin commands entered into your console to discord. I'm not sure whether there's anything existing that will send chat box based commands to an email though.
Avatar
i don't think so
Avatar
Anyone have an idea as to how i might send rcon commands to the server from plugin? i've got as far as adding URCONServer to the pdbconfig and trying to define methods for it not sure what methods i should be trying to call, or if i added it properly though
8:02 PM
for context, these commands or originating in discord, going to my discord bot, then to my plugin, then ideally to rconInput
Avatar
🐨Dream Doctor🦘 10/16/2020 3:55 AM
Why don't you just send the rcon commands straight from the discord bot? (edited)
Avatar
just didnt want to add more setup and have to enter all the info for each server
Avatar
is Api outdated since latest ark update?
11:52 AM
Avatar
Hi I have this problem when the server connects to mysql 😦 [Permission][error] (d:\programs\ark\plugins\permissions\permissions\private\hooks.cpp Permissions::Hooks::Hook_AShooterGameMode_HandleNewPlayer) Couldn't add player (edited)
Avatar
It probably doesnt have permissions to add a row
Avatar
Anyone have an idea as to how i might send rcon commands to the server from plugin? i've got as far as adding URCONServer to the pdbconfig and trying to define methods for it not sure what methods i should be trying to call, or if i added it properly though
@Kal I'm trying to work this out! Let me know if you find anything and I'll get back to you if I do
Avatar
I just sent the connection info to my discord bot instead of having them define it
7:47 PM
Know any good way to get the servers ipAddress?
Avatar
why is this bit not working when a player is on a dino
11:25 PM
ArkApi::GetApiUtils().SendNotification(player, color, display_scale, display_time, nullptr, *message);
Avatar
You might be getting the controller of the dino, instead get the rider character and get its controller
Avatar
how would I do that
Avatar
If it's a dino do like this: AShooterCharacter* rider = dino->RiderField().Get(); if (rider) { AShooterPlayerController* player_controller = static_cast<AShooterPlayerController*>(rider->GetInstigatorController()); if (player_controller) { ArkApi::GetApiUtils().SendNotification(player_controller, color, display_scale, display_time, nullptr, *message); } } (edited)
Avatar
so i'm using AActor
11:38 PM
which doesnt seem to have the riderfield.get() method
Avatar
cast it to APrimalDinoCharacter
Avatar
but I dont want to do that cuz it wont always be a dino
Avatar
Use actor->IsA(APrimalDinoCharacter::GetPrivateStaticClass())
11:43 PM
will return true if is dino
Avatar
so you do:
11:49 PM
AShooterPlayerController* player_controller = static_cast<AShooterPlayerController*>(rider->GetInstigatorController())
11:50 PM
but
11:50 PM
can I use "GetOwnerController()" here?
11:52 PM
or just "ControllerField"
Avatar
I always use get instigator controller since it seems more reliable in cases where owner controller is null
11:56 PM
Try to search for it, i might have spelled it wrong
Avatar
is it "InstigatorField" perhaps?
Avatar
It isn't
12:03 AM
There must be a GetInstigatorController function
12:03 AM
Avatar
actually this works:
12:05 AM
AShooterPlayerController* player = ArkApi::GetApiUtils().FindControllerFromCharacter( static_cast<AShooterCharacter*>(actor));
Avatar
Yeah that works too
12:05 AM
Didn't remember that function
Avatar
the dino->RiderField.Get()
12:18 AM
Get function doesnt exist either
Avatar
Do you have something wrong in includes? I'm sure it does (edited)
Avatar
dont think i do
Avatar
just the ArkApi one right?
12:37 AM
what else would I need to include
Avatar
I mean those functions/fields exist and I use them in my plugins, not sure why would you not have them
Avatar
that's very odd
12:42 AM
@WETBATMAN do you know what the problem could be?
Avatar
does your plugin even compile ?
1:02 AM
i suggest you have a look at this
Avatar
no plugin doesnt compile when I add that
1:10 AM
it does when I dont
1:14 AM
I just dont have the functions that Pelayori is talking about (edited)
Avatar
you have something weird going on, i have this function
1:20 AM
and the code @Pelayori sent works fine
1:20 AM
make sure dino is APrimalDinoCharacter
1:22 AM
1:24 AM
I even redownloaded the arkapi.lib incase mine was outdated
Avatar
ah
1:24 AM
i know what it is
1:24 AM
mb i overlooked
1:24 AM
AShooterCharacter* rider = dino->RiderField().Get();
1:25 AM
field variables always need ()
1:25 AM
right
1:25 AM
my bad
1:25 AM
Yeah it works now
Avatar
glad to hear 🙂
Avatar
@Pelayori @WETBATMAN thanks again guys. Just tested it and it works perfectly 🙂
Avatar
No worries 😄
Avatar
Is this the hook I need to use if I want the new tribename when it gets updated:
12:18 AM
DECLARE_HOOK(FTribeData_MarkTribeNameChanged, void, FTribeData*, UObject*);
Avatar
@Foppa is it possible to add a /kill option to your dino limit plugin ?
5:09 PM
when a tribe has reach the limit, the plugin prevent player to kill dino
Avatar
Yeah put it in the suggestion in my discord 🙂
10:59 PM
or... actually that's not the intention of the plugin
11:00 PM
and also why would you disable someone from killing a dino?
Avatar
my players said that when they reach the dino limit, they can't eat, drink, use a weapon. (edited)
11:35 AM
they can only ask a tamed dino to be passive to be killed (edited)
Avatar
Download the new version?
Avatar
Yeah use the latest version
Avatar
I already use the latest version, do I have to do a Dino refresh command ?
6:39 PM
i've done a dino refresh, seems to be good for now
Avatar
Hello, on our old cluster we installed Auto Engram mod, on our new cluster, I'm trying to setup AllEngram plugin. I think I missed something because, even if I put the Tek Hover Skiff in the ExcludeEngrams.txt, I still can craft it from tek replicator whereas I didn't beat the Genesis boss. Any idea ? (edited)
Avatar
Autodetect engrams false
Avatar
Avatar
WoolyPenguin
I'm having an issue locating the Dino's base stats. i've managed to get original stats when tamed. (before it's been leveled) But i'm trying to find the basestats shown in Tobias' plugin with /mydinostats. (Improved Commands plugin) Does anyone have an idea where the absolute base stat variable is? (edited)
Дивоглюк 11/21/2020 9:02 PM
Can you share solution?
Avatar
🐨Dream Doctor🦘 11/22/2020 1:39 AM
@Дивоглюк Have you ever used the ark dev kit? For most things like this, some experience in the dev kit will help you greatly to understand how everything works.
Avatar
Avatar
🐨Dream Doctor🦘
@Дивоглюк Have you ever used the ark dev kit? For most things like this, some experience in the dev kit will help you greatly to understand how everything works.
Дивоглюк 11/22/2020 1:45 AM
no, not used, thanks, will read about it
Avatar
Avatar
Дивоглюк
no, not used, thanks, will read about it
🐨Dream Doctor🦘 11/22/2020 1:48 AM
Even if you just work through the Wildcard Workshop youtube vidoes for the dev kit without actually doing anything yourself you will find a huge amount of useful information about how Ark and UE4 work in general. https://www.youtube.com/playlist?list=PL2o1TY9xh_JsmbgQfSCydfT-7OSdvxsVR
Avatar
Does anyone have an idea why APrimalDinoCharacter.DoAttack would stop working when the dino is picked up by a skiff?
3:57 PM
works when picked by argy, quetz, crab
Avatar
So a little more on the problem here, the skiff is applying a buff to the dino that is picked up but calling APrimalBuff.Deactive, APrimalDinoCharacter.DeactivateBuffs, or modifying the buff all cause the server to crash Anyone have experience with modifying/removing a buff from a dino?
Avatar
Talking to myself here, but anyone know why I'd get this 11/24/20 23:26 [API][error] Failed to create hook for APrimalBuff.AddBuff im updated to the structs from https://github.com/Michidu/ARK-Server-API/pull/41/files
Avatar
@Kal do you have DumpAll enabled in the API settings ?
Avatar
considering ive never used it, i doubt it
5:09 PM
but i found a workaround for what i was trying to do, all good now
5:10 PM
the Deactivate methods were causing crashes and everything, but simply calling Destroy() on the buff worked just fine
Avatar
Can anyone help me with getting the struct of FSpawnPointInfo for ARK?
Avatar
Avatar
Kal
Can anyone help me with getting the struct of FSpawnPointInfo for ARK?
struct FSpawnPointInfo { int SpawnPointID; FString BedName; ABiomeZoneVolume *SpawnPointVolume; TSubclassOf<AActor> SpawnPointActorClass; FVector AtLocation; long double NextAllowedUseTime; bool bAllowedUse; };
9:23 PM
any chance you could share with me how you came up with that?
9:23 PM
i've tried a couple different things and been unsuccessful
Avatar
IDA
Avatar
hmm, accessing like that didnt work atleast
9:28 PM
Log::GetLog()->info("Spawn Point {}: ID={}, Name={}, Loc={},{},{}", i, point.SpawnPointID, point.BedName.ToString(), point.AtLocation.X, point.AtLocation.Y, point.AtLocation.Z); 12/11/20 14:27 [KalsFastTravel][info] Spawn Point 0: ID=72071714, Name=, Loc=2.44073e-17,9.94922e-43,-238446 12/11/20 14:27 [KalsFastTravel][info] Spawn Point 1: ID=6356993, Name=, Loc=0,0,-0.00618458 12/11/20 14:27 [KalsFastTravel][info] IMPL: Fast Travel from 182878032 to 785478952 (edited)
9:28 PM
one of those IDs should have matched 785478952
9:29 PM
and the locations seem wrong
9:29 PM
names empty
9:33 PM
Nevermind sorry, i had stupidly commented out ABiomeZoneVolume *SpawnPointVolume; because i didnt have the struct, so it mapped the object wrong adding an empty struct got the correct location and ids, but still blank name which is fine for now
9:33 PM
Thank you for your help!
Avatar
No worries, if you just wanted a single field you could use GetNativePointerField
9:40 PM
There are plenty of examples of how does that work in any struct of class defined in the api by default
Avatar
Does anyone know why for 2 of 5 test machines (nothing i can tell different on test servers) Bed's would be horribly messed up? Some examples: APrimalStructureBed::GetPlayerSpawnLocation, GetDescriptiveName, BedNameField, FindBedWithID all cause crashes on the 2 servers (3 work great) bDestroyAfterRespawnUse is set to true on regular beds not just sleeping bags on 2 of the 5 APrimalStructure::GetPlayerSpawnLocation() returns garbage location for all 5 DefaultActorLocationField of the bed is 0,0,0 for all 5 (am i looking in the wrong place for structure location?) (edited)
9:35 PM
even simple code like this crashes the 2 servers: void Hook_APrimalStructureBed_PlacedStructure(APrimalStructureBed* _this, AShooterPlayerController* PC) { FVector toLoc; _this->GetPlayerSpawnLocation(&toLoc); std::string bedName = _this->BedNameField().ToString(); Log::GetLog()->info("Placed new spawn point '{}' at {},{},{}", bedName, toLoc.X, toLoc.Y, toLoc.Z) APrimalStructureBed_PlacedStructure_original(_this, PC); }
Avatar
At which line does it crash exactly? (edited)
Avatar
no crash at all, server exit
Avatar
Doing anything on another thread?
10:02 PM
got a test server running?
Avatar
Simply calling if (toBedObj->IsA(APrimalStructureBed::StaticClass())) or using APrimalStructureBed in any way is causing crashes of 2 of 5 test machines
12:37 AM
works just fine on others
Avatar
Strange, I use IsA on a daily basis on plugins and none of them crash
9:27 PM
But I use GetPrivateStaticClass though
Avatar
was able to avoid the crashes and bad data inside Bed (including bedId and Name and everything)
2:18 AM
would like to use BedNameField, but was getting garbage memory data into it for those 2 test servers
Avatar
are there any hooks that get called when a tribe is created?
Avatar
should be this: Hook_AShooterPlayerState_AddToTribe
Avatar
np, I am not 100% sure tho, but should be 😄
Avatar
hmm, any idea what flag to look for to determine if a player is handcuffed?
Avatar
Avatar
Kal
hmm, any idea what flag to look for to determine if a player is handcuffed?
You could check for a debuff or their inventory
3:28 AM
I don’t think there’s a flag directly
Avatar
using bBlockInput
4:37 AM
or hoping to use, will test when i have a chance and a tester to handcuff me
Avatar
Avatar
Kal
or hoping to use, will test when i have a chance and a tester to handcuff me
this is one of those times I am glad I have like 4 computers
Avatar
i have others, just didnt have time
5:16 AM
will later 😛
5:17 AM
@Kal I adapted the version.dll wrapper from the Ark API
5:17 AM
and made a 32 bit version
5:17 AM
and made a template project that switches between the two assembler files seemlessly
Avatar
interesting why did you need to use 32 bit?
Avatar
for 32 bit games I wanted to inject code in (I have a wow private server on wrath of the lich king and I've made some modifications to the client)
5:18 AM
I wanted to autoload my code
5:18 AM
and many processes load version.dll automatically
Avatar
i didnt realize that
Avatar
ya
5:19 AM
it's how reshade works as well
5:19 AM
reshade just replaces directX files
5:19 AM
When Windows run-time links dlls, it checks the application directory first
Avatar
my understanding of how the api works is somewhat high lvl
Avatar
if the file exists, it loads that version
5:19 AM
otherwise it checks system paths
Avatar
i thought the api was a hack specific to ark
Avatar
so by dropping the file in the same directory, you're effectively exploiting a feature of Windows
5:20 AM
the API is
5:20 AM
but how the API loads isn't
Avatar
i was always kinda curious how it got injected into the shootergame (edited)
Avatar
yup, it's not injected, it's loaded because of how Windows resolves dynamic linked dependencies
5:21 AM
😛 (edited)
5:22 AM
all dlls are checked if they exist in the exe folder, and if not, if they exist in Windows system paths
5:22 AM
and if not, load error
5:22 AM
@Kal now this might also be interesting to you.
5:22 AM
the reason delay loaded dll fixes stuff like depending on permissions
5:23 AM
is that is does the same DLL loading/linking
5:23 AM
however it ONLY does it once a function in that DLL is being run
5:23 AM
so this can ensure that the dll is loaded, while also allowing the application to execute when it's not loaded/needed yet.
5:24 AM
this also lets developers be able to drop/in replace/swap between permission systems by simply checking if the plugin exists and delay-loading later.
Avatar
i was planning to look up more about that, having an issue or two with it
5:25 AM
wanted to make shop and permissions optional
Avatar
yup, u can delay load for that
Avatar
or shoip atleast
Avatar
use delay load and you can query if the library exists/is loaded
5:25 AM
and if it isn't, just swap to a different branch (edited)
Avatar
i set delay load but it seemed to make it required, or i was misunderstanding
Avatar
You need to query if the dll exists
5:26 AM
and NOT run ANY dll code
5:26 AM
if it doesn't
5:26 AM
once a single call to the library is made, Windows loads it as if it was a normal dll
Avatar
gotcha, it links if i dont check? even before it actually executes?
Avatar
delay loaded just means load later
5:26 AM
it shouldn't load until you make a call to the library
5:26 AM
so you don't need if you don't make any calls to the library
Avatar
it seemed to
Avatar
I can try something on my end to see if I can replicate the issue
Avatar
im sure i was mistaken, ill take another look later
Avatar
did you make sure to set the delay option on the right build configuration too?
Avatar
yea, ive only been using 1 build config 😫
5:29 AM
i need to automate my releases and everything
Avatar
dude
5:37 AM
I hate CI
5:38 AM
I made a github actions for a C# project for my class (software we worked on with the professor so we could test our made up assembly language code)
5:38 AM
and it took forever to get it right
5:38 AM
amegablobsweats
Avatar
reminds me of one of my favorite classes we followed along with nand2tetris.com
Avatar
Bl4ckSkull666 12/30/2020 1:53 PM
Hey all, can anyone share the extended rcon plugin file from 21.12. please?
Avatar
you can just download it from the api site?
7:29 PM
or my discord
Avatar
Avatar
Foppa
you can just download it from the api site?
Bl4ckSkull666 12/30/2020 7:48 PM
Now right 😉 Now works the forum btw the login function 🙂 But check the post time and your announce time 🙂 Thx 😉
Avatar
Foppa I am having an issue with Structure limits that I cant seem to get.
4:47 AM
I can not for the life of me get the Admin bypass to work correctly. I have admins set with * our Steam IDs are in there and it shows us in there with /groups. But i can not get our awesome teleporter limit to bypass with ignore admins.
Avatar
Avatar
Crispy
Foppa I am having an issue with Structure limits that I cant seem to get.
I might have to re-visit that function
Avatar
wanna send me a link to your discord and i can post up what we are seeing on our end.
Avatar
I am looking at Shops Currency &Kits and i keep getting this error when booting. I am unsure what i am looking for . 12/31/20 23:29 [ArkShop][error] [json.exception.parse_error.101] parse error at 6008: syntax error - unexpected end of input; expected '}'
12:32 AM
Any pointers
Avatar
Fix the json error
12:55 AM
Avatar
Thats what I was thinking. Ill have to re look at it as the the {} look correct
Avatar
weird. I didnt change anything.. Or so i though and it is working now... must have been my over tired brain. lol
Avatar
Any easy way to get the display name for an TSubclassOf<UPrimalItem>?
7:19 PM
not the class name
Avatar
Avatar
Kal
Any easy way to get the display name for an TSubclassOf<UPrimalItem>?
Convert the UClass to a UPrimalItem. Something like this... UPrimalItem* item = (UPrimalItem*)YourTSubclassOfVariable.uClass->GetDefaultObject(true); if (item) { FString itemName; item->GetItemShortName(&itemName); }
Avatar
Ahh, thank you That makes sense
Avatar
Deleted User 1/15/2021 2:29 AM
I have a question. What is the best way to get players online time? 1. Record through hook. (AShooterGameMode_HandleNewPlayer, AShooterGameMode_Logout) 2. Player list check every second 3. Are there any basic methods?
Avatar
SublimeStyle 1/15/2021 2:30 AM
login/logout hooks would make the most sense I think (edited)
Avatar
Deleted User 1/15/2021 2:32 AM
i See AShooterGameMode_HandleNewPlayer In the case of Hook, it may work twice for one user or may not get the character name. Is there any other way to verify login?
Avatar
FPrimalPlayerDataStruct.LoginTime
👍 1
Avatar
Avatar
Kal
FPrimalPlayerDataStruct.LoginTime
Deleted User 1/15/2021 2:38 AM
wow. I'll try this !
Avatar
Deleted User 1/15/2021 2:59 AM
Getting "LoginTime" was successful. I want to find out the access time by comparing it with the current time. How can I get the current time?
3:00 AM
LoginTime is of type "long double". I am not sure if there is a function that returns the "current time" as a "long double" type. (edited)
Avatar
SublimeStyle 1/15/2021 3:05 AM
you can use chrono: https://en.cppreference.com/w/cpp/chrono or use the STL type and do some math: http://www.cplusplus.com/reference/ctime/time/
Avatar
Deleted User 1/15/2021 3:07 AM
thank you. I found it. So, is LoginTime expressed in milliseconds? Let me try it.
Avatar
SublimeStyle 1/15/2021 3:07 AM
correct
3:07 AM
or at least that's my assumption
3:09 AM
probably more likely in seconds
3:09 AM
but you'll find out eventually 😛
Avatar
Deleted User 1/15/2021 3:12 AM
I am opening the server after compiling. Having to open the server every time I test it is a pain. 😉
Avatar
SublimeStyle 1/15/2021 3:13 AM
there is a way to debug the server if you're just using logging: https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugging?view=vs-2019
3:14 AM
Avatar
Deleted User 1/15/2021 3:14 AM
oh thank you.
👍 1
Avatar
gameworld had a current seconds, ill find it in a min
3:17 AM
after this match
Avatar
Deleted User 1/15/2021 3:19 AM
Oh....
3:19 AM
3:19 AM
is this? GetTimeSeconds
Avatar
there ya go
Avatar
Deleted User 1/15/2021 3:20 AM
wow. good!
3:21 AM
I implemented it the way SublimeStyle told me. However, I will also test the method Kalendell told me. Really thankful.
Avatar
SublimeStyle 1/15/2021 3:22 AM
I would use the UE convenience methods over the lower level base STL stuff- the GetTimeSeconds seems to be a good choice (edited)
3:22 AM
altho chrono is a nice library 🙂
Avatar
use the built in if its available and matches what you need, then libs over manual shit
👍 2
Avatar
Deleted User 1/15/2021 3:26 AM
ok! thank you.
Avatar
hey, we use the VIP Plugin on our Cluster... But on all new maps we addet or if we wipe a map the plugin dont work anymore... when i have a multiplier on weight what on all "old" maps work so this multi dont want to add on a map what i addet to the cluster. for example: we wiped aberration 2 weeks ago. before we wiped the vip plugin worked well, now i deleted all savegames and start with day 1, since this no multipliers from vip worked anymore... whats the problem there?
Avatar
Deleted User 1/16/2021 12:03 PM
hi good day.
12:03 PM
I want to change the Server Title in real time during Steam Rcon Query. Is it possible with a hook? Or, is there a method?
Avatar
@substitute figured it out
Avatar
Hey yall, quick question, im looking for somone to write us an API that checks steam ids in a cluster and kicks players with the same ID. 1 account on 2 servers for example.
Avatar
Hey are you able to spawn a drop for someone ?
5:23 PM
like ScriptCommand 76561198036839044 summon SupplyCrate_Level60_Double_C
Avatar
Hi all - I'm trying to write a small plugin for my server, that unlocks the genesis bosses on login. The command "DebugAllowvrMissionTeleport" lets me do this, however I can't find an "on login" hook that allows me to run this as a cheat (via UShooterCheatManager) or as a command. Seems like something isn't fully initialized on HandleNewPlayer_imp. Command runs via the plugin manually after logging in. Any ideas for what to hook?
8:49 PM
@Shadow this can be done with ArkShop - check out the config example
Avatar
@Haragon what about void Hook_AShooterGameMode_PostLogin(AShooterGameMode* _this, APlayerController* NewPlayer)
Avatar
Avatar
Haragon
Hi all - I'm trying to write a small plugin for my server, that unlocks the genesis bosses on login. The command "DebugAllowvrMissionTeleport" lets me do this, however I can't find an "on login" hook that allows me to run this as a cheat (via UShooterCheatManager) or as a command. Seems like something isn't fully initialized on HandleNewPlayer_imp. Command runs via the plugin manually after logging in. Any ideas for what to hook?
maybe run the Handle new player original code first
10:18 PM
and then add your own code ?
Avatar
Yeah I have it set up that way, but it still doesn't run it. Well I run the original and store the resulting bool, and then i return that result after I run my code.
Avatar
Deleted User 1/22/2021 11:22 AM
Hello good day. Can I read the current server's ark mod list and version information from the ark server api?
Avatar
probably
Avatar
arkshop plugin does not work on my cluster server How can I fix
Avatar
May you write what ur error is
Avatar
Copadevino6 2/5/2021 9:30 PM
I pay 3€ x paypal right now for 5 min of help. I have 2 servers in g-portal(web) and i install the plugins but dont found. Can anybody help me? i pay. i am 7h and i cant do that this found.sen me a message for the pay please.
Avatar
Hello everyone. I'm actually trying to catch the event of opening a structure by a player to check who open what. I had something working during multiples months but since last API update, he's broken. I tried to update it but can't understand what is wrong. I used the hook APrimalStructureItemContainer_RemoteInventoryAllowActivation(APrimalStructureItemContainer* _this, AShooterPlayerController* ForPC) In the working version I retrieve the USceneComponent from _this with the RootComponentField function then I used the function RelativeLocationField on the USceneComponent to get a vector. And finally, I retrieve the closest structure from the player with that : _this->GetClosestStructureToPoint(ArkApi::GetApiUtils().GetWorld(), vector, 5); But I don't understand why the vector isn't initialized anymore and I can't retrieve the closest structure. Someone can help me on that or give me some tips about functions (or other method) that can give me the structure who was opened ? Thank you in advance (edited)
Avatar
Is it easy to create an api plug-in that works with a user interface shop mod? I wanna make my own shop mod and have a the plug in do the config for it
Avatar
short answer, no its not easy
Avatar
Anyone been able to get a working APrimalWorldSettings? I need to calc GPS coords and want to do it the with the proper scales.
Avatar
@Lethal Yes i'll pm you
👍 1
Avatar
Does anyone have only a plugin with /genderchange, or /gc sounds like c+++ is involved in coding plugin.
Avatar
Avatar
Noobyx
Does anyone have only a plugin with /genderchange, or /gc sounds like c+++ is involved in coding plugin.
https://discord.gg/zyJQzUg Plugin features: Change gender of dinos just with a command while staring at a dino (Optional) Token system to allow players to use it (Optional) Allow only certain groups to use the command (Optional) Enable timed...
Avatar
@Pelayori i manage to only have the gender change i was going to ask how do you decompile it i might change something in it, sir.
5:10 PM
isnt there any video about decompile
Avatar
You cannot decompile it to get the source itself
5:11 PM
And I haven't open sourced it for now
Avatar
Oh man, sad yea okay thx anyways.
Avatar
you can decompile it but it will be pseudocode
5:33 PM
if plugin has .pdb it will have function and variable names inside too
5:34 PM
but why not just ask how to do it here instead of decompiling lol
Avatar
Why would i'll gonna ask how you making a genderchange you probaly just gonna say learn c+++ which is not my part of coding, iam mostly just a discord bot coder of nodejs/javascript so yea @WETBATMAN (edited)
Avatar
then how would decompiling help you if you don't know c++ ?
6:08 PM
and no, nobody here would say that, we are a community because we help each other and you'd get your answer
Avatar
Aight thx, @WETBATMAN .
Avatar
Anyone got an idea how to get the location of a structure (APrimalStructure)? I tried c++ auto& pos = structure->DefaultActorLocationField(); but all of them are 0.
Avatar
Avatar
Dia
Anyone got an idea how to get the location of a structure (APrimalStructure)? I tried c++ auto& pos = structure->DefaultActorLocationField(); but all of them are 0.
structure->RootComponentField()->RelativeLocationField()
Avatar
thanks, will try that
Avatar
a white guy 3/2/2021 6:13 AM
anyone getting this after the new update that just hit?
6:13 AM
Avatar
everyone is
Avatar
a white guy 3/2/2021 6:20 AM
good to know. i havent seen anything posted anywhere about it yet when i looked in a few discords
6:21 AM
oh, nm i just saw the messages on your discord
Avatar
Anyone storing unicode in MySQL? Trying to determine if i'm doing some incorrectly. The top line on this image I pasted directly into MySQL. The second line is what the plugin inserts into the database for that same text. The result still seems to be accurate from what I can tell when I pull the value and use it.
3:17 PM
Database column is set to utf8mb4 as well.
3:40 PM
well
3:40 PM
this is how i do it
3:40 PM
works fine
3:44 PM
on a side note, if you store player names you should probably escape them 😄
Avatar
Cool, thanks. I will give this a shot.
Avatar
Avatar
Lethal
Cool, thanks. I will give this a shot.
substitute 3/3/2021 4:22 PM
What’s the encoding
4:23 PM
Ue4 is utf-16
4:23 PM
SQL can be many encodings
4:23 PM
C++ strings can also be a lot of different encodings
4:24 PM
I see your database encoding, yeah make sure to convert the utf16 to utf8
Avatar
Avatar
WETBATMAN
on a side note, if you store player names you should probably escape them 😄
substitute 3/3/2021 4:24 PM
Yoloooo
4:25 PM
‘; drop table users
Avatar
I take the TribeName from TribeData which is stored in FString and write it above like Wet suggested. ArkApi::Tools::Utf8Encode(*tribeName)
4:32 PM
Text in the database still looks the same as my previous version though.
4:32 PM
The text is used in webhooks and does output correct in discord.
Avatar
the encoding should fix your issue
4:34 PM
Utf8Ecode
Avatar
db_.query(fmt::format( "INSERT INTO TribeLogRelay (TribeId, DiscordWebhook, TribeName) VALUES ({}, '{}', '{}');", TribeId, "", ArkApi::Tools::Utf8Encode(*tribeName)));
4:36 PM
Wonder if using "fmt::format" is messing with it then.
Avatar
Avatar
Lethal
Wonder if using "fmt::format" is messing with it then.
substitute 3/3/2021 5:07 PM
fmt might be changing the encoding?
5:07 PM
try formatting and then converting to utf8
Avatar
Tried a few different things but it never stores the original characters that were used.
Avatar
return db_.query("UPDATE TribeLogRelay SET TribeName = '%s' WHERE TribeId = %I32i;", ArkApi::Tools::Utf8Encode(*tribeName), TribeId); Stores P5%Å instead of 部落名称变更至 but the value comes out properly in discord. Was trying to make database show the actual same value when I paste in the text.
Avatar
substitute 3/3/2021 9:55 PM
strange, maybe it's your database tool?
Avatar
Avatar
substitute
strange, maybe it's your database tool?
HeidiSql
12:04 AM
and MySQL Workbench show the same way
Avatar
I gave up and will leave the database not displaying correctly since the webhook does show it correctly which is what matters for this plugin at least.
Avatar
Avatar
Lethal
I gave up and will leave the database not displaying correctly since the webhook does show it correctly which is what matters for this plugin at least.
substitute 3/4/2021 2:15 AM
This is dangerous
Avatar
I had a nightmare of a time with this with my chat
2:18 AM
ill see if i can dig up anything relevant
Avatar
Avatar
substitute
This is dangerous
How do you figure?
Avatar
Avatar
Kal
ill see if i can dig up anything relevant
thanks
Avatar
Avatar
Lethal
db_.query(fmt::format( "INSERT INTO TribeLogRelay (TribeId, DiscordWebhook, TribeName) VALUES ({}, '{}', '{}');", TribeId, "", ArkApi::Tools::Utf8Encode(*tribeName)));
Thats nearly identical to most of my code Make sure you escape quotes and escape characters what collation and charset is on the schema & database? try adding daotk::mysql::connect_options options; ... options.charset = "utf8"; ...
Avatar
utf8mb4_unicode_ci
2:24 AM
I didn't have the charset in there building/testing now (edited)
Avatar
im using utf8_bin and utf8
2:24 AM
on both
2:25 AM
not sure if thats needed
Avatar
Avatar
Lethal
How do you figure?
substitute 3/4/2021 2:25 AM
escaping may not work with misconfigured encodings
2:26 AM
e.g. escape is looking for ' while 'ab' might become ' once insert.
Avatar
escaping ' and \ has working for me so far in chat
2:30 AM
but im sure some clever person could break it
Avatar
substitute 3/4/2021 2:30 AM
You’re not manually escaping right?
2:30 AM
Modern sql connectors should have prepared statements
2:33 AM
pretty sure no escape function built in
Avatar
there is a TON more built in to that lib than i did
2:34 AM
i was just hacking shit together til it worked
2:35 AM
for one, doing prepared statements would be nice
Avatar
Avatar
Kal
there is a TON more built in to that lib than i did
I used utf8mb4 and the default collation utf8mb4_0900_ai_ci and it works now.
2:40 AM
Just needed the options.charset 😦 (edited)
Avatar
I was so confused why this wasn't working lol
Avatar
Just an FYI for anyone else that utf8mb4_0900_ai_ci is not compatible with MariaDB. I had to switch that to utf8mb4_general_ci for it to work with both MySQL/MariaDB.
👍 1
Avatar
how one would go about detect player combat? i think it is possible to use the take damage hook and mark the player for combat for a few seconds. Is there a easier way?
Avatar
Has anyone developed some sort of in-game ui for arkshop? I know there was one a couple years ago, seems to have been abandoned though. More than willing to pay. Dm's are open.
Avatar
Avatar
kaotik
Has anyone developed some sort of in-game ui for arkshop? I know there was one a couple years ago, seems to have been abandoned though. More than willing to pay. Dm's are open.
that can only be done with mods.
Avatar
Avatar
kaotik
Has anyone developed some sort of in-game ui for arkshop? I know there was one a couple years ago, seems to have been abandoned though. More than willing to pay. Dm's are open.
🐺LiamMcIntyre!🦄 3/15/2021 3:13 PM
Substitute is right, must use mod integration Wooly has already created this and it works amazing, if you contact him on Discord you will be able to purchase it
Avatar
Deleted User 3/21/2021 11:57 AM
good day. This is a new project that has not been coded. Compilation failure occurs when compiling. Is there a solution? Please. Help.
11:57 AM
i use this source.
11:59 AM
I can't attach an image... I am getting c2760 error at tuple.h lines 409, 419.
Avatar
Deleted User 3/21/2021 12:06 PM
I am using the visual studio 2019 community.
Avatar
Deleted User 3/21/2021 12:20 PM
I solved the problem. I added the following code to line 19 of Tuple.h. #define USE_TUPLE_AUTO_RETURN_TYPES 1 (edited)
Avatar
i would like to force a player to join a tribe, i am trying using : shooterCheatManager->ForcePlayerToJoinTribeId(player_id, tribe_id); On the chat, it shows the message "Player added to tribe", but the player is not added to the tribe. Anyone has any tips on how to find out what is wrong?
Avatar
Deleted User 3/25/2021 5:10 AM
I want the same function. I didn't have time to try it. I'll try it sooner or later.
Avatar
Avatar
Uaca
i would like to force a player to join a tribe, i am trying using : shooterCheatManager->ForcePlayerToJoinTribeId(player_id, tribe_id); On the chat, it shows the message "Player added to tribe", but the player is not added to the tribe. Anyone has any tips on how to find out what is wrong?
Try by update their team id too
8:45 AM
Maybe the field no updated
Avatar
@Uaca There is already tribe enforcer
8:51 AM
or asking for a request/command based function? (edited)
Avatar
if (PC->GetPlayerCharacter() && !PC->IsSpectator() && !PC->IsInTribe()) { AShooterGameMode* GameMode = ArkApi::GetApiUtils().GetShooterGameMode(); FString TribeName = L"Tribe of " + ArkApi::GetApiUtils().GetCharacterName(PC); int CreatedTribeID = GameMode->ForceCreateTribe(&TribeName, 0); FTribeData* CreatedTribeData = static_cast<FTribeData*>(FMemory::Malloc(0x200)); RtlSecureZeroMemory(CreatedTribeData, 0x200); if (GameMode->GetOrLoadTribeData(CreatedTribeID, CreatedTribeData)) PC->GetShooterPlayerState()->AddToTribe(CreatedTribeData, false, false, false, nullptr); FMemory::Free(CreatedTribeData); } (edited)
12:05 PM
@Uaca
Avatar
Avatar
Foppa
or asking for a request/command based function? (edited)
the console command available only forces join with UE ID, i want to make one with steam id
Avatar
Avatar
WETBATMAN
if (PC->GetPlayerCharacter() && !PC->IsSpectator() && !PC->IsInTribe()) { AShooterGameMode* GameMode = ArkApi::GetApiUtils().GetShooterGameMode(); FString TribeName = L"Tribe of " + ArkApi::GetApiUtils().GetCharacterName(PC); int CreatedTribeID = GameMode->ForceCreateTribe(&TribeName, 0); FTribeData* CreatedTribeData = static_cast<FTribeData*>(FMemory::Malloc(0x200)); RtlSecureZeroMemory(CreatedTribeData, 0x200); if (GameMode->GetOrLoadTribeData(CreatedTribeID, CreatedTribeData)) PC->GetShooterPlayerState()->AddToTribe(CreatedTribeData, false, false, false, nullptr); FMemory::Free(CreatedTribeData); } (edited)
thanks, i am going to try!
Avatar
oh well i'm adding that to ExtendedRcon for the record 😛
1:22 PM
just so you know
Avatar
Avatar
Foppa
oh well i'm adding that to ExtendedRcon for the record 😛
that is what i was going to say, it is a good addition to extended rcon. Now i have to join the game to fix tribe issues.
Avatar
Avatar
Foppa
oh well i'm adding that to ExtendedRcon for the record 😛
go right ahead lol
Avatar
oh i didn't mean to sound rude 😛 i meant i had it in my plans todo ! xD
Avatar
nono i didn't either 😄
Avatar
btw @Uaca i'm like 90% sure that GetOrLoadTribeData function leaks memory so try to cache the tribe data if you're going to re-use it (edited)
Avatar
Avatar
WETBATMAN
btw @Uaca i'm like 90% sure that GetOrLoadTribeData function leaks memory so try to cache the tribe data if you're going to re-use it (edited)
after one week, my cluster get to 99GB of cached memory 👀 (edited)
Avatar
Avatar
WETBATMAN
btw @Uaca i'm like 90% sure that GetOrLoadTribeData function leaks memory so try to cache the tribe data if you're going to re-use it (edited)
Sounds like a great candidate function to be rewritten
Avatar
Avatar
WETBATMAN
if (PC->GetPlayerCharacter() && !PC->IsSpectator() && !PC->IsInTribe()) { AShooterGameMode* GameMode = ArkApi::GetApiUtils().GetShooterGameMode(); FString TribeName = L"Tribe of " + ArkApi::GetApiUtils().GetCharacterName(PC); int CreatedTribeID = GameMode->ForceCreateTribe(&TribeName, 0); FTribeData* CreatedTribeData = static_cast<FTribeData*>(FMemory::Malloc(0x200)); RtlSecureZeroMemory(CreatedTribeData, 0x200); if (GameMode->GetOrLoadTribeData(CreatedTribeID, CreatedTribeData)) PC->GetShooterPlayerState()->AddToTribe(CreatedTribeData, false, false, false, nullptr); FMemory::Free(CreatedTribeData); } (edited)
it worked! Thank you very much
Avatar
Avatar
Uaca
it worked! Thank you very much
👌
Avatar
I dont think i know how the hooks works. I am using the "Server Api Hook Creator v1.8", i found the APrimalDinoCharacter void TargetingTeamChanged()
Avatar
I've found that hook to be unreliable. Use ChangeActorTeam()
Avatar
wow, that was fast!
Avatar
Hook_APrimalDinoCharacter_ChangeActorTeam
10:51 PM
Lol I got the notif now (edited)
Avatar
i did not even finish asking! Thank you very much!
Avatar
Hello again, quick question, if multiples plugins use the same hook, is there a order of execution? If i block the hook on my plugin it will block all others hooks?
Avatar
Avatar
Uaca
Hello again, quick question, if multiples plugins use the same hook, is there a order of execution? If i block the hook on my plugin it will block all others hooks?
hooks are passed alphabetically
5:40 PM
like the plugin load order
Avatar
then to block others plugins, i need to be the first to be loaded and prevent the hook to call original function?
Avatar
that is correct
6:21 PM
but which hook are you working on?
Avatar
AShooterPlayerController_ServerSendChatMessage_Implementation
6:57 PM
i've looked at the ark api source and found this one, i intend to allow the use of commands only inside a zone
Avatar
AShooterPlayerController_ServerSendChatMessage_Implementation <-- that's being used massively just so you know... (edited)
Avatar
you can prevent the hook like that
Avatar
Avatar
Foppa
AShooterPlayerController_ServerSendChatMessage_Implementation <-- that's being used massively just so you know... (edited)
well, now i am afraid!
Avatar
Avatar
WETBATMAN
you can prevent the hook like that
thanks!
Avatar
Avatar
Uaca
well, now i am afraid!
Don't hook that function (edited)
7:34 PM
instead in your command callback check the player location
Avatar
he's trying to prevent commands from other plugins
7:35 PM
not his own
Avatar
yes, if the player is in the zone he can use all plugins commands, if not everything is blocked
Avatar
Avatar
Uaca
yes, if the player is in the zone he can use all plugins commands, if not everything is blocked
Fork the api
10:02 PM
That’s the only clean solution (edited)
Avatar
that is way beyond my current skill level, i will the AShooterPlayerController_ServerSendChatMessage_Implementation and hope for the best 😅
Avatar
Avatar
WETBATMAN
if (PC->GetPlayerCharacter() && !PC->IsSpectator() && !PC->IsInTribe()) { AShooterGameMode* GameMode = ArkApi::GetApiUtils().GetShooterGameMode(); FString TribeName = L"Tribe of " + ArkApi::GetApiUtils().GetCharacterName(PC); int CreatedTribeID = GameMode->ForceCreateTribe(&TribeName, 0); FTribeData* CreatedTribeData = static_cast<FTribeData*>(FMemory::Malloc(0x200)); RtlSecureZeroMemory(CreatedTribeData, 0x200); if (GameMode->GetOrLoadTribeData(CreatedTribeID, CreatedTribeData)) PC->GetShooterPlayerState()->AddToTribe(CreatedTribeData, false, false, false, nullptr); FMemory::Free(CreatedTribeData); } (edited)
I have a routine that uses GetOrLoadTribeData but it still leaks memory regardless if I use Free or not it seems.
Avatar
yeah it's something with the function itself
7:14 PM
you should cache the pointer to the data after loading it
Avatar
i would like to find out if the dino has decayed to block claim, so far i've hooked into ChangeActorTeam and i can block, when the dino is unclaimed the team changes to 2000000 and that way i can know if i should allow other claim because the dino is not decayed
1:32 AM
but if any player merge tribes, since the dino team is not 2000000, every dino gets deleted. Is there anyway to check if the dino have decayed?
Avatar
i've also tried to look into aPrimalDinoCharacter->LastInAllyRangeTimeField() and GameMode->PvEDinoDecayPeriodMultiplierField() together to check if anyone got near the dino, but Log::GetLog()->info(_this->LastInAllyRangeTimeField()) always gives the value = 2.95461e+07
Avatar
if (Dino->IsTamed() && Dino->LastInAllyRangeTime > 0 && GetWorld()->TimeSeconds > Dino->GetForceClaimTime() && UPrimalPlayerData::IsTribeID(Dino->TargetingTeam)) { Dino->Destroy(); } (edited)
6:52 AM
something like this
6:52 AM
that's how the game does it anyway
6:53 AM
(and it does some other checks to see if pve server, disabledinodecaypve, etc etc )
6:54 AM
it executes in APrimalDinoCharacter::HandleUnstasised
7:00 AM
if lastinallyrangetimefield() gives garbage value there's prob something wrong w it in serverapi (edited)
7:02 AM
do like uworld->timesince(dino->LastInAllyRangeTimeField) see what it gives
Avatar
void Hook_APrimalDinoCharacter_Tick(APrimalDinoCharacter* _this, float DeltaSeconds) { APrimalDinoCharacter_Tick_original(_this, DeltaSeconds); if (_this && _this->TargetingTeamField() >= 50000 && _this->GetForceClaimTime() > 0) { if (_this->GetForceClaimTime() <= static_cast<AShooterGameState*>(ArkApi::GetApiUtils().GetShooterGameMode()->GameStateField())->NetworkTimeField()) _this->Suicide(); } } (edited)
7:56 AM
@Uaca
7:57 AM
this kills the dino if decayed but ofc you can do anything else
Avatar
Avatar
WETBATMAN
void Hook_APrimalDinoCharacter_Tick(APrimalDinoCharacter* _this, float DeltaSeconds) { APrimalDinoCharacter_Tick_original(_this, DeltaSeconds); if (_this && _this->TargetingTeamField() >= 50000 && _this->GetForceClaimTime() > 0) { if (_this->GetForceClaimTime() <= static_cast<AShooterGameState*>(ArkApi::GetApiUtils().GetShooterGameMode()->GameStateField())->NetworkTimeField()) _this->Suicide(); } } (edited)
substitute 4/6/2021 8:39 AM
runs every tick though
8:39 AM
can be expensive to attach to tick
Avatar
Avatar
substitute
runs every tick though
if i remember correctly they already check this in tick
8:42 AM
that's where i got the fields from
Avatar
substitute 4/6/2021 8:44 AM
I know
Avatar
but yeah i see your point it could also be triggered on a timer
Avatar
substitute 4/6/2021 8:44 AM
just as general advice
8:44 AM
like calling GAAOC on tick would massacre a server
8:45 AM
you can also do "deferred" ticking in a sense
8:46 AM
something like static ticks = 0; if (ticks == 0) { //do your logic } (++ticks) %= x; (edited)
8:47 AM
where x is max number of ticks to deferr
8:47 AM
e.g. if server is 30 ticks/second then x = 15 would be every half second.
8:48 AM
though if you do that, just use the delta time in the tick event as track it as an actual time-value since ticks are framebased 😉
8:48 AM
static time = 0 if (time == 0) { //logic } time += delta if (time >= x) { time = 0; } (edited)
8:50 AM
This would be optimal in cases where you need time based code to run on the game thread.
Avatar
bWantsServerThrottledTick=True and AActor::ThrottledTick Could probably use it on aprimaldinocharacter
2:29 PM
but have to track ur own time deltas
Avatar
what worked for me was hook into APrimalDinoCharacter_ChangeActorTeam and use: if (_this->GetForceClaimTime() <= static_cast<AShooterGameState*>(ArkApi::GetApiUtils().GetShooterGameMode()->GameStateField())->NetworkTimeField()) _this->Suicide(); (edited)
6:23 PM
i don't know why, but when i try to print any ulong value it always displays 2.95461e+07, i guess i am using the Log->Info inn the wrong way. Thanks everyone for the help
Avatar
Avatar
Uaca
i don't know why, but when i try to print any ulong value it always displays 2.95461e+07, i guess i am using the Log->Info inn the wrong way. Thanks everyone for the help
Try doing Log->info("Value: {}", ulongvar); (edited)
Avatar
you can also convert it to a string and print it that way with std::to_string(YourVar) 🙂
Avatar
substitute 4/6/2021 6:53 PM
Does the logger not support printf formatters?
6:54 PM
6:54 PM
it should
6:54 PM
supports fmt
Avatar
think it should but never tried
6:54 PM
but yeah it formats with fmt
Avatar
substitute 4/6/2021 6:54 PM
looks like {} is implicit
6:54 PM
and it uses type deduction to determine how to print
6:55 PM
but could use like {:d} and get that sweet compile time checking
Avatar
Avatar
Pelayori
Try doing Log->info("Value: {}", ulongvar); (edited)
that is what i am doing, like this: Log::GetLog()->info("_this->NetworkTimeField {}", static_cast<AShooterGameState*>(ArkApi::GetApiUtils().GetShooterGameMode()->GameStateField())->NetworkTimeField());
7:10 PM
always gives the same value 2.95678e+07
Avatar
convert it to a string and try again 😄
Avatar
Avatar
WETBATMAN
convert it to a string and try again 😄
GetForceClaimTime 29585782.584543 much better!
Avatar
That's the same number just fully expanded. That doesn't look right.
7:40 PM
I just printed some test NetworkTime
7:40 PM
[19436] [] NetworkTime 2234.28
7:41 PM
[19436] [] NetworkTime 2241.32
Avatar
pretty sure it depends on your worldsave
7:41 PM
just like WorldTimeSeconds
Avatar
I will test.
7:49 PM
[456] [] NetworkTime 8.87394e+07
7:50 PM
Seems legit. This is as a double btw
Avatar
I want to see and record players taking items from other players' cadaver packs. I've been looking for a long time and I can't find the right hook.
Avatar
Avatar
Tommmmmm
I want to see and record players taking items from other players' cadaver packs. I've been looking for a long time and I can't find the right hook.
there is no "right hook" for this it all depends on how you want to do it
12:02 PM
if i were to do this i'd hook Hook_UPrimalInventoryComponent_AddItem
12:02 PM
and then track when the item is transfered from a character's inventory
Avatar
What should I do if I want to stop him from taking items out of other players' corpses
12:23 PM
Verify that the body is his own. If not, stop him from taking the items
Avatar
you can hook RemoveItem and not call original if it meets your conditions
Avatar
Thank you very much I'm going to figure out how to do that. Okay
Avatar
How do I acquire UPrimalItem* anItemToTransfer making tribeID
Avatar
Avatar
Tommmmmm
How do I acquire UPrimalItem* anItemToTransfer making tribeID
substitute 4/7/2021 7:52 PM
what do you mean?
Avatar
UPrimalItem* anItemToTransfer How do I get TargetingTeamField ()
Avatar
substitute 4/7/2021 7:55 PM
the PrimalInventory should have the owning character
Avatar
item has owner id
7:56 PM
but it's from who crafted it
7:56 PM
you need to get the team id from the inventory comp like Substitute just mentioned
Avatar
substitute 4/7/2021 7:56 PM
There should be a hook when dealing with taking an item from a remote inventory specifically
7:57 PM
that hook should have both inventory components
7:57 PM
This is also where Wildcard checks for ownership for Vaults
7:57 PM
to prevent vault-hacking
Avatar
there is one for opening remote inventory but not sure about transferring (edited)
Avatar
Avatar
WETBATMAN
there is one for opening remote inventory but not sure about transferring (edited)
substitute 4/7/2021 7:57 PM
There's one for transferring
7:57 PM
You used to be able to force remote inventories (for Vaults) to be open
7:58 PM
and steal items with hacks
Avatar
lmao
Avatar
substitute 4/7/2021 7:58 PM
It also used to work on PvE
7:58 PM
with Vaults with offline protection enabled
7:58 PM
😉
7:58 PM
Anyways, look around that area
7:58 PM
they have a LOT with transferring now
7:58 PM
for checks
7:58 PM
they even have LoS now
Avatar
Hook_UPrimalInventoryComponent_RemoteInventoryAllowRemoveItems(UPrimalInventoryComponent* _this, AShooterPlayerController* PC, UPrimalItem* anItemToTransfer, int* requestedQuantity, bool bRequestedByPlayer, bool bRequestDropping)
Avatar
substitute 4/7/2021 8:02 PM
Yeah, that should work
8:03 PM
an inventory transfer checks that prior to allowing it
Avatar
AShooterPlayerController::ServerTransferFromRemoteInventory_Implementation
8:03 PM
ah you want to block viewing ? 😄
Avatar
substitute 4/7/2021 8:03 PM
Na, they don't need to hook that
Avatar
that's easy
Avatar
substitute 4/7/2021 8:03 PM
RemoteInventoryAllowRemoveItems isn't for only blocking viewing
8:04 PM
I believe that's the actual check if you're allowed to transfer at all from the inventory
Avatar
bool Hook_UPrimalInventoryComponent_RemoteInventoryAllowViewing(UPrimalInventoryComponent* _this, AShooterPlayerController* PC, float MaxAllowedDistanceOffset) { if (_this && _this->GetOwner() && PC) { AActor* actor = _this->GetOwner(); if (ProtectCharacters && actor->IsA(AShooterCharacter::StaticClass()) && actor->TargetingTeamField() != PC->TargetingTeamField() && actor->TargetingTeamField() != 0 && actor->TargetingTeamField() >= 50000) return false; } return UPrimalInventoryComponent_RemoteInventoryAllowViewing_original(_this, PC, MaxAllowedDistanceOffset); }
8:04 PM
for my upgraded pve time plugin i just block access to other inventories
Avatar
substitute 4/7/2021 8:04 PM
You don't want to just block viewing
Avatar
I have tested that the hook also works when you transfer items
Avatar
substitute 4/7/2021 8:04 PM
that won't stop people with hacks
8:04 PM
you want to block the actual transfer of items
Avatar
i haven't really had this in mind lol
Avatar
substitute 4/7/2021 8:05 PM
I always write stuff from the perspective of how a cheater would exploit it.
8:05 PM
that way there's no exploits
8:05 PM
agathaWink
Avatar
bool Hook_UPrimalInventoryComponent_RemoteInventoryAllowRemoveItems(UPrimalInventoryComponent* _this, AShooterPlayerController* PC, UPrimalItem* anItemToTransfer, int* requestedQuantity, bool bRequestedByPlayer, bool bRequestDropping) I think this hook prevents hackers from remotely obtaining items
Avatar
well i blocked viewing but i never went as far as to block access to the actual inventory lol
8:07 PM
cause i never made the plugin public
8:07 PM
but it's a good point
Avatar
Avatar
Tommmmmm
bool Hook_UPrimalInventoryComponent_RemoteInventoryAllowRemoveItems(UPrimalInventoryComponent* _this, AShooterPlayerController* PC, UPrimalItem* anItemToTransfer, int* requestedQuantity, bool bRequestedByPlayer, bool bRequestDropping) I think this hook prevents hackers from remotely obtaining items
it prevents opening the inventory
Avatar
Avatar
WETBATMAN
but it's a good point
substitute 4/7/2021 8:07 PM
especially since I never use the normal game's mechanics for opening inventories
8:07 PM
degenkekw
Avatar
This hook is also triggered when you turn on an inventory transfer item
8:12 PM
I tested that the targetingTeamField () returned each time I transferred the item _this was the same targetingTeamField () that I got when I opened Inventory at the beginning
Avatar
which hook
Avatar
Hook_UPrimalInventoryComponent_RemoteInventoryAllowRemoveItems(UPrimalInventoryComponent* _this, AShooterPlayerController* PC, UPrimalItem* anItemToTransfer, int* requestedQuantity, bool bRequestedByPlayer, bool bRequestDropping)
8:13 PM
I tried to get the ID of the owner of each transferred item but kept crashing the server
Avatar
you need to compare the id of the inventory component to the shooter controller
Avatar
Avatar
WETBATMAN
bool Hook_UPrimalInventoryComponent_RemoteInventoryAllowViewing(UPrimalInventoryComponent* _this, AShooterPlayerController* PC, float MaxAllowedDistanceOffset) { if (_this && _this->GetOwner() && PC) { AActor* actor = _this->GetOwner(); if (ProtectCharacters && actor->IsA(AShooterCharacter::StaticClass()) && actor->TargetingTeamField() != PC->TargetingTeamField() && actor->TargetingTeamField() != 0 && actor->TargetingTeamField() >= 50000) return false; } return UPrimalInventoryComponent_RemoteInventoryAllowViewing_original(_this, PC, MaxAllowedDistanceOffset); }
similar to my example here
Avatar
I don't know how to tell if he is transferring the item because he also triggers a hook when he opens the Inventory
Avatar
then you need to hook RemoveItem
8:17 PM
or block access to the inventory heh (edited)
Avatar
If you place an item in the Ark terminal and then take it out its targetingTeamField () will change to 0
Avatar
you shouldn't track by item
8:36 PM
you need to check the inventory component against the character or player controller
Avatar
I want to get the maker of each item taken out but I can't
Avatar
Hello again
2:53 PM
i am trying to figure out how the UShooterCheatManager manager works, this code gives fatal error (edited)
2:53 PM
AShooterGameMode* GameMode = ArkApi::GetApiUtils().GetShooterGameMode(); GameMode->GlobalCommandsCheatManagerField()->DoExit();
2:54 PM
and this one: UShooterCheatManager* shooterCheatManager = GetCheatManagerByPC(player); shooterCheatManager->DoExit();
2:54 PM
does not give error, but it also does not work
2:54 PM
it is not possible to use the UShooterCheatManager from rcon?
Avatar
What error does the global command cheat manager give?
2:55 PM
In fact RCON uses a cheat manager
Avatar
ShooterGameServer.exe!UShooterCheatManager::DoExit() (0x00007ff79842094e) + 5 bytes [e:\build\live326\projects\shootergame\source\shootergame\private\shootercheatmanager.cpp:644]
Avatar
Did you check if it's nullptr?
Avatar
this is when i use ArkApi::GetApiUtils().GetShooterGameMode()->DoExit(); (edited)
2:57 PM
i did not check for nullptr
2:59 PM
thinking about it now, i think getting the UShooterCheatManager from the player controller should not work since the have not used "enablecheats"
Avatar
Avatar
Pelayori
Did you check if it's nullptr?
i will add the check, but if it is null, then the commands wont work either
Avatar
Avatar
Uaca
i will add the check, but if it is null, then the commands wont work either
You could cache the Rcon cheat manager at server startup in a var, and use it when desired
3:06 PM
For example get it on URCONServer::Init
3:06 PM
URCONServer::Init(URCONServer *this, FString *Password, int InPort, UShooterCheatManager *CSheatManager)
3:07 PM
I've never worked with game mode cheat manager
Avatar
Avatar
Uaca
thinking about it now, i think getting the UShooterCheatManager from the player controller should not work since the have not used "enablecheats"
it doesn't matter you can execute any command from any player, even if they don't have admin permissions
3:08 PM
this is how tebex handles it even
Avatar
Well yeah, if you just want the DoExit it'd be easier to get the first player controller in the world and route it trough it
Avatar
you can capture a pointer to the RCON UShooterCheat manager so you don't need a player controller
3:13 PM
you can store the pointer to it by hooking it's init function
3:15 PM
bool __fastcall URCONServer::Init(URCONServer *this, FString Password, int InPort, UShooterCheatManager *CSheatManager)
Avatar
Oh, I see it in my ida and it's a __int64 return (edited)
3:16 PM
But returns inside the function points to a bool yeah
Avatar
it's same if i decompile it
3:16 PM
decompiler guesses types
3:16 PM
btw
Avatar
Avatar
Pelayori
Well yeah, if you just want the DoExit it'd be easier to get the first player controller in the world and route it trough it
i am just trying to learn how to use the UShooterCheatManager, doexit looks easy to call
3:16 PM
the graph or text view is always accurate
Avatar
wait, you guys can decompile the C++?
Avatar
Kinda
3:18 PM
It's with IDA
Avatar
Avatar
Uaca
wait, you guys can decompile the C++?
yes you can decompile the game
Avatar
that is awesome!
3:20 PM
is it with hex Hex Rays IDA?
Avatar
yes you need the x64 version though
Avatar
wow, that is expensive, $365 / year
3:24 PM
UCheatManager* cheat = player->CheatManagerField(); UShooterCheatManager* shooterCheatManager = static_cast<UShooterCheatManager*>(cheat); shooterCheatManager->DoExit(); (edited)
3:25 PM
this one does not do anything, will try to figure out how to use from rcon. thanks for the help!
Avatar
For UShooterCheatManager to work, the player needs to be online for it to work
Avatar
Hi, how do I clear this item on the server according to Iteamid
4:35 PM
😋
Avatar
Avatar
Tommmmmm
Hi, how do I clear this item on the server according to Iteamid
Do you have item ID, and want to remove it from inventory?
Avatar
Yes, but this item can be anywhere like a building or a player
Avatar
You can use RemoveItem, and a function would take FItemID you have
Avatar
Sorry, I'm a newbie so I have ItemID1 and ItemID2 and I don't know how to remove them using RemoveItem
Avatar
You need to create a new FItemNetID
4:57 PM
Example: FItemNetID item_id; item_id.ItemID1 = id1; item_id.ItemID2 = id2; Now on the inventory: inventory->RemoveItem(&item_id, false, false, true, true);
Avatar
Avatar
Uaca
wow, that is expensive, $365 / year
pretty sure most of use use a cracked version
5:46 PM
lol
Avatar
Avatar
Foppa
For UShooterCheatManager to work, the player needs to be online for it to work
do you mean the affected player?
Avatar
And if you're dead set on paying, pretty sure you can email them and they will lower the price. Most software is expensive like that for corporations where if they are caught using cracked software it has heavy fines
Avatar
Avatar
Frigoff
And if you're dead set on paying, pretty sure you can email them and they will lower the price. Most software is expensive like that for corporations where if they are caught using cracked software it has heavy fines
exactly
FeelsGoodMan 1
Avatar
Avatar
Foppa
For UShooterCheatManager to work, the player needs to be online for it to work
UShooterCheatManager is accessed through the player controller not the character
5:49 PM
so it’s impossible to get if the player is offline
Avatar
Avatar
Uaca
this one does not do anything, will try to figure out how to use from rcon. thanks for the help!
does it crash or just doesn’t do anything
5:51 PM
?
Avatar
it does not do anything
5:59 PM
it checks some field on the player controller
5:59 PM
i assume it checks if that particular player is admin
5:59 PM
or if it's from rcon cheat manager it goes through
Avatar
i see, that makes sense!
Avatar
Avatar
WETBATMAN
Click to see attachment 🖼️
is thisfrom IDA?
Avatar
yup
Avatar
that is glorious
Avatar
it is, also the API doesn't have all functions and structs dumped from ark so you might even find new things to add
Avatar
No the cheatmanager can be called with our without the player is admin
6:14 PM
It's just that if you want to use cheatmanager, you need to have aleast one player online
6:15 PM
so best is to use is to loop with the world through all players and just take the first available (edited)
6:15 PM
and then use that player to execute the cheatmanager
6:16 PM
in the end, it's not a "100%" solution, but that's how i find it the only way to do it with the cheatmanager
Avatar
like i explained before you can hook the rcon init and save the pointer to rcon’s cheat manager
6:21 PM
that way you don’t need a player
6:21 PM
and i mentioned that the DoExit function specifically might be checking if the player is admin
Avatar
i am going to try with a chat command:
6:39 PM
UCheatManager* cheat = player->CheatManagerField(); player->AddCheats(true); UShooterCheatManager* shooterCheatManager = static_cast<UShooterCheatManager*>(cheat); shooterCheatManager->DoExit();
6:39 PM
i think the player might keep the enablecheat status 😅
Avatar
Avatar
WETBATMAN
like i explained before you can hook the rcon init and save the pointer to rcon’s cheat manager
i sitll dont know how to do that, will look into it
Avatar
Avatar
Uaca
i sitll dont know how to do that, will look into it
bool __fastcall URCONServer::Init(URCONServer *this, FString Password, int InPort, UShooterCheatManager *CSheatManager)
6:40 PM
hook this function
6:40 PM
you see how it has an argument for UShooterCheatManager?
6:41 PM
create a global variable that's a pointer in your code and then in this hook set the value of your global variable to this argument
6:41 PM
now you have a pointer to UShooterCheatManager for your plugin 😄
Avatar
What was the hook on which a dinosaur baby was born😩
Avatar
Avatar
WETBATMAN
create a global variable that's a pointer in your code and then in this hook set the value of your global variable to this argument
will try, thank you!
Avatar
Avatar
WETBATMAN
like i explained before you can hook the rcon init and save the pointer to rcon’s cheat manager
Oh, damn, didn't saw that sry 🙂
Avatar
Avatar
WETBATMAN
Click to see attachment 🖼️
yeah, good call that is a bIsAdmin check if(bIsRCONCheatManager || PC->bIsAdmin) { if(bIsRCONCheatManager) URCONServer::SetClientMessage(FString::Printf(L"Exiting or whatever...")); GEngine->Exec(UWorldRef, L"Exit"); } (edited)
Avatar
DeluxeGaming 4/9/2021 7:16 PM
I have a question related to .dmp files. Our servers are using GameServerApp and we're having daily crashes. GameServerApp doesn't provide "Crashstacks" the .dmp files look something like this below. Nothing inside them tells me anything related to plugins crashing but the crashes only happen when the plugins are loaded on the server. Does .DMP files generate useful information when attempting to debug and locate the crash issue?
Avatar
Avatar
DeluxeGaming
I have a question related to .dmp files. Our servers are using GameServerApp and we're having daily crashes. GameServerApp doesn't provide "Crashstacks" the .dmp files look something like this below. Nothing inside them tells me anything related to plugins crashing but the crashes only happen when the plugins are loaded on the server. Does .DMP files generate useful information when attempting to debug and locate the crash issue?
GSH | MrOwlSky 4/9/2021 7:20 PM
Depends on the .dmp file and depends on your skill level on being able to read it. They can be very helpful for plugin devs depending on the plugin. But generally speaking if your asking if .dmp files are the best method or way of debugging crashes from a server owner POV then the answer is no. Unless you know what your doing and how to read them you'll have issues and struggle with it. Generally speaking most server owners/admins use crashstacks and not .dmp files but completely depends on the person and their preferences.
Avatar
Avatar
GSH | MrOwlSky
Depends on the .dmp file and depends on your skill level on being able to read it. They can be very helpful for plugin devs depending on the plugin. But generally speaking if your asking if .dmp files are the best method or way of debugging crashes from a server owner POV then the answer is no. Unless you know what your doing and how to read them you'll have issues and struggle with it. Generally speaking most server owners/admins use crashstacks and not .dmp files but completely depends on the person and their preferences.
DeluxeGaming 4/9/2021 7:22 PM
Thank you! that sucks since ours doesnt generate the crash stacks thats very good to know though.
Avatar
bool Hook_UPrimalInventoryComponent_RemoteInventoryAllowViewing(UPrimalInventoryComponent* _this, AShooterPlayerController* PC, float MaxAllowedDistanceOffset) How can I prevent this from happening when the player is invited to join or accept a clan invitation
Avatar
could someone help me, it's been 5 days since i have a crash screen and i don't know which plugin it can be, it doesn't generate log files, some were generated but i don't have access to send here.
Avatar
Avatar
DEX
could someone help me, it's been 5 days since i have a crash screen and i don't know which plugin it can be, it doesn't generate log files, some were generated but i don't have access to send here.
GSH | MrOwlSky 4/10/2021 7:04 PM
What are you using to host your server?
Avatar
A dedicated machine, has 9 Server. More from what I've been seeing the ark made communication saying that it is already correcting, I believe it is from the ark that.
7:11 PM
Hey @Verified, we just wanted to give you an update on the situation with the server crashes. We've been able to identify a possible fix, and our team has been working on it over the past few days. It is currently in the process of being put through its paces by our QA team. So far, their tests have shown that this build is stable, and we've resolved the crash, so we're ready to move onto the next stage. The next stage of this process will involve a slow-roll out of this build where we will update a few servers on PC that are experiencing a high volume of this crash. The reason for this cautious approach is because this crash is related to saved data, and to fix it, we've had to make some changes to how we store specific data on large save files. Due to the technical complexity, we want to make sure we're cautious, especially as it involves saved data. Once the update has rolled out to a few servers, we'll let it sit for a while and monitor the effects and results. We'll better understand whether this has resolved the issue entirely and whether it has introduced any unforeseen side effects. Assuming all goes well and we confident with the patch, we'll plan for a network-wide rollout. We appreciate the patience and understanding everyone has shown while we're dealing with this frustrating issue. Our goal is to have a fix out as soon as possible on all platforms. We'll keep you posted when we have more updates. Cheers!
7:12 PM
I don't know if it's related to that
Avatar
@DEX
9:56 PM
If you can attach a debugger to a server instance
9:56 PM
You can catch the crash right as it happens and view the call stack
9:56 PM
Which should have enough info to figure out what’s crashing
Avatar
How do I attach debugger
Avatar
Visual studio can attach to a process @DEX
Avatar
I want to know the player's Left Tribe hook
6:50 AM
I couldn't find the relevant hook
Avatar
Avatar
Uaca
UCheatManager* cheat = player->CheatManagerField(); player->AddCheats(true); UShooterCheatManager* shooterCheatManager = static_cast<UShooterCheatManager*>(cheat); shooterCheatManager->DoExit();
just to close this, i was able to make this work as everyone said it would, but not for DoExit without admin, that is without rcon
5:52 PM
i always search the discord if someone had the same problem as me, and it is nice to know if it worked or not!
Avatar
i am using this function to get blueprint path: FString GetBlueprint(UObjectBase* object) { if (object != nullptr && object->ClassField() != nullptr) { FString path_name; object->ClassField()->GetDefaultObject(true)->GetFullName(&path_name, nullptr); if (int find_index = 0; path_name.FindChar(' ', find_index)) { path_name = "Blueprint'" + path_name.Mid(find_index + 1, path_name.Len() - (find_index + (path_name.EndsWith( "_C", ESearchCase:: CaseSensitive) ? 3 : 1))) + "'"; return path_name.Replace(L"Default__", L"", ESearchCase::CaseSensitive); } } return FString(""); }
4:58 PM
i got it from the #【🔷】ᴘʟᴜɢɪɴ-ʀᴇꜰꜱ channel, but for the small storage box it gives me: "Blueprint'/Game/PrimalEarth/Structures/StorageBox_Small.StorageBox_Small'" instead of the value at the ARK wiki "Blueprint'/Game/PrimalEarth/CoreBlueprints/Items/Structures/Misc/PrimalItemStructure_StorageBox_Small.PrimalItemStructure_StorageBox_Small'" (edited)
Avatar
PrimalItemStructure's path is the path for the structure's inventory(!) item The other path, is the file path of the structure when it's placed in the map! (edited)
Avatar
i did not knew that! Thank you!
Avatar
You can get the PrimalItemStructure path, though
5:05 PM
FString GetItemStructurePath(APrimalStructure* structure) { UClass* PrimalItem = structure->ConsumesPrimalItemField().uClass; if (PrimalItem) // It might not be valid, as some structures are not placed with items { return GetBlueprint(PrimalItem->GetDefaultObject(true)); } return FString(""); } @Uaca
Avatar
that is nice! thank you!!!
Avatar
How do I set the overhead icon for a player who is not an admin
2:19 PM
😩
Avatar
in chat?
Avatar
nstead of the icon at the front of the chat, the icon near the character's name is similar to the administrator icon
3:19 PM
The icon over the administrator's head
Avatar
Hello everyone. I have the code below: bool Hook_AShooterGameMode_HandleNewPlayer_Implementation(AShooterGameMode* _this, AShooterPlayerController* newPlayer, UPrimalPlayerData* playerData, AShooterCharacter* playerCharacter, bool isFromLogin) { if (!newPlayer) { return AShooterGameMode_HandleNewPlayer_Implementation_original(_this, newPlayer, playerData, playerCharacter, isFromLogin); } const uint64 steamId = ArkApi::GetApiUtils().GetSteamIdFromController(reinterpret_cast<AController*>(newPlayer)); if (!Store::Get().IsPlayerExists(steamId)) { const uint64 playerId = ArkApi::GetApiUtils().GetPlayerID(newPlayer); const FString playerName = ArkApi::GetApiUtils().GetCharacterName(newPlayer); Log::GetLog()->warn("Char name: {}", playerName.ToString()); Store::Get().CreatePlayer(steamId, playerId, playerName.ToString()); } return AShooterGameMode_HandleNewPlayer_Implementation_original(_this, newPlayer, playerData, playerCharacter, isFromLogin); } Here playerName is always Survivor. It worked fine earlier, so maybe it is caused by Ark updates? I have relevant ArkApi version. (edited)
Avatar
Character might not be valid and it's returning a default name
7:49 PM
I've found handle new player only works reliably for getting player's character data when they are not in respawn menu /character creation for obvious reasons
Avatar
Do you know which hook can I use to catch correct player name?
Avatar
You can use AShooterCharacter::BeginPlay but that will trigger for server start (when loading save file) login, respawn, character create... So you would need to filter which players have been already processed
👍 1
7:55 PM
Additionaly you can use AShooterCharacter::PossesedBy that is the same as begin play but will not fire on save file load (edited)
Avatar
Thanks @Pelayori
Avatar
login from transfer or such causes the name to be Survivor (edited)
8:20 PM
or if the player has no character
Avatar
Does anyone know how to get map's size in UE coordinates system (centimetres)? I'm looking for a way to convert UE coordinates to longitude and latitude and found the formula ue_coord / multiplier + 50, but multiplier may be any for non-official maps. Multiplier can be easily determined if we know size of the map, I think, but which method can be used to get the size?
Avatar
How do I change tribe ID
Avatar
Avatar
Tommmmmm
How do I change tribe ID
Tribe id of what?
4:03 AM
I was using AddToTribe to add a player to a already created tribe. FTribeData* CreatedTribeData = static_cast<FTribeData*>(FMemory::Malloc(0x128 + 0x28)); RtlSecureZeroMemory(CreatedTribeData, 0x128 + 0x28); if (GameMode->GetOrLoadTribeData(tribe_id, CreatedTribeData)) shooterPlayerController->GetShooterPlayerState()->AddToTribe(CreatedTribeData, false, false, false, nullptr)) FMemory::Free(CreatedTribeData); It was working, but now, after the players log off and connect again he is not in the tribe, also after the just after executing the AddToTribe, if the player press L to see the tribe it ask to create a new one
4:06 AM
I think i need to force save somewhere, but i am unable to find where, i've already tried: shooterPlayerController->ForceNetUpdate(true, true, true); shooterPlayerController->GetShooterPlayerState()->PreSave(); GameMode->UpdateTribeData(CreatedTribeData); All without success. Any hints of where to start looking to fix this will be greatly appreciated.
Avatar
Avatar
Uaca
I was using AddToTribe to add a player to a already created tribe. FTribeData* CreatedTribeData = static_cast<FTribeData*>(FMemory::Malloc(0x128 + 0x28)); RtlSecureZeroMemory(CreatedTribeData, 0x128 + 0x28); if (GameMode->GetOrLoadTribeData(tribe_id, CreatedTribeData)) shooterPlayerController->GetShooterPlayerState()->AddToTribe(CreatedTribeData, false, false, false, nullptr)) FMemory::Free(CreatedTribeData); It was working, but now, after the players log off and connect again he is not in the tribe, also after the just after executing the AddToTribe, if the player press L to see the tribe it ask to create a new one
One of add to tribe params is bForcetry setting that to true
Avatar
i've tried it get added to the tribe, but when i logoff and login again, the character is not on tribe anymore
Avatar
I haven't had such issues
Avatar
it is a console command, maybe this is the problem?
Avatar
what is odd, is after the player join is added to the tribe, when the player press L, the ask to create a new tribe
Avatar
Yeah not sure, the AddToTribe should be the way to do it properly
4:43 PM
Is the created tribe data valid? Like, its tribe id field is != 0, and it's != nullptr
Avatar
is is a tribe that already exits, but the same problem happens with any tribe
5:29 PM
AddToTribe is returning true
5:29 PM
i will try to create a new tribe to see what happends
5:30 PM
and check the tribe id
Avatar
tribe id is not zero, the created tribe data is valid
6:08 PM
when is a new tribe, the player gets added and it works, only when the player is added to a existing tribe that he losses the tribe on logoff/login
Avatar
when using : PC->GetShooterPlayerState()->AddToTribe(CreatedTribeData, false, true, false, nullptr); PC->GetShooterPlayerState()->UpdateTribeData(CreatedTribeData); on the tribe manager is shows the tribe, without all the players that is progress, but on login/logoff still loses tribe
Avatar
i think something has changed in the recent updates
4:16 AM
if you create a tribe and leave with no player left behind, the .arktribe is auto deleted by the game
Avatar
no even the cheat forcejointribe 0 0 works
Avatar
Avatar
Uaca
no even the cheat forcejointribe 0 0 works
AFAIK joining an empty tribe has never worked
Avatar
jraServerAPI 4/19/2021 12:34 AM
has anyone written a RCon class yet for ArkApi? monkaHmm I'm looking for some help to simply connect to my other maps in my cluster and send a chat message to everyone from my plugin. I understand what is needed in regards to the connection, but I am lost as far as implementing it. A lot of code I have found in my attempts to tackle this is for linux, so I have had zero success. 😕 (edited)
Avatar
Avatar
jraServerAPI
has anyone written a RCon class yet for ArkApi? monkaHmm I'm looking for some help to simply connect to my other maps in my cluster and send a chat message to everyone from my plugin. I understand what is needed in regards to the connection, but I am lost as far as implementing it. A lot of code I have found in my attempts to tackle this is for linux, so I have had zero success. 😕 (edited)
Are you asking about rcon-rcon
1:03 AM
or making your own socket?
Avatar
jraServerAPI 4/19/2021 1:08 AM
just looking for a wrapper class that makes connecting to other servers via Rcon easily, so I can send a global chat message to the cluster from my plugin.. I assume the old fashioned way would be to use sockets.. but I'm not wicked familair with c++.. So I'm thinking there must be an easier way, someone must have alreadsy written this.. ya know a simple ..rcon.connect(), rcon.login(), rcon.senddata() type thing would be great 👨🏫 (edited)
1:10 AM
like a "Hello World" sample? LULW
Avatar
Dino->Suicide();
10:05 AM
I want to kill the dinosaur completely, but I test it in the game and he can only deduct about 1 million health
Avatar
Correct
10:42 AM
Either call it repeatedly while the Dino is alive (edited)
10:42 AM
Or use destroy actor
10:43 AM
Destroy actor won’t spawn a dead body though
Avatar
If I run Dino->Suicide() multiple times, will I achieve the effect of killing dinosaurs?
Avatar
C++ for (int i = 1; i <= 30; i++) { if (!Dino->IsDead()) { Dino->Suicide(); } else if(Dino->IsDead()) { break; } }
Avatar
Okay thank you
11:00 AM
Does the api have a flying dinosaur to grab the player's hook?
11:01 AM
I did not find this hook
Avatar
Avatar
Tommmmmm
C++ for (int i = 1; i <= 30; i++) { if (!Dino->IsDead()) { Dino->Suicide(); } else if(Dino->IsDead()) { break; } }
this would be better
9:14 PM
do Dino->Suicide(); while(!Dino->IsDead()); (edited)
Avatar
Good thank you
Avatar
How to get the dinosaur level😩
Avatar
const auto status_component = dino->MyCharacterStatusComponent; const auto base_character_level = status_component->BaseCharacterLevel; const auto extra_character_level = status_component->ExtraCharacterLevel; const auto total_level = base_character_level + extra_character_level;
6:49 AM
Is what I use and it works for me
6:49 AM
@Tommmmmm
Avatar
thank you very much
7:03 AM
c++ UPrimalInventoryComponent* inventory = shooter_pc->GetPlayerCharacter()->MyInventoryComponentField(); TArray<UPrimalItem*> items = inventory->ArkTributeItemsField(); for (UPrimalItem* item : items) { if (item->ClassField() != nullptr) { Log::GetLog()->error(std::to_string(item->ItemIDField().ItemID1)+"-"+ std::to_string(item->ItemIDField().ItemID2)); inventory->RemoveItem(&item->ItemIDField(), false, false, true, true); } }
7:03 AM
I have no effect
Avatar
I cannot delete an item that has been uploaded
10:05 AM
item->RemoveItemFromArkTributeInventory();
10:05 AM
I used this to no avail
Avatar
I don’t think base ark can either, if you want to stop people downloading. Hook that and if they remove it. Check what they are removing if it’s bad delete it
Avatar
Avatar
Tommmmmm
How to get the dinosaur level😩
APrimalDinoCharacter* dino; dino_level = dino->GetCharacterStatusComponent()->GetCharacterLevel();
Avatar
Is there a way to catch player's logout and disconnect (I mean any reason - crash, ...)? Hook for logout isn't called when I just kill client process or it is crashed
Avatar
Avatar
DevCPP
Is there a way to catch player's logout and disconnect (I mean any reason - crash, ...)? Hook for logout isn't called when I just kill client process or it is crashed
crash has a timeout period of like 5 min before it disconnects
6:22 PM
but as far as i know it does call LogOut
Avatar
So it will call logout 5 min after crash anyway?
Avatar
after you crash the game considers you as online for sometime (this is why some players get the "this account is already connected to this server" error)
6:24 PM
after the time passes it call LogOut
Avatar
Thanks
Avatar
LogOut removes the player from player count, it's impossible for it to not be called
Avatar
NeO_Anderson 4/23/2021 1:55 AM
anyone familiar with SafeZones plugin?
Avatar
jraServerAPI 4/23/2021 9:55 PM
Avatar
@NeO_Anderson you mean like as a developer or as an end user?
Avatar
NeO_Anderson 4/24/2021 1:25 PM
@WETBATMAN end user
1:26 PM
but i managed to figure out how it works now. as it only required 1 coordinate, how does it now the area of the base to protect, but I see now its based on radius, so its okay thx
Avatar
AActor* Actor = player->GetPlayerCharacter()->GetAimedActor(ECollisionChannel::ECC_GameTraceChannel2, nullptr, 0.0, 0.0, nullptr, nullptr, false, false);
1:44 PM
Why is the error displayed
Avatar
I got the code from Arkapi but I don't know why it's wrong.
Avatar
FHitResult Result; player->GetPlayerCharacter()->GetAimedActor(&Result, ECollisionChannel::ECC_GameTraceChannel2,0.0, 0.0, false, false); AActor* Actor= Result.GetActor(); Log::GetLog()->warn("2"); I tried to write this but it crashed the server
Avatar
Avatar
Tommmmmm
FHitResult Result; player->GetPlayerCharacter()->GetAimedActor(&Result, ECollisionChannel::ECC_GameTraceChannel2,0.0, 0.0, false, false); AActor* Actor= Result.GetActor(); Log::GetLog()->warn("2"); I tried to write this but it crashed the server
jraServerAPI 4/27/2021 2:51 AM
My guess would be that you need to test that variable "Result" first to make sure it's not null, before you use it?
Avatar
It’s not wrong, he needs to allocate enough space for hit result
3:37 AM
The struct in the api isn’t sized appropriately at all.
Avatar
I solved the problem thank you
6:57 AM
I'm now wondering if the API will enable forced taming of dinosaurs
Avatar
Is it possible to declare a hook for a specific mod function. Like change a regular dino to the aberrant Kraken mod version?
Avatar
Avatar
Batuque
Is it possible to declare a hook for a specific mod function. Like change a regular dino to the aberrant Kraken mod version?
Yes but it’s advanced and requires hooking a blueprint function
Avatar
I see, where can I get started so I can get an idea?
Avatar
You need to hook process event
7:01 AM
And filter he event to the blueprint ufunction
Avatar
I am guessing there isn't a tutorial for that.
7:02 AM
How do I find the hooks in the kraken mod?
7:04 AM
I think that is the part that is puzzling me. Are there hooks in the kraken mod or I got to use the one in the API to modified the kraken mod?
Avatar
Avatar
Batuque
Is it possible to declare a hook for a specific mod function. Like change a regular dino to the aberrant Kraken mod version?
you don't need a plugin for this, you can just swap the dino class within the game server config
Avatar
Avatar
Batuque
I think that is the part that is puzzling me. Are there hooks in the kraken mod or I got to use the one in the API to modified the kraken mod?
everything in a mod is virtualized, you can place a logger inside the ProcessEvent function to see all the bp functions that are called, but unless you know the name of the function you're looking for you won't find much
Avatar
@WETBATMAN got it. Thank you all for the info.
Avatar
Avatar
Batuque
@WETBATMAN got it. Thank you all for the info.
The ARK: Survival Evolved dedicated server has a wide variety of configuration options that control its behavior and adjust many aspects of the game. These are options that can only be set at server startup. Most options can be specified on the command line when launching the server or in the server's configuration files. Options that must be sp...
11:18 AM
search npcreplacement here
11:18 AM
NPCReplacements=(FromClassName="<classname>", ToClassName="<classname>")
Avatar
int PointsMounts = ArkShop::Points::GetPoints(steamid); I want to get the points in Arkshop but I can't get them
Avatar
Avatar
Tommmmmm
int PointsMounts = ArkShop::Points::GetPoints(steamid); I want to get the points in Arkshop but I can't get them
What error do you get?
Avatar
I found the reason, my JSON reading error
Avatar
How do I modify the base value of the dinosaur
Avatar
how would one go about changing the base stats of a dino? I tried the Dino->MyCharacterStatusComponentField()->SetMaxStatusValue() But it doesn't save
Avatar
Well with that you are not selecting what you want to update
12:39 PM
dino->MyCharacterStatusComponentField()->SetMaxStatusValue(EPrimalCharacterStatusValue::Health, 100)
12:39 PM
namespace EPrimalCharacterStatusValue { enum Type { Health = 0x0, Stamina = 0x1, Torpidity = 0x2, Oxygen = 0x3, Food = 0x4, Water = 0x5, Temperature = 0x6, Weight = 0x7, MeleeDamageMultiplier = 0x8, SpeedMultiplier = 0x9, TemperatureFortitude = 0xA, CraftingSpeedMultiplier = 0xB, MAX = 0xC, }; }
Avatar
Avatar
Tommmmmm
how would one go about changing the base stats of a dino? I tried the Dino->MyCharacterStatusComponentField()->SetMaxStatusValue() But it doesn't save
to modify base stats you need to modify how many levels there are in that stat, this is the only way because the game only saves how many points are in a stat and reads that when the savefile is loaded
12:54 PM
if you don't want to do this then you'll have to make a level db system yourself and apply the stat each time the dino resets it
Avatar
Avatar
Foppa
Well with that you are not selecting what you want to update
This allows temporary changes but does not save
Avatar
Avatar
WETBATMAN
to modify base stats you need to modify how many levels there are in that stat, this is the only way because the game only saves how many points are in a stat and reads that when the savefile is loaded
I don't know what to do. Can you send me an example?
1:03 PM
I searched the Arkapi website but I didn't find any code related to this
Avatar
Avatar
WETBATMAN
to modify base stats you need to modify how many levels there are in that stat, this is the only way because the game only saves how many points are in a stat and reads that when the savefile is loaded
Wouldn't just a netupdate do the trick ?
Avatar
Avatar
Foppa
Wouldn't just a netupdate do the trick ?
no, because the game doesn’t save the raw stat
1:11 PM
it saves how many level points are inside it
1:12 PM
then on server start it will scale the stat by multiplying the value per level by how many levels are in the stat
1:13 PM
you can set the raw stat but once the dino is off the map (stasis) it will get reset
Avatar
Hmm.. alright thought it did. Well that kind of makes it a bit unnecessary complicated 😛 (edited)
Avatar
Avatar
Foppa
Hmm.. alright thought it did. Well that kind of makes it a bit unnecessary complicated 😛 (edited)
it makes you able to change per stat multipliers mid season though heh
1:23 PM
cause the game will rescale it
Avatar
What should I do😩
Avatar
Avatar
Tommmmmm
What should I do😩
you need to change stat points to make your changes persist on a dino
Avatar
Can I add property points to a property
1:32 PM
Let's say I add an attribute point to health and then I add a point to this dinosaur.
Avatar
https://discord.com/channels/513432877904691202/513822106639794196/703657529053413456 @WETBATMAN I found the code you sent from the history message I didn't understand how to control the status of a dinosaur by adding or subtracting points
Avatar
NeO_Anderson 5/4/2021 2:00 PM
does anyone use or familiar with 'ArkHomes' plugin? for some reason this plugin seems to be crashing the server randomly unfortunately. It seems be at the point of teleporting us back to our /home location. is there is any known fix/work around at all beyond removing the plugin?
Avatar
How do I hook the dinosaur clone I used BeginPlay but when the cloned dinosaur appears _this is the cloned dinosaur
Avatar
What I can confirm now is that cloned dinosaurs cannot be determined by Beginplay
Avatar
This is wrong for Isclonedino, the cloned dinosaur obtained under Beginplay hook. It depends on the dinosaur being cloned, not the dinosaur that has just been cloned. And the name of the dinosaur cloned under Beginplay also depends on the cloned dinosaur and will be consistent. If the cloned dinosaur name does not contain a clone, the _this name will have no clone
10:17 PM
It makes it difficult for me to judge dinosaurs that have been cloned. Do you have any other sources of information about cloning dinosaurs?😩
Avatar
I'm afraid cloning happens inside the cloner blueprint code, so it is hard for us to modify things with it
10:18 PM
You could hook UObject_ProcessEvent, but you will need to get the function name and parameters for the clone function. You can do so if you have the ARK Dev Kit
Avatar
I would like to prevent some dinosaurs from being cloned, but the API seems to be hard to do😭
Avatar
I have done such thing, but it is kind of difficult, I used ProcessEvent
Avatar
Dinosaurs that are cloned will be renamed. Maybe it could be done if the hooker dinosaur changed its name
Avatar
Maybe, let me find the code I used
Avatar
Okay, I've been testing this clone for a long time.😭
Avatar
DECLARE_HOOK(UObject_ProcessEvent, void, UObject*, UFunction*, void*); void Hook_UObject_ProcessEvent(UObject* _this, UFunction* Function, void* Parameters) { if (!Function) return; FString name; Function->NameField().ToString(&name); if (name.Find(L"NetExec") != -1 && GetBlueprint(_this).Find(L"TekCloningChamber") != -1) { BPParams::BPServerHandleNetExec_Params* params = static_cast<BPParams::BPServerHandleNetExec_Params*>(Parameters); if (params != nullptr && params->FromPC && params->CommandName.ToString().Find(L"Clone") != -1) { APrimalDinoCharacter* dino = static_cast<APrimalDinoCharacter*>(params->ExecParams.ObjParam1); if (dino && dino->bNeutered()()) { GET_MESSAGE("CannotCloneNeutered"); UTILS.SendNotification(static_cast<AShooterPlayerController*>(params->FromPC), disp_color, disp_scale, disp_time, nullptr, *msg); return; // If you return, dino won't be cloned. } } } } (edited)
10:31 PM
I use that, you need to change the UFunction* definition to struct UFunction : UObject
10:31 PM
struct __declspec(align(8)) BPServerHandleNetExec_Params { APlayerController* FromPC; FName CommandName; FBPNetExecParams ExecParams; bool ReturnValue; };
10:32 PM
You can find GetBlueprint function in #【🔷】ᴘʟᴜɢɪɴ-ʀᴇꜰꜱ
10:32 PM
@Tommmmmm
Avatar
Thank you very much🥰
Avatar
Are you trying to prevent clone for SS/S+ cloner too?
10:33 PM
For SS/S+ this won't work, there is another way
Avatar
Avatar
Pelayori
DECLARE_HOOK(UObject_ProcessEvent, void, UObject*, UFunction*, void*); void Hook_UObject_ProcessEvent(UObject* _this, UFunction* Function, void* Parameters) { if (!Function) return; FString name; Function->NameField().ToString(&name); if (name.Find(L"NetExec") != -1 && GetBlueprint(_this).Find(L"TekCloningChamber") != -1) { BPParams::BPServerHandleNetExec_Params* params = static_cast<BPParams::BPServerHandleNetExec_Params*>(Parameters); if (params != nullptr && params->FromPC && params->CommandName.ToString().Find(L"Clone") != -1) { APrimalDinoCharacter* dino = static_cast<APrimalDinoCharacter*>(params->ExecParams.ObjParam1); if (dino && dino->bNeutered()()) { GET_MESSAGE("CannotCloneNeutered"); UTILS.SendNotification(static_cast<AShooterPlayerController*>(params->FromPC), disp_color, disp_scale, disp_time, nullptr, *msg); return; // If you return, dino won't be cloned. } } } } (edited)
this is very inefficent
10:34 PM
you should track functions by internal index
10:34 PM
not name
Avatar
How do you get those internal indexes
10:35 PM
i bind index to function in my HWIDBans
10:35 PM
i find the function index on server boot
Avatar
Well I didn't know that 🙂
Avatar
std::unordered_map<int, std::any> FuncMap;
10:36 PM
this is useful because maps have no lookup time
10:37 PM
so you're basically not adding anything to the process event function
Avatar
Thanks, I will implement that 👍
10:37 PM
I'll probably push a PR for the UFunctions then
Avatar
btw, there is a dedicated server function for NetExecs
Avatar
I searched for it but couldn't find anything so asummed it was bp only
Avatar
yes it's bp but it has a c++ version too
10:39 PM
they have a generic struct they pass parameters in for NetExec
10:39 PM
ah ye i see you've used it in your code
Avatar
Yeah since the dino to clone and player controller are passed as params
Avatar
bool __fastcall AActor::BPServerHandleNetExecCommand(AActor *this, APlayerController *FromPC, FName CommandName, FBPNetExecParams *ExecParams)
10:41 PM
this function was what i meant heh
Avatar
Oh I swear I searched for it in IDA and didn't find it
10:42 PM
Thanks!
10:42 PM
@Tommmmmm Take a look at what Wet said, it's a better way than mine
Avatar
These are too difficult for me and I need time to study them😩
Avatar
For the SS/S+ cloning chambers I catch the try multiuse and sleep the dino so it isn't valid for clone
10:44 PM
Basically the BPServerHandleNetExecCommand is called from a tek cloning chamber, to start the dino clone process
Avatar
It's harder than I thought😩
Avatar
Why can't I send pictures
9:15 AM
😩
Avatar
bool __fastcall AActor::BPServerHandleNetExecCommand(AActor *this, APlayerController *FromPC, FName CommandName, FBPNetExecParams *ExecParams)我在api中没有找到这个钩子 我应该怎么使用它
Avatar
I can't find any information about this hook in the API
Avatar
Avatar
Tommmmmm
I can't find any information about this hook in the API
not all functions exist in the API
11:58 AM
you can write a hook for it yourself
Avatar
lol im already working on a cloning plugin though 😦
Avatar
2 different implementations are always good
Avatar
yea, nothing wrong with that, was mainly joking
4:24 PM
@WETBATMAN Would you mind sharing your BPParams class?
Avatar
FBPNetExecParams this?
Avatar
BPParams::BPServerHandleNetExec_Params
Avatar
That's actually mine 😛
4:26 PM
all ive got is struct FNetExecParams {}; lol
Avatar
struct __declspec(align(8)) BPServerHandleNetExec_Params { APlayerController* FromPC; FName CommandName; FBPNetExecParams ExecParams; bool ReturnValue; };
4:27 PM
And struct FBPNetExecParams { int IntParam1; int IntParam2; int IntParam3; float FloatParam1; float FloatParam2; float FloatParam3; UObject *ObjParam1; UObject *ObjParam2; UObject *ObjParam3; FString StringParam1; };
Avatar
beautiful, ty
Avatar
Avatar
Kal
beautiful, ty
you can also resolve these at run time
10:20 AM
You might prefer to do this as each BP Func has different Params
10:20 AM
and are passed around as void*
Avatar
AShooterCharacter::BeginPlay How can I tell if the player is logged in with this hook
Avatar
jraServerAPI 5/11/2021 10:19 PM
I wanted to share this in #【🤹】ʀᴇꜰᴇʀᴇɴᴄᴇꜱ but I do not have permissions, but here is some raw code that puts a dino in a cryopod, with saddle. Most if not all of the credit goes to Peyalori on this one, I was just his motivator 7739_CrookedSmile . Thank you buddy. (edited)
Avatar
Avatar
jraServerAPI
I wanted to share this in #【🤹】ʀᴇꜰᴇʀᴇɴᴄᴇꜱ but I do not have permissions, but here is some raw code that puts a dino in a cryopod, with saddle. Most if not all of the credit goes to Peyalori on this one, I was just his motivator 7739_CrookedSmile . Thank you buddy. (edited)
GSH | MrOwlSky 5/12/2021 1:40 AM
Any Mentors and ranks above can repost it for you. It's restricted from Beginners role to prevent spam or false code.
Avatar
Avatar
jraServerAPI
I wanted to share this in #【🤹】ʀᴇꜰᴇʀᴇɴᴄᴇꜱ but I do not have permissions, but here is some raw code that puts a dino in a cryopod, with saddle. Most if not all of the credit goes to Peyalori on this one, I was just his motivator 7739_CrookedSmile . Thank you buddy. (edited)
you should create a structure to hold your args and take a pointer to that
1:41 AM
having that many args isn't the best
1:42 AM
args are generally stored in registers when a function is called, but there are only so many general purpose registers. Excess (or large) args are pushed directly to the stack.
1:44 AM
so it would become something like this bool GiveDinoInACryoPod(AShooterPlayerController* player_controller, DinoData* creation_data); where DinoData is something like struct { std::string blueprintDino std::string blueprintDinoSaddle int level bool bIsNeutered } DinoData
1:44 AM
this will also let the caller work on the DinoData structure before/after the function call in it's own stack frame and do all kinds of things / reuse the same memory
1:45 AM
this prevents excess data coping
1:45 AM
having a struct also allows for people to create functions that return a struct of DinoData to then pass to GiveDinoInACryoPod
1:46 AM
e.g. you want to generate a dino with a randomized level (and always neutered) (edited)
1:46 AM
DinoData RandomDino(std::string&& dino_blueprint, std::string&& saddle_blueprint)
1:48 AM
(these helper functions can also be inlined (and probably will be by an intelligent optimizer) giving another performance gain)
Avatar
Avatar
substitute
you should create a structure to hold your args and take a pointer to that
jraServerAPI 5/12/2021 2:51 AM
Thank you, very good information I was not aware of
Avatar
jraServerAPI 5/12/2021 4:53 AM
I've updated my example
Avatar
I did not find GetDinoData in my Aprimaldinocharacter Can you hand it out,
Avatar
I found this in the latest API
10:12 AM
thank you
Avatar
Avatar
WETBATMAN
bool __fastcall URCONServer::Init(URCONServer *this, FString Password, int InPort, UShooterCheatManager *CSheatManager)
I'll be doing a PR for this soon but the API will be able to supply it. ArkApi::GetApiUtils().GetCheatManager(); (edited)
ThankYou 2
Avatar
Avatar
Lethal
I'll be doing a PR for this soon but the API will be able to supply it. ArkApi::GetApiUtils().GetCheatManager(); (edited)
nice one, should make stuff easier
Avatar
hi can i make an plugin request here? maybe someone can make a special plugin i need?
Avatar
I would say no, there is ways on the API Site for you to that 🙂
Avatar
Has anyone encountered error code 998 on plugin load before? It's not one I have seen and I don't know of a good reference for the error codes. Any help would be appreciated 🙂
Avatar
If I’m getting Last Remote Function Spike_Raise_Visual as a plug-in crash anyone know of best way to ID which one it is ?
Avatar
Is it right to assume the ark crash files are any good to work it out for someone or does it require a more advanced Visual studio debugging session ?
Avatar
Hello, I'm actually searching a plugin that can fix all the transfer crash we can get while travelling between the differents servers of a cluster (If player is overloaded by items / engrams learned). I saw the Smooth Transfer plugin from woolypenguin but someone know another one ? Thank you in advance
Avatar
ItemsPlus by @Lethal
Avatar
Thank you @Foppa
Avatar
Are there problems with hooking and console commands since Gen2? i seem to be having problems. https://i.imgur.com/OveReHk.png
Avatar
Atomicskullz 6/7/2021 2:18 PM
try to follow the trace
2:18 PM
it gives the line numbers
Avatar
Avatar
Atomicskullz
it gives the line numbers
Any tips because it's just a generic Error all i do is call a console command
Avatar
Atomicskullz 6/7/2021 5:12 PM
Does it trace back to your code?
Avatar
Avatar
Natsu
Any tips because it's just a generic Error all i do is call a console command
would be easier to debug if your ArkShop.dll had a pdb file too
Avatar
Avatar
WETBATMAN
would be easier to debug if your ArkShop.dll had a pdb file too
Yea Lethal also told me that but i dont know what the PBD does 😄
Avatar
it contains symbols from the .dll so that in case of a crash it will tell you the function and the exact line that crashed it
Avatar
Yea it did
5:25 PM
This time* did indeed but it's just a simple console command
Avatar
so what line does it crash on and what file? is it your own custom ArkShop?
Avatar
Avatar
WETBATMAN
so what line does it crash on and what file? is it your own custom ArkShop?
hold on server is booting, And yes but not much changed
5:38 PM
just normal buyitem that crashed it
5:43 PM
In Store.cpp Number 27 : const unsigned price = item_entry["Price"];
Avatar
Item entry is missing the json entry "Price"
👍 1
Avatar
your correct lol
Avatar
jraServerAPI 6/7/2021 6:12 PM
I'm trying to add a custom folder to a structure via my plugin, but it always crashes. Has anyone had any luck creating custom folders? It seems like it should be an easy thing to do 🤷‍♂️ c++ void CreateFolderTest(APrimalStructureItemContainer* _this) { UPrimalInventoryComponent* inv = _this->MyInventoryComponentField(); if (inv) { inv->AddCustomFolder(L"MYTESTFOLDER", 512); } } Thank you in advance
Avatar
jraServerAPI 6/7/2021 8:11 PM
I made it a chat command for easy testing and I also tried allocatiing the memory for the FolderName, but it still crashes on the call to AddCustomFolder c++ void MakeFolderCmd(AShooterPlayerController* player_controller, FString* message, int mode) { AActor* Actor = getAimedActor(player_controller); // make sure we have a structure if (Actor && Actor->IsA(APrimalStructure::GetPrivateStaticClass())) { APrimalStructure* objStructure = static_cast<APrimalStructure*>(Actor); UPrimalInventoryComponent* objInventory = nullptr; if (objStructure->IsA(APrimalStructureItemContainer::GetPrivateStaticClass())) { APrimalStructureItemContainer* objStructureIC = static_cast<APrimalStructureItemContainer*>(objStructure); objInventory = objStructureIC->MyInventoryComponentField(); FString* myFolderName = static_cast<FString*>(FMemory::Malloc(sizeof(FString))); RtlSecureZeroMemory(myFolderName, sizeof(FString)); myFolderName->Append("TEST"); objInventory->AddCustomFolder(*myFolderName, 512); FMemory::Free(myFolderName); } } }PepeHands (edited)
Avatar
Atomicskullz 6/7/2021 8:55 PM
is there any function to get all the players? (edited)
Avatar
Avatar
Atomicskullz
is there any function to get all the players? (edited)
all online or all from the savefile?
Avatar
Atomicskullz 6/7/2021 8:58 PM
all online
Avatar
TArray<AShooterPlayerController*> GetAllPlayerControllers() { TArray<AShooterPlayerController*> ControllerMap; const auto& PCS = ArkApi::GetApiUtils().GetWorld()->PlayerControllerListField(); for (TWeakObjectPtr<APlayerController> APC : PCS) { AShooterPlayerController* PC = static_cast<AShooterPlayerController*>(APC.Get()); if (PC) ControllerMap.Add(PC); } return ControllerMap; }
9:03 PM
here
Avatar
Atomicskullz 6/7/2021 9:08 PM
ah ok cool, thanks
Avatar
Atomicskullz 6/7/2021 10:37 PM
What are the "Controller" structs supposed to represent? Handles? ex. AShooterPlayerController
Avatar
Avatar
Atomicskullz
What are the "Controller" structs supposed to represent? Handles? ex. AShooterPlayerController
controller is what handles replication etc... for players
10:39 PM
the client only stores 1 player controller (for the local player)
10:39 PM
the server stores all player controllers for all players
Avatar
Atomicskullz 6/7/2021 10:48 PM
Replication? You mean when stuff is replicated using the Tek Replicator?
Avatar
Avatar
Atomicskullz
Replication? You mean when stuff is replicated using the Tek Replicator?
Replication means the action of sending info from the client to the server and viceversa
Avatar
Atomicskullz 6/7/2021 10:49 PM
Oh you mean that net stuff? So used to the source engine
Avatar
Although replication is often, if not always, from server to clients. Clients won't send the new replicated values (for example a variable) to the server
10:50 PM
But you can multicast a variable from the server and all clients will get it
10:50 PM
So yeah, net stuff kinda
Avatar
Atomicskullz 6/7/2021 10:52 PM
Oh I didnt know you could handle client-side stuff with plugins. Unless its server-side only, and you can only send messages to the client?
Avatar
We are limited on what we can do with just server side plugins, but some values which are replicated can be changed and replicated to clients (edited)
Avatar
Atomicskullz 6/7/2021 10:53 PM
So you intercept them?
10:53 PM
When its client-to-server
Avatar
As I said client to server is unlikely to happen, if something you would intercept server-client
Avatar
So.. is there still any beginners guide?
1:23 AM
Nvm, just found out i needed the beginners role to see tutorials channel. Sry
Avatar
Hello! Is there a place for the Shop, Currency, and Kits plugin? Im looking for possible already made Json files that I can add to for my servers 🙂
Avatar
Not really no, you have to be creative 🙂
Avatar
Is it possible to get a Dev Role to publish my plugin? I can only add resource to "Atlas: Free Plugins"
👍 1
Avatar
jraServerAPI 7/14/2021 6:40 PM
1136_ouch_my_pp
Avatar
Do you think it's possible to add /upgrade à plugin to use multi thread when using a saveworld command
Avatar
Possible, might be. Easy, not at all
Avatar
I think it would be very useful
Avatar
Oh yeah don't get me wrong I'd love it but there was an attempt already and was deemed to be unstable
Avatar
Ashame that ark never figured out to do it or split in different save like one for creature, one for the map and on for player
2:44 PM
The size of the save would have been very small
2:44 PM
So less lag during it (edited)
Avatar
Hello, where can I report an error that is happening to me with arkshop? every time someone tries to buy a maewing mount, the server crashes
Avatar
Post it on the shop discussion thread in the forum (edited)
Avatar
thank yo
Avatar
Avatar
Shadow
Ashame that ark never figured out to do it or split in different save like one for creature, one for the map and on for player
Be the change you want to see
6:28 PM
Create a custom save format and override the save function
7506_feelssmartman 1
Avatar
Sorry stupid question 🙂 (edited)
Avatar
I believe you need 1 in those stats
Avatar
Hey, do you think it's possible to do a plugin to use level to use things like structure, dino, weapons ?
Avatar
Yep, I have a private plugin that does that with structures and weapons
Avatar
on your discord ?
Avatar
No, one I made a while ago
Avatar
oh i really need it 🙂
2:26 PM
are you going to add it ?
Avatar
Avatar
Pelayori
No, one I made a while ago
?
Avatar
No I don't plan on it
Avatar
불가리스 7/31/2021 3:29 AM
hi. Is there a hook when item craft is completed in structure? I'm trying to make a part that reproduces when the item craft is complete.
Avatar
불가리스 7/31/2021 4:42 AM
Never mind. I solved it.
Avatar
Rogue Leader 8/4/2021 3:02 AM
Has anyone had issues with their plugins stalling the server since the 3.52 update?
3:03 AM
I recompiled mine on 3.52 and Permission 1.8 source code and it's seeming to cause some people stalls that I can't replicate
Avatar
Rogue Leader 8/4/2021 3:34 AM
God I wish there was a Java port. I would have annotations for all kinds of performance data and monitoring
Avatar
Rogue Leader 8/4/2021 4:43 AM
@Foppa I added a ton of debugging and can confirm my code is hanging making this call: TArray<uint64> nppAdminArray; FString NPPAdminGroup; NPPAdminGroup = FString(ArkApi::Tools::Utf8Decode(NPP::config["General"]["NPPAdminGroup"]).c_str()); nppAdminArray.Empty(); nppAdminArray.Append(Permissions::GetGroupMembers(NPPAdminGroup));
4:43 AM
And it only seems to happen with a timer: API::Timer::Get().DelayExecute(&LoadNppPermissionsArray, 60);
4:43 AM
That triggered 1 minute after the server launched
Avatar
If you are trying to cache stuff locally permissions has caching built in so probably best to just make the normal calls to check now.
Avatar
Rogue Leader 8/4/2021 5:20 AM
I'll give that a try. I had to implement my own in the past because thousands of damage events in a second were stalling the server from permissions queries
5:26 AM
Is void RecurringExecute(const Func& callback, int execution_interval, int execution_counter, bool async, Args&&... args) a good alternative to ArkApi::GetCommands().AddOnTimerCallback() if I don't want the callback fired every second?
Avatar
Avatar
Rogue Leader
I'll give that a try. I had to implement my own in the past because thousands of damage events in a second were stalling the server from permissions queries
I would use the timer callback and keep track of time and use difftime to check if enough time has passed otherwise just return.
5:40 AM
void TimedLoop() { if (difftime(time(0), LastTimedLoop) >= 10) //10 seconds between { //your processing here //your processing here LastTimedLoop = time(0); //reset time } }
🍴 1
Avatar
Rogue Leader 8/4/2021 5:41 AM
Yea, that's what I do now, just curious if the time calculations every second take a performance hit
5:47 AM
void TimeLoop { auto diff = std::chrono::duration_cast<std::chrono::seconds>(next_player_update - std::chrono::system_clock::now()); if (diff.count() <= 0) { // do things next_player_update = std::chrono::system_clock::now() + std::chrono::minutes(PlayerUpdateIntervalInMins); } }
Avatar
Avatar
Rogue Leader
And it only seems to happen with a timer: API::Timer::Get().DelayExecute(&LoadNppPermissionsArray, 60);
I'm having stall issues with a plugin using delay exec too, seems it is the delay exec
Avatar
Rogue Leader 8/4/2021 4:50 PM
@Pelayori I ended up removing mine. I had added it in the past when I needed the permissions dll loaded to configure my cached permissions. I removed it last night and it seems to be working fine now. It would be nice if there was a priority option for what order plugins loaded.
Avatar
You could hook InitGame, then do any startup tasks there, or add a timer callback, process stuff (since the first call will be done at full server startup) and then remove the timer cbk
4:51 PM
The latter is what delay exec does but easier lol
4:51 PM
I'm not sure why delay exec does that now
Avatar
Guanarteme 8/7/2021 7:54 PM
@Michidu Hello, your ark adverts plugin is not working Advert.Reload
Avatar
Most likely needs an update :p
10:43 PM
10:43 PM
@Guanarteme Try with these, i have re-compiled it with the latest API
Avatar
There's also a 2nd option which is my Advanced Messages plugin :p
Avatar
Avatar
Foppa
@Guanarteme Try with these, i have re-compiled it with the latest API
thank you
Avatar
Avatar
Pelayori
There's also a 2nd option which is my Advanced Messages plugin :p
thank you
Avatar
🐨Dream Doctor🦘 8/12/2021 11:41 AM
Anyone have a quick tip on why two of our servers are stalling at this point during startup? Nothing has changed that we can find. When the plugin system is disabled the maps start fine, re-enable and they stall again.
Avatar
Not sure if it's related, but I'm investigating an issue with my Wild Dino spawn control plugin
Avatar
Avatar
🐨Dream Doctor🦘
Anyone have a quick tip on why two of our servers are stalling at this point during startup? Nothing has changed that we can find. When the plugin system is disabled the maps start fine, re-enable and they stall again.
Are you using any of the api utils get blueprint function?
Avatar
I'm looking to possibly get my hands on the ArkAPI 3.53beta that addresses some hang/crash issues? @Pelayori Was it you that was working on something like that?
Avatar
Yes, it's 3.53 we are testing
Avatar
Where can i get 3.53?
Avatar
Not released yet, can compile from source if you want it for now
Avatar
yes please
8:28 PM
3.52 is causing multiple hungs a day
Avatar
Is possible to add just an item to drop to a boss without changing the reste of what he drops ?
Avatar
Avatar
Shadow
Is possible to add just an item to drop to a boss without changing the reste of what he drops ?
substitute 9/7/2021 7:21 PM
Hook the boss on death and append the item to the inventory
Avatar
I've seen this mod in the workshop and I was wondering if an equivalent could be doable using the API? https://steamcommunity.com/sharedfiles/filedetails/?id=2533425164
Avatar
substitute 9/7/2021 7:23 PM
No as that requires client side changes
Avatar
yes but since it's a just a sprite on screen
7:23 PM
I thought maybe there's a way with the API
7:24 PM
I don't need all the mods feature, just a sprite on screen ^^
Avatar
if there's a client rpc that does something like that maybe
6:55 AM
maybe not like a watermark lol but
6:55 AM
text XD
👍 1
6:56 AM
or an existing graphic ark has in its gamedir
Avatar
yes that's what I was thinking of
7:55 AM
but I only know how to display text using chat or broadcast at the moment
8:01 AM
and that's too big it would be better a little text in some corner (edited)
Avatar
Can you help me?
4:16 AM
FString Description1 = item->ItemDescriptionField(); FString& Description2 = item->ItemDescriptionField(); GetItemDescription BPGetItemDescription Get the content of the description in the failure box ----------- item->BlueprintAllowMaxCraftingsField()=100; item->UpdatedItem(false); Set this value, fail, continue to display 3
Avatar
UPrimalItem* item
Avatar
Avatar
711919
FString Description1 = item->ItemDescriptionField(); FString& Description2 = item->ItemDescriptionField(); GetItemDescription BPGetItemDescription Get the content of the description in the failure box ----------- item->BlueprintAllowMaxCraftingsField()=100; item->UpdatedItem(false); Set this value, fail, continue to display 3
You can't change the item description field, try the custom item description
Avatar
Not readable?
1:25 PM
I tried those few and couldn't read the content.
Avatar
Hello, Does anyone know how I can give a player a whitelist slot via Tebex (AllowPlayerToJoinNoCheck). Do I need an admincheat before the message and how can I be sure that the command is executed. Thanks in advance
Avatar
Commands in tebex don't need to be prefixed with admincheat or cheat
Avatar
Avatar
Pelayori
Commands in tebex don't need to be prefixed with admincheat or cheat
should i use the {id} or {ue4id} variable?
Avatar
Avatar
Jona
should i use the {id} or {ue4id} variable?
It depends if the command asks for steam id ({id}) or player id ({ue4id})
Avatar
Ok thank you
11:12 PM
Can I use the ark permission plugin also with epic ids?
Avatar
Avatar
Jona
Can I use the ark permission plugin also with epic ids?
jraServerAPI 9/23/2021 11:18 PM
yes
Avatar
And and a last question: Does somebody know how I can give Whitelist to players (join even when the server is capped)? I’ve tried “AllowPlayerToJoinNoCheck” . If this command works, should I use the steam or player id?
Avatar
SteamId is what you should use i believe.. As that's the first info we get when someone joins the server
Avatar
Now this error message comes up on every server: [TebexARK] unable to process api request
Avatar
That's an error on your tebex config
11:49 AM
Base URL shouldn't be modified
Avatar
🐨Dream Doctor🦘 10/1/2021 3:17 AM
Hey @Foppa , sorry for the tag, but could I just confirm with you, for your StructuresLimit plugin, do you require the actual structure bp in the config file, not the primalitem?
Avatar
The stable version is using the Structure asset path.
8:58 AM
but the beta version is using the "Spawn" path
Avatar
Anyone know off hand how to access to APrimalDinoCharacter's saddle? specifically to move it to another inventory
Avatar
Avatar
Kal
Anyone know off hand how to access to APrimalDinoCharacter's saddle? specifically to move it to another inventory
UPrimalInventoryComponent::GetEquippedItemOfType
Avatar
im just confused cause its not in EquippedItemsField
Avatar
Managed to get that to work, thank you
👍 1
Avatar
Is there an event when a player kills a dino? Including the killer and the killed dino?
Avatar
APrimalDinoCharacter_Die, where damage causer and event instigator should be the one who killed the dino
Avatar
oh, nice, will check it, thanks
9:26 PM
bool Die(float KillingDamage, FDamageEvent * DamageEvent, AController * Killer, AActor * DamageCauser) { return NativeCall<bool, float, FDamageEvent*, AController*, AActor*>(this, "APrimalCharacter.Die", KillingDamage, DamageEvent, Killer, DamageCauser); }this one, right?
Avatar
Avatar
Dia
oh, nice, will check it, thanks
there are some cases where instigator will be null
9:26 PM
such as grenades or c4
Avatar
oh wait, that's APrimalCharacter
Avatar
Avatar
Dia
oh wait, that's APrimalCharacter
APrimalCharacter is both dino and player
9:27 PM
that hook will trigger for both
Avatar
bool Die(float KillingDamage, FDamageEvent * DamageEvent, AController * Killer, AActor * DamageCauser) { return NativeCall<bool, float, FDamageEvent*, AController*, AActor*>(this, "APrimalDinoCharacter.Die", KillingDamage, DamageEvent, Killer, DamageCauser); }
9:28 PM
Will try it, that's great
9:28 PM
DamageCauser is an array of every player hitting it?
Avatar
it's not an array
9:29 PM
and it won't always be a player
9:29 PM
it can be any actor dealing damage
Avatar
ok, playing a bit with it, thanks
Avatar
Hello people. Is it possible that the bPoopIsEgg function is not working?
Avatar
Avatar
Pope 404NE
Hello people. Is it possible that the bPoopIsEgg function is not working?
that is a bitfield not a function
Avatar
Thanks. Anyway, a few weeks ago it was returning true if the poop was an egg, but this morning I tried it and in no case is it getting true.
Avatar
Avatar
Pope 404NE
Thanks. Anyway, a few weeks ago it was returning true if the poop was an egg, but this morning I tried it and in no case is it getting true.
show your code please
Avatar
void Hook_APrimalDinoCharacter_EmitPoop(APrimalDinoCharacter* _this) { std::string emite = _this->bPoopIsEgg().Get() ? "EGG" : "POOP"; Log::GetLog()->error(emite); APrimalDinoCharacter_EmitPoop_original(_this); }
Avatar
try _this->bPoopIsEgg()() instead
Avatar
Yes thanks. I also tried it with negative results. Another option I tried was to use DECLARE_HOOK (ADroppedItem_BeginPlay, void, ADroppedItem *); to avoid the bitfield. What worries me is that it worked and I wonder if some development that uses it is causing problems. I have none currently in production and it is only in ongoing development. (edited)
Avatar
hi guys, is there a plugin to prevent some creature to enter boss arena ?
Avatar
Avatar
Shadow
hi guys, is there a plugin to prevent some creature to enter boss arena ?
answer below (edited)
Avatar
Avatar
Shadow
hi guys, is there a plugin to prevent some creature to enter boss arena ?
Yes, PvP+ From Lethal
Avatar
i just want to make a dino pick up something with a radius that can be set. how do i write that?
Avatar
Avatar
Nyarla
i just want to make a dino pick up something with a radius that can be set. how do i write that?
Your question is too generic in my opinion (maybe try to add more details?). But maybe someone can draft a roadmap for you. (edited)
9:24 PM
IF <Dino> is (Wandering) PICK UP <Item> within a radius of 100
Avatar
Avatar
Nyarla
IF <Dino> is (Wandering) PICK UP <Item> within a radius of 100
Attach to the Dino tick event
12:51 AM
Do a sphere overlap
12:51 AM
Check that
12:52 AM
Add item to inventory and destroy the other item
Avatar
Any idea how to flag an item as broken? or to show the durability percent bar? Ive tried everything i can think of mainly screwing with ItemStatInfosField and any repair/durability related thing i could find
Avatar
Is there a plugin to add a sex to a neutered dino ?
10:49 PM
basically to switch from a neutered to a male or female
Avatar
https://discord.gg/zyJQzUg Plugin features: Change gender of dinos just with a command while staring at a dino (Optional) Token system to allow players to use it (Optional) Allow only certain groups to use the command (Optional) Enable timed...
Avatar
Avatar
Kal
Any idea how to flag an item as broken? or to show the durability percent bar? Ive tried everything i can think of mainly screwing with ItemStatInfosField and any repair/durability related thing i could find
UPrimalItem.bUseBPGetItemDurabilityPercentage
11:34 PM
Tried with that?
Avatar
or UPrimalItem.GetDurabilityPercentage
Avatar
That plug-in works for a Dino that is a male or a female but not if it has been neutered
Avatar
Maybe something that could be improved 🙂
GOGHEART1 1
Avatar
Another question, player are using an XP "usebug" when a baby is born, the tribe kills the baby and get xp, they do that in chain, is there a way or a plugin to prevent that ?
Avatar
I would say it's not a bug, more of a feature of the game tbh
3:51 PM
strategy
Avatar
a kill cooldown would have been good (edited)
4:49 PM
or something to think about
Avatar
now you got me thinking for a plugin
6:07 PM
to be fair this is something that would be suggest to put into PvP Cooldown (edited)
Avatar
Lethal are you here ? 😆
Avatar
Can you tell him your idea?
Avatar
I'd also support a plugin to stop people getting XP by killing their own babies 😛
Avatar
Avatar
Shadow
Another question, player are using an XP "usebug" when a baby is born, the tribe kills the baby and get xp, they do that in chain, is there a way or a plugin to prevent that ?
The Ark Server Remaster plugin has a similar feature for that. Experience gained from kills scales with the creature's age, so newborns effectively give next to zero exp.
🍻 1
Avatar
Avatar
Foppa
to be fair this is something that would be suggest to put into PvP Cooldown (edited)
You mean PvP+?
Avatar
PvP+ v1.79 Beta 2 has the feature now.
Avatar
Avatar
Lethal
You mean PvP+?
I did wrote that, but then i thought. If it's should be cooldown. Well then there is the PvP Cooldown, but yeah this isn't pvp though. SO maybe PvP+ would have been the better choice. Cause I mean you could do it like a cooldown too, instead of just stopping it. but then other options is more time consuming ofc. (edited)
Avatar
Avatar
Lethal
PvP+ v1.79 Beta 2 has the feature now.
Great i will try this out
Avatar
Avatar
Shadow
That plug-in works for a Dino that is a male or a female but not if it has been neutered
Regarding this feature an update will be released this week that contains it!
👍 2
Avatar
Hi there. Maybe there is no solution to run ARKAPI on Linux?
Avatar
Avatar
Joolas
Hi there. Maybe there is no solution to run ARKAPI on Linux?
it would have to be rewritten, so no
Avatar
Hello, how to set a specific gender in a creature? I mean here : "Dinos": [ { "Level": 280, "Neutered": false, "Blueprint": "Blueprint'/Game/PrimalEarth/Dinos/Trike/Trike_Character_BP.Trike_Character_BP'"
Avatar
...that code snippet looks like the ArkShop and if so. You can't.
Avatar
@Foppa Where is the code for this?
2:40 AM
ArkShop v2.9.1 you released on 11/23/2021?
Avatar
I'm uploading it
lethalsalute 1
Avatar
Hello. I bought a plugin, the payment was made, the money was gone, but after redirecting back to the site, access to the download did not open. https://ark-server-api.com/index.php?resources/pvpve.149/&token=EC-1XE34393NY7758346 😦
Avatar
Contact the seller!
Avatar
@Foppa ban @Deleted User send a scam link to steal discords accounts
Avatar
is there a plugin to validate a mission ?
Avatar
hey any contact to Advanced Chat producer? i want get it
9:57 PM
i writed on site but no respond in 24h so trying here
Avatar
How can i check an actors height, or better get the center point of the actor, not its root location (edited)
Avatar
Does this plugin already excist? Is there a plugin that allows you to drop and place genesis osd drops, crates, exctinction terminals, charge node, ect. Reply if you can.
Avatar
Does anyone know of any plugins that run on Linux that help fix reliable buffer overflow?
Avatar
Avatar
Ciaran
Does anyone know of any plugins that run on Linux that help fix reliable buffer overflow?
plugins can only run on windows
Avatar
Ah ok suspected as much, thank you anyway
Avatar
Does this plugin already excist? Is there a plugin that allows you to drop and place genesis osd drops, crates, exctinction terminals, charge node, ect. Reply if you can.
Avatar
Do plugins need to be run on the same machine as the server to access the live instance? Or could I run it on a windows vm with syncthing syncing all necessary data from the two linux servers running my cluster?
Avatar
Avatar
Ciaran
Do plugins need to be run on the same machine as the server to access the live instance? Or could I run it on a windows vm with syncthing syncing all necessary data from the two linux servers running my cluster?
plugins are dll's that get loaded into the server process once it starts
11:58 AM
they don't access data files or such
Avatar
ah ok 😦
11:58 AM
thank you
Avatar
Avatar
MikeTheCar
Does this plugin already excist? Is there a plugin that allows you to drop and place genesis osd drops, crates, exctinction terminals, charge node, ect. Reply if you can.
exctinction terminals can be created only on exctinction
Avatar
Avatar
Uaca
exctinction terminals can be created only on exctinction
MikeTheCar 2/2/2022 8:47 AM
That's why I need the plugin, i need so i can have them as items in my inventory on all maps and i can place them drop them use them ect
Avatar
Avatar
MikeTheCar
That's why I need the plugin, i need so i can have them as items in my inventory on all maps and i can place them drop them use them ect
you going to need a mod for that.
Avatar
Avatar
Uaca
you going to need a mod for that.
MikeTheCar 2/2/2022 4:27 PM
Ok then a mod? Is there a mod for that
Avatar
Avatar
MikeTheCar
Ok then a mod? Is there a mod for that
I don't know if there is one. What I am saying is, only a mod can do what you want
Avatar
Avatar
Uaca
I don't know if there is one. What I am saying is, only a mod can do what you want
Can you add mods to servers? And also so epic players can play
Avatar
jraServerAPI 2/3/2022 9:37 PM
Mods are run and are downloaded on the client, plugins are run on the server and there is no download... Epic does not support Mods
Avatar
Avatar
Lethal
FTribeData* tribe_data = static_cast<FTribeData*>(FMemory::Malloc(0x200)); RtlSecureZeroMemory(tribe_data, 0x200); ArkApi::GetApiUtils().GetShooterGameMode()->LoadTribeData(TribeId, tribe_data, false, false); const string tribeName = tribe_data->TribeNameField().ToString(); Is this the only way to be able to look up a Tribe Name? (edited)
🐨Dream Doctor🦘 2/6/2022 8:50 AM
Hey Lethal, you posted this almost two years ago as the best way to look up a Tribe Name with only a tribe id. Is this the way you ended up doing it?
Avatar
Avatar
🐨Dream Doctor🦘
Hey Lethal, you posted this almost two years ago as the best way to look up a Tribe Name with only a tribe id. Is this the way you ended up doing it?
I would assume so. Just keep in mind get or load function is dangerous as it can cause memory leaks sometimes, but yeah that's the way it's done
10:06 AM
With new headers you shouldn't malloc 0x200, try using GetStructSize<FTribeData>()
Avatar
Avatar
Pelayori
I would assume so. Just keep in mind get or load function is dangerous as it can cause memory leaks sometimes, but yeah that's the way it's done
🐨Dream Doctor🦘 2/6/2022 10:14 AM
I have to admit I'm a bit confused about that part. Why is it that I can't just do the following? FTribeData* TribeData; ArkApi::GetApiUtils().GetShooterGameMode()->LoadTribeData(TribeID, TribeData, false, false); std::string TribeName = TribeData->TribeNameField().ToString();
10:18 AM
I have always been told never to use malloc in C++?
Avatar
FMemory::Malloc is different from malloc
10:21 AM
1. It's controlled by the engine. 2. FMemory::Malloc makes sure that the engine allocates the memory and not your own thread. I can't recall the reason but if you use normal malloc you may crash when the Garbage Collector cleans it up
10:21 AM
I would also recommend calling FMemory::Free
10:21 AM
Also when you just do what you have right there
10:22 AM
There's no guaranteeing that the memory address it gives for TribeData
10:22 AM
Will allow X size of bytes to be there without possibly overwriting other memory
10:22 AM
So you allocate with a size so it knows that the next X bytes are free
10:23 AM
LoadTribeData could potentially overwrite data
Avatar
Avatar
Frigoff
FMemory::Malloc is different from malloc
🐨Dream Doctor🦘 2/6/2022 10:23 AM
Sure, but from what I can find the UE4 docs also say don't use FMemory::Malloc, but use new instead? So why not do FTribeData* TribeData = new FTribeData();?
Avatar
I believe the correct answer is to
10:24 AM
FTribeData TribeData; ArkApi::GetApiUtils().GetShooterGameMode()->LoadTribeData(TribeID, &TribeData, false, false);
10:24 AM
That way it's on the stack
10:25 AM
Confirms the size and doesn't require new
Avatar
🐨Dream Doctor🦘 2/6/2022 10:25 AM
Dynamic Memory Management and the Garbage Collection System.
Avatar
LoadTribeData only works if the tribe is online
Avatar
Avatar
WETBATMAN
LoadTribeData only works if the tribe is online
🐨Dream Doctor🦘 2/6/2022 10:25 AM
Well that's useless then lol
Avatar
Avatar
WETBATMAN
LoadTribeData only works if the tribe is online
🐨Dream Doctor🦘 2/6/2022 10:26 AM
Do you know of any alternative?
Avatar
you need to use GetOrLoadTribeData
10:26 AM
and you need to make sure you preallocate memory for it
10:26 AM
and also free it after
Avatar
Why do you need to preallocate when you can pass a reference
10:27 AM
Am I pulling a straight low iq moment right now?
Avatar
Avatar
WETBATMAN
and also free it after
🐨Dream Doctor🦘 2/6/2022 10:27 AM
I'd give my firstborn for a quick example Wetbatman 🙂
Avatar
Avatar
Frigoff
Why do you need to preallocate when you can pass a reference
it’s something with the function
10:27 AM
it just crashes if you don’t use malloc
Avatar
you also can’t iterate the array of tribe data’s yourself (edited)
10:28 AM
i’m not sure the reason behind this
Avatar
Thinking might I ask why people are using tribe ids instead of TargetingTeam ?
Avatar
Avatar
Frigoff
Thinking might I ask why people are using tribe ids instead of TargetingTeam ?
🐨Dream Doctor🦘 2/6/2022 10:29 AM
Same thing isn't it?
Avatar
Targeting team is on every actor
Avatar
Avatar
🐨Dream Doctor🦘
I have to admit I'm a bit confused about that part. Why is it that I can't just do the following? FTribeData* TribeData; ArkApi::GetApiUtils().GetShooterGameMode()->LoadTribeData(TribeID, TribeData, false, false); std::string TribeName = TribeData->TribeNameField().ToString();
I just meant not to allocate 0x200, rather use the function I mentioned
Avatar
And is just an int
10:29 AM
Which is easy to manage
10:29 AM
If they are in a tribe you can just pull the name of the tribe easily
10:30 AM
and you can iterate over all players structures and dinos for this info
10:30 AM
works for offline players
Avatar
i go over all tribe id’s on startup and cache their names
10:31 AM
then i hook tribe creation and removal to keep the cache up to date
10:31 AM
the reason for this is that the GetOrLoadTribeData function has a memory leak issue
Avatar
🐨Dream Doctor🦘 2/6/2022 10:32 AM
Yeah I guess that sounds like the best plan then. Thanks for the help guys.
Avatar
I would personally use targeting team for tribe id + tribe name. Cache it if you need and use hooks like wetbatman from then on.
10:33 AM
You'll only have to loop all actors on startup once.
👍 1
Avatar
Avatar
Frigoff
You'll only have to loop all actors on startup once.
not even this
10:34 AM
there is an array of all tribe id’s
Avatar
I think he wants the tribe name to go with the tribe id
Avatar
yeah, the tribe id’s array could be iterated and GetOrLoadTribeData called for every tribe id on server boot
10:37 AM
them make an unordered map maybe with the tribe id as key and FString as value
10:37 AM
for storing
Avatar
The whole point of doing it the way I was saying is to avoid the hassle of using the function from before even though you've just listed another one which I'm unaware if it shares the same problem and having to free / malloc
Avatar
LoadTribeData only works for tribes that are already online, otherwise it causes a crash as far as i know
10:40 AM
GetOrLoadTribeData will read from savefile if the data is not in memory yet
Avatar
Does GetOrLoadTribeData
10:41 AM
Still have the memory leak in it
Avatar
yeah somewhere on file reading
Avatar
Okay. Well then it's up to the developer to choose how they want to handle that I guess.
Avatar
🐨Dream Doctor🦘 2/6/2022 11:01 AM
For me personally I'll happily avoid anything with memory leak issues if at all possible. Thanks again for all the info guys.
Avatar
Avatar
🐨Dream Doctor🦘
For me personally I'll happily avoid anything with memory leak issues if at all possible. Thanks again for all the info guys.
we all do, but sometimes using this function cannot be avoided 😄
Avatar
Avatar
🐨Dream Doctor🦘
Sure, but from what I can find the UE4 docs also say don't use FMemory::Malloc, but use new instead? So why not do FTribeData* TribeData = new FTribeData();?
substitute 2/7/2022 7:57 AM
UE4 has their own compiler which likely hijackers new to use fmalloc
Avatar
Avatar
Frigoff
I believe the correct answer is to
substitute 2/7/2022 7:58 AM
This is incorrect. There are various times you have to allocate to heap, some times the game assumes pointer ownership and sometimes it defers execution (usually fstring and fname)
Avatar
Avatar
Frigoff
Still have the memory leak in it
substitute 2/7/2022 8:00 AM
Yes and I’m fairly sure I found where it was
8:00 AM
One option could be to have the api hijack that function to remove the leak
Avatar
Avatar
substitute
One option could be to have the api hijack that function to remove the leak
🐨Dream Doctor🦘 2/7/2022 8:00 AM
I like the sound of that!
Avatar
Avatar
substitute
This is incorrect. There are various times you have to allocate to heap, some times the game assumes pointer ownership and sometimes it defers execution (usually fstring and fname)
So in that case you have to use FMemory::Malloc?
Avatar
Avatar
Frigoff
So in that case you have to use FMemory::Malloc?
substitute 2/7/2022 8:00 AM
Yes
Avatar
Damn good to know
Avatar
substitute 2/7/2022 8:01 AM
I have a header I use that is a 1:1 to fmemory (edited)
Avatar
Is there a way to tell
8:01 AM
When you need to use
8:01 AM
FMalloc vs when you can use it
Avatar
substitute 2/7/2022 8:01 AM
Does it crash?
8:01 AM
Does it expect a pointer?
8:01 AM
Also can check the function in ida
8:02 AM
I generally treat it as needing heap if it expects a pointer
Avatar
Okay good to know.
Avatar
could someone tell me what i am doing wrong? if (mymultimap.find(path_name) == mymultimap.end()) { mymultimap.insert(std::pair<FString, int>(path_name, 1)); } else { for (auto itr = mymultimap.find(path_name); itr != mymultimap.end(); itr++) itr->second++; } First structure will print 2 (reality only 1) second structure will print 2 (correct) 3rd structure will print 9 (reality only 8)
Avatar
what is mymultimap lol
Avatar
std::multimap<FString, int> mymultimap;
8:26 PM
😄
8:27 PM
Fixed it i think
8:27 PM
Yup solved
Avatar
isn't FString here a blueprint?
8:29 PM
works fine
Avatar
why use a multimap then?
Avatar
to store bp + amount
Avatar
multimap sorts itself
8:30 PM
use unordered_map instead
8:30 PM
it will be faster in your context
Avatar
how would i update the count then?
Avatar
just use unordered_map instead of multimap, implementation is exactly the same
Avatar
Ha i see thanks
Avatar
mymultimap[path_name] = 1
8:33 PM
you can also do this instead of using insert btw
8:33 PM
mymultimap[path_name]++
8:33 PM
and you can increase the count like this
Avatar
Avatar
WETBATMAN
you can also do this instead of using insert btw
Avatar
so you don't have to call find twice
Avatar
Any api's to allow multiple characters?
Avatar
Been waiting days for the verification email to send?
Avatar
I'm still on it
Avatar
Could anyone tell me why This AddNewItem(Stone, static_cast<APrimalStructureItemContainer>(ItemContainer)->MyInventoryComponentField(), 500); But this, will crash the server. AddNewItem(Stone, static_cast<APrimalStructureItemContainer>(ItemContainer)->MyInventoryComponentField(), 500); AddNewItem(MetalHatchet, static_cast<APrimalStructureItemContainer>(ItemContainer)->MyInventoryComponentField(), 1); AddNewItem(Replicator, static_cast<APrimalStructureItemContainer>(ItemContainer)->MyInventoryComponentField(), 20); AddNewItem(Generator, static_cast<APrimalStructureItemContainer>(ItemContainer)->MyInventoryComponentField(), 20); AddNewItem(Transmitter, static_cast<APrimalStructureItemContainer>(ItemContainer)->MyInventoryComponentField(), 1);
Avatar
You should never do it like that. Always cast and check points before using them.
Avatar
pretty sure what he posted won't even compile
5:27 PM
it's not being casted to a pointer
Avatar
I recently started developing a plugin. My plugin compiles but fails to be load with error code 1114. I failed to find out what the error exactly is. I am not sure if it is the project/compile settings are correct or if it is my source code. For the settings I mostly followed the post #5 from this question https://ark-server-api.com/index.php?threads/tutorial-create-plugins.55/ My source code can be found here https://github.com/jasc7636/DinoBannings (edited)
6:02 PM
I would appreciate if someone has can link me a tutorial regarding the plugin development or can give me a hint regarding what the error could be
Avatar
1114 is usually error in your config.json
8:41 PM
did you change the file path to your config.json?
Avatar
no, 1114 is a generic attach fail
8:55 PM
it means something in dllmain failed to run
Avatar
Thanks! That helps a lot troubleshooting the error
Avatar
any plugins for customisable decay timers?
Avatar
Avatar
Ciaran
any plugins for customisable decay timers?
Lethal Decay is one option
Avatar
Avatar
Lethal
Lethal Decay is one option
Ooh, I'm guesing it's only something that can be done with api/plugins?
Avatar
I'm not aware of any mods for decay.
Avatar
Avatar
Ciaran
Ooh, I'm guesing it's only something that can be done with api/plugins?
🐨Dream Doctor🦘 2/14/2022 9:55 AM
Trying to modify structure decay timers with a mod is a nightmare. I've tried. Yucky.
Avatar
Avatar
🐨Dream Doctor🦘
Trying to modify structure decay timers with a mod is a nightmare. I've tried. Yucky.
Oh really? Damn ok. Thank you
Avatar
Henry Every <FG co owner> 2/19/2022 3:39 AM
I have account awaiting confirmation, but am not getting confirmation email to confirm account.
Avatar
jraServerAPI 2/19/2022 3:56 AM
it's a known issue, i think they are still working on
Avatar
Hey guys blush I wonder if you could help me with that problem I have. There are 2 awesome plugins that two Devs created and added to the ARK API site. They are both should auto unlock engrams, and I used them to make that every level the player add - all the engrams of this level are unlocked except Tek ! 1. All Engrams (come with Tekgram switch option) 2. Engram Unlocker (Come with Exclude list) 1) have an issue when I level up a dino its thinking its the player and unlock the dino engrams. (Work good with s+/ss) 2) cant filter S+/SS tek engrams (the Exclude file cant see them) so the players get them on spawn without any way to disable it. (don't have the dino bug) can someone make some migration of them to perfect plugin? 😅
Avatar
same config is used
Avatar
Original message was deleted or could not be loaded.
Hey! This one is already support ss/s+, he got the dino level-up issue, in this file it was fixed?
Avatar
Avatar
Neryos
Hey! This one is already support ss/s+, he got the dino level-up issue, in this file it was fixed?
YEa
11:17 AM
Level-up was already fixed in the main versioni only added support to ss/s+
Avatar
Avatar
Natsu
Level-up was already fixed in the main versioni only added support to ss/s+
oh you right, the problem with the dinos was in the other plugin called "EngramUnlocker" wow if that will work it would be awesome !!
Avatar
Avatar
Neryos
oh you right, the problem with the dinos was in the other plugin called "EngramUnlocker" wow if that will work it would be awesome !!
AllEngrams work with modded engrams, just need to set either auto detect to true, or add them to the engrams.txt file. And recent versions of AllEngrams fixed on-dino leveling
Avatar
Original message was deleted or could not be loaded.
Would rather prefer if people wouldn't share random dlls in the server, and instead do pull requests on the repo specially since it's being maintained by me and can review those updates.
Avatar
Avatar
Pelayori
Would rather prefer if people wouldn't share random dlls in the server, and instead do pull requests on the repo specially since it's being maintained by me and can review those updates.
Ha i see sorry about that 🙂 could you add _1 so the Engrams_0 ?
Avatar
What do you mean? You do not need to add _0 or _1 to engrams.
11:42 AM
Just so they end with _C
Avatar
Avatar
Pelayori
What do you mean? You do not need to add _0 or _1 to engrams.
In ReadEngrams name.RemoveFromEnd("_1"); name.RemoveFromEnd("_0");
Avatar
Avatar
Pelayori
AllEngrams work with modded engrams, just need to set either auto detect to true, or add them to the engrams.txt file. And recent versions of AllEngrams fixed on-dino leveling
Well I set the auto detect to true and also added the SS tek grams to the Exclude file but it still unlock them. I want it to NOT unlock all the Tek engrams and only auto unlock the vanilla+SS regular Engrams. (edited)
11:48 AM
I can add all the regular and not tek SS engrams to the Engram list, but I think it was better if the Exclude list could detect SS engrams.
11:49 AM
btw another person here got this issue, tho its from 2020 so IDK if its still relevant. to me it is..
Avatar
I can check out the issues
Avatar
that would be awesome ! 💖
Avatar
Avatar
Natsu
In ReadEngrams name.RemoveFromEnd("_1"); name.RemoveFromEnd("_0");
Ah yeah, could do
Avatar
Avatar
Pelayori
Ah yeah, could do
That's the only change i made i also remove the dll in the chat 🙂
Avatar
anyone know how i can check if a player is grappled? not convenient to test solo So far: I dont see any buffs applied, APrimalCharacter.CharactersGrappledToMe empty
Avatar
Someone here mentioned this: TEnumAsByte<EGrappleState> GrappleState_Current;
Avatar
cool, thanks
1:25 AM
i mustve missed that when searching
😊 1
Avatar
Isn't a buff aswell? (Maybe I remember it wrong) (edited)
Avatar
Do u guys know about any plugin that disable nerfs (like allow more than 3 jumps for Managrmr)?
Avatar
Avatar
Neryos
Do u guys know about any plugin that disable nerfs (like allow more than 3 jumps for Managrmr)?
Accelerator 2/26/2022 9:01 PM
There is a mod but idk about a plugin
Avatar
Avatar
Accelerator
There is a mod but idk about a plugin
ye the Dino Fixed mod. tho I prefer plugins for minor changes 🤯
9:09 PM
or - settings changes.
Avatar
Suggestion: Work on a Troll plugin like Minecraft have, with one /command, to make every troll to work . Example: /Loot <Player SteamID/Name> /Troll loot <Player SteamID/Name> Some trolling ideas 😈 - '/Loot' - Drop player loot. - '/Lava' - TP the player on foundation in the middle of Lava - '/Water' - TP the player deep underwater in some vacuum moonpool - '/Dodo' - Summon on the player X of dodos - '/Bola' - Bola the player for X amount of time - '/Sleep' - Tranq the player for X amount of time - '/DoubleTroll' - TP the player to some random player (or specific player) - troll them both. - '/AntiDinos' - Give the player "Grapple Buff" that disallow him to mount dinos for X amount of time. - '/Kill' - Ofc basic troll - kill the player If someone find this thing doable - Let me know 😜 All rights reserved ©️ 😝 Have a good night yall 😊 !
Avatar
"All rights reserved ©️" Doubt
Avatar
You forgot this emoji 👉 😝 Its important so ppl will understand its a joke. I care more about the result less the money/credit 😊 I think.
Avatar
Avatar
Neryos
Suggestion: Work on a Troll plugin like Minecraft have, with one /command, to make every troll to work . Example: /Loot <Player SteamID/Name> /Troll loot <Player SteamID/Name> Some trolling ideas 😈 - '/Loot' - Drop player loot. - '/Lava' - TP the player on foundation in the middle of Lava - '/Water' - TP the player deep underwater in some vacuum moonpool - '/Dodo' - Summon on the player X of dodos - '/Bola' - Bola the player for X amount of time - '/Sleep' - Tranq the player for X amount of time - '/DoubleTroll' - TP the player to some random player (or specific player) - troll them both. - '/AntiDinos' - Give the player "Grapple Buff" that disallow him to mount dinos for X amount of time. - '/Kill' - Ofc basic troll - kill the player If someone find this thing doable - Let me know 😜 All rights reserved ©️ 😝 Have a good night yall 😊 !
lava and water require map specific points. It wouldn't work on custom maps unless someone created valid regions that qualify.
Avatar
Avatar
substitute
lava and water require map specific points. It wouldn't work on custom maps unless someone created valid regions that qualify.
So maybe if its not on a Vanilla map just output "Only work on official maps". Also those ideas are the start, I am sure if someone will take this project on him (I wish I knew how to plugin) I am sure more ideas will come in reviews.
Avatar
@Kal hello regarding the purchase of the plugin, where do you write information to activate the plugin?
Avatar
Avatar
Hayk
@Kal hello regarding the purchase of the plugin, where do you write information to activate the plugin?
Just make a ticket in my discord plz
Avatar
TerryLove6989 3/3/2022 2:02 PM
how do i enable API on my server to use it
Avatar
TrickyBlade 3/3/2022 2:47 PM
It seems that after installing the ark api and permissions file, that when it runs ark it is showing failed ot get hostname. any reason why it would fail to get hostname?
Avatar
Avatar
TrickyBlade
It seems that after installing the ark api and permissions file, that when it runs ark it is showing failed ot get hostname. any reason why it would fail to get hostname?
jraServerAPI 3/3/2022 3:00 PM
that is normal, what you are missing is the command line.. you should use ASM (Ark Server Manager) to launch your servers, as it takes care of all that for you.
Avatar
TrickyBlade 3/3/2022 3:31 PM
i am running asm atm - it loaded it status says running, however the availability says 'waiting for publication' is this normal?
Avatar
Avatar
jraServerAPI
that is normal, what you are missing is the command line.. you should use ASM (Ark Server Manager) to launch your servers, as it takes care of all that for you.
Buffleman420 3/3/2022 3:48 PM
I’ve tried the ark server manager, but I prefer to use beacon and then do the rest by hand.
Avatar
Avatar
TrickyBlade
i am running asm atm - it loaded it status says running, however the availability says 'waiting for publication' is this normal?
Buffleman420 3/3/2022 3:50 PM
I’m not sure as I’ve don’t run that program before, but I’ve not seen that before. Is it within the asm program or that actual cmd screen for the server?
Avatar
Avatar
Buffleman420
I’ve tried the ark server manager, but I prefer to use beacon and then do the rest by hand.
TrickyBlade 3/3/2022 3:52 PM
yes i use beacon prefer beacon - the issue im having is that when i install ark api and permissions it fails to get hostname so open and then shuts my ark client right away.
Avatar
Avatar
TrickyBlade
yes i use beacon prefer beacon - the issue im having is that when i install ark api and permissions it fails to get hostname so open and then shuts my ark client right away.
Buffleman420 3/3/2022 3:53 PM
Is the get host name on the server side or client?
Avatar
jraServerAPI 3/3/2022 3:54 PM
that error has been like that for a few years
3:54 PM
Avatar
TerryLove6989 3/3/2022 3:54 PM
how do i enable API on my server to use it
Avatar
Avatar
jraServerAPI
Click to see attachment 🖼️
TrickyBlade 3/3/2022 3:55 PM
now that i ahve done a few thing told to do via gportal ill show you what the prompt is saying now when trying to load.
3:56 PM
this is what happens when i try to load the game through steam
3:59 PM
and if i try to load as admin from the client itself does this
4:00 PM
all i ahve installed api wise is ark api itself, and permissions folder.
4:01 PM
now the interesting part is, if i deleted ark api folder completely... ark will start up just fine.
4:03 PM
its become such a hassle that im so close ot being like ok i just wont run plugins on my cluster then? idek lmao.
Avatar
jraServerAPI 3/3/2022 4:04 PM
your command line is still empty
4:05 PM
i would use ASM.. it's so much easier
4:05 PM
you don't launch the server thru steam
4:05 PM
it's launched from a bat file.. with command line arguments passed
4:06 PM
and ASM does all that for you
Avatar
Avatar
jraServerAPI
your command line is still empty
TrickyBlade 3/3/2022 4:07 PM
as i ran it through asm... the server status was fine... however.... said waiting for publication under availability.
Avatar
jraServerAPI 3/3/2022 4:08 PM
yes, because now you need to open up your ports in your firewall
4:08 PM
the ports you define in ASM need to be open
4:08 PM
that;s why you got the "waiting for publication"
4:09 PM
use port forwarding
Avatar
TrickyBlade 3/3/2022 4:09 PM
the port i provided for them, which is the server and query port is the poerts for my server through my gportal server acct. or atleast thats what i put in.
Avatar
jraServerAPI 3/3/2022 4:10 PM
4:10 PM
all three of these ports should be forwarded to the ARK server from your firewall/router (edited)
Avatar
TrickyBlade 3/3/2022 4:14 PM
okay now ive nvr done this before, so should i leave the ports as what they pop up by default or is there a place ot find the ports for my firewall/router?
Avatar
jraServerAPI 3/3/2022 4:46 PM
I don't use gportal
4:47 PM
I run my servers from home, maybe there's someone here who uses GPortal that can help you
10:36 PM
The server api is trying to run on the game instead of server
10:37 PM
If u have the version.dll file in ur game folder it’ll attach itself to both game and game server
10:37 PM
Whatever exe you open
10:37 PM
Blkbear
10:38 PM
U don’t want it to run when opening the game itself
Avatar
Oh i just realized he's not even in the server anymore
8:26 AM
💀
Avatar
Avatar
Kal
anyone know how i can check if a player is grappled? not convenient to test solo So far: I dont see any buffs applied, APrimalCharacter.CharactersGrappledToMe empty
jraServerAPI 3/9/2022 3:24 AM
I just figured this out, for checking if a player is currently being grappled by another player: c++ auto shooter = player_controller->GetPlayerCharacter(); if (shooter) { if (shooter->LastGrapHookPullingOwnerField()) { // points to the last character to grapple me // will still has a value even if you are not currently being grappled } if (shooter->LastGrapHookPullingMeField()) { // points to the current player grappling me // if not grappled, then this is null Log::GetLog()->info("I'm being grappled! HELP!"); } } (edited)
Avatar
Hey guys, Lets say I want to create a plugin. But I have 0 info about it. I have 7k hours on ARK And half of it was while hosting servers on ASM by my own. I have base configuration knowledge but none on deving. I have close to 0 information about coding but want to start to work in the high-tech world. specific dev and languages. What should I study to know how to create Plugins / Mods, Etc. Hope that question make sence and thanks for the helpers 🙏
8:21 PM
Also if u have recommended courses online to suggest that would be great.
Avatar
Avatar
Neryos
Hey guys, Lets say I want to create a plugin. But I have 0 info about it. I have 7k hours on ARK And half of it was while hosting servers on ASM by my own. I have base configuration knowledge but none on deving. I have close to 0 information about coding but want to start to work in the high-tech world. specific dev and languages. What should I study to know how to create Plugins / Mods, Etc. Hope that question make sence and thanks for the helpers 🙏
substitute 3/9/2022 8:21 PM
You would need to know UE4 and C++
8:21 PM
For this api specifically
Avatar
Avatar
substitute
You would need to know UE4 and C++
Thats great ! And I know that's not about mods in here but that will work for modding? I know there are some mods that works with plugins (Like shop ui)
Avatar
Avatar
Neryos
Thats great ! And I know that's not about mods in here but that will work for modding? I know there are some mods that works with plugins (Like shop ui)
substitute 3/9/2022 8:24 PM
For modding you would use the ark dev kit
8:25 PM
It uses a visual scripting language called BluePrints
8:25 PM
The language is proprietary and is UE4 only
8:25 PM
Plugins that also use mods use mods for the game client for things that can only be done on the game client
8:26 PM
Then the plugin exists on the server and implements whatever server side functionality is needed
8:26 PM
Mods can do server side stuff but many find plugins easier depending on the task
8:26 PM
Combining mods and plugins into a single working system is an extremely advanced topic
Avatar
Ye I see what you mean, Personally if I can use plugins - I will choose them more than mods. so basically I should start with UE4 and c++ then I am good to start create plugins, right? Also UE4 Its 'Unreal Engine' of Epic games right? I Remembered I played with it a bit few months ago. So I need to learn language for modding too.
Avatar
substitute 3/9/2022 8:35 PM
Yes it is unreal engine
8:35 PM
I would suggest downloading the ark devkit and using that as your learning resource
8:35 PM
It’s a greatly simplified editor and has all of the ark specific stuff
Avatar
Avatar
substitute
I would suggest downloading the ark devkit and using that as your learning resource
Oh so you actually say that for Modding (at least basic stuff) I don't need to learn anything? Just start to work with it and learn by doing?
8:38 PM
My bad I read what you said again
8:39 PM
Man thank you for your guidness! That was really kind. Appreciate🙏 ❤️ (edited)
Avatar
jraServerAPI 3/9/2022 8:45 PM
@Neryos there's a lot of great tutorials on youtube for Ark Modding (edited)
Avatar
Avatar
jraServerAPI
@Neryos there's a lot of great tutorials on youtube for Ark Modding (edited)
Oh good to know. Thank you !
Avatar
are plugins available for Nitrado? i've seen alot of good things being done with them. our group just recently moved to Nitrado in hopes to get plugins working
Avatar
I believe only if you host on a dedicated server there. (edited)
Avatar
Avatar
Blackchaos
are plugins available for Nitrado? i've seen alot of good things being done with them. our group just recently moved to Nitrado in hopes to get plugins working
🐨Dream Doctor🦘 3/12/2022 4:12 AM
As Lethal says, Nitrado does not allow plugins on their normal Ark servers. You would need to purchase a dedicated machine and run your own servers on that.
Avatar
Aaurizon (Ryan) 3/12/2022 9:17 PM
Hello, i'm creating my first plugin, can someone help me to understand this error ? c++ DECLARE_HOOK(AShooterGameState_DayNumberField, int&, AShooterGameState*); void plugin_load() { Log::Get().Init("AzTest"); ArkApi::GetHooks().SetHook("AShooterGameState.DayNumberField", &Hook_AShooterGameState_DayNumberField, &AShooterGameState_DayNumberField_original); } void plugin_unload() { ArkApi::GetHooks().DisableHook("AShooterGameState.DayNumberField", &Hook_AShooterGameState_DayNumberField); } int ORIGINAL_VALUE = 0; int CUSTOM_VALUE = 1000; int& _cdecl Hook_AShooterGameState_DayNumberField(AShooterGameState* _this) { ORIGINAL_VALUE = AShooterGameState_DayNumberField_original(_this); return CUSTOM_VALUE; }
9:18 PM
03/12/22 21:16 [API][warning] Failed to find hook (AShooterGameState.DayNumberField)
9:20 PM
Looks like you’re trying to hook an api function and not an ark function?
Avatar
Avatar
Frigoff
Looks like you’re trying to hook an api function and not an ark function?
Aaurizon (Ryan) 3/12/2022 9:22 PM
I found this function from API/ARK/GameState.h, isn't the right folder to get the list of function to hook ? Or i'm wrong ?
Avatar
No. Lol. That’s the api function. The functions you’re hooking are going to come from the ShooterGame server binary.
Avatar
Avatar
Frigoff
No. Lol. That’s the api function. The functions you’re hooking are going to come from the ShooterGame server binary.
Aaurizon (Ryan) 3/12/2022 9:51 PM
But I did exactly like the tutorial: https://ark-server-api.com/forums/threads/finding-creating-a-simple-hook.533/ Exactly same code and still same error 03/12/22 21:50 [API][warning] Failed to find hook (APrimalCharacter.TakeDamage) DECLARE_HOOK(APrimalCharacter_TakeDamage, float, APrimalCharacter*, float, FDamageEvent*, AController*, AActor*); void plugin_load() { Log::Get().Init("AzTest"); ArkApi::GetHooks().SetHook("APrimalCharacter.TakeDamage", &Hook_APrimalCharacter_TakeDamage, &APrimalCharacter_TakeDamage_original); } float _cdecl Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser) { return 0; } (edited)
9:52 PM
OwnProx said we have to hook api func from Actor.h
Avatar
Avatar
Aaurizon (Ryan)
Hello, i'm creating my first plugin, can someone help me to understand this error ? c++ DECLARE_HOOK(AShooterGameState_DayNumberField, int&, AShooterGameState*); void plugin_load() { Log::Get().Init("AzTest"); ArkApi::GetHooks().SetHook("AShooterGameState.DayNumberField", &Hook_AShooterGameState_DayNumberField, &AShooterGameState_DayNumberField_original); } void plugin_unload() { ArkApi::GetHooks().DisableHook("AShooterGameState.DayNumberField", &Hook_AShooterGameState_DayNumberField); } int ORIGINAL_VALUE = 0; int CUSTOM_VALUE = 1000; int& _cdecl Hook_AShooterGameState_DayNumberField(AShooterGameState* _this) { ORIGINAL_VALUE = AShooterGameState_DayNumberField_original(_this); return CUSTOM_VALUE; }
what you are attempting to hook here is not a function.
9:54 PM
it's a field
9:54 PM
it's basically a variable inside AShooterGameState
Avatar
Avatar
WETBATMAN
it's a field
Aaurizon (Ryan) 3/12/2022 9:54 PM
Isn't a getter function for the field ?
9:55 PM
Oh ok
9:55 PM
But what about the tutorial ?
Avatar
API has a wrapper function for getting every field
9:55 PM
because it needs to obtain the offset for what you're asking it to look up
Avatar
Avatar
Aaurizon (Ryan)
But what about the tutorial ?
what about it
Avatar
Aaurizon (Ryan) 3/12/2022 9:56 PM
I followed the tutorial to hook the damage function https://ark-server-api.com/forums/threads/finding-creating-a-simple-hook.533/
9:57 PM
He never talked about to get offset by ourself
9:59 PM
you should use the hook generator from here
9:59 PM
it's in #【🔨】ᴛᴏᴏʟꜱ
Avatar
Aaurizon (Ryan) 3/12/2022 10:00 PM
That gived me exactly the same code than me
10:00 PM
DECLARE_HOOK(APrimalCharacter_TakeDamage, float, APrimalCharacter*, float, FDamageEvent*, AController*, AActor*); float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser) { return APrimalCharacter_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser); } ArkApi::GetHooks().SetHook("APrimalCharacter.TakeDamage", &Hook_APrimalCharacter_TakeDamage, &APrimalCharacter_TakeDamage_original); ArkApi::GetHooks().DisableHook("APrimalCharacter.TakeDamage", &Hook_APrimalCharacter_TakeDamage);
Avatar
restart your server, this hook issue just happens randomly sometimes AFAIK (edited)
Avatar
Aaurizon (Ryan) 3/12/2022 10:01 PM
Ok thank you i will do that
Avatar
Aaurizon (Ryan) 3/12/2022 10:21 PM
I restarted several times and still same warning My source code is like the tutorial and the HookerCreator DECLARE_HOOK(APrimalCharacter_TakeDamage, float, APrimalCharacter*, float, FDamageEvent*, AController*, AActor*); float Hook_APrimalCharacter_TakeDamage(APrimalCharacter* _this, float Damage, FDamageEvent* DamageEvent, AController* EventInstigator, AActor* DamageCauser) { return 0; } void plugin_load() { Log::Get().Init("AzTest"); ArkApi::GetHooks().SetHook("APrimalCharacter.TakeDamage", &Hook_APrimalCharacter_TakeDamage, &APrimalCharacter_TakeDamage_original); } Does I have to create a ticket ? (edited)
Avatar
what is your plugin build mode
10:29 PM
10:29 PM
talking about this
Avatar
Aaurizon (Ryan) 3/12/2022 10:33 PM
And i'm doing "Build > Rebuild Solution" to build
10:33 PM
Visual Studio 2019 (64bits)
Avatar
is your API installed on a dedicated server?
Avatar
Aaurizon (Ryan) 3/12/2022 10:33 PM
No, on my computer
10:33 PM
Want me to install on the dedicated server for debug ?
Avatar
yeah that won't work
10:33 PM
you need an instance of a dedicated server
10:34 PM
you can't run API from the steam install of the game
Avatar
Aaurizon (Ryan) 3/12/2022 10:34 PM
Ooohh ! I have to build from windows server 😮
Avatar
did you install the API into the steam games directory?
Avatar
Aaurizon (Ryan) 3/12/2022 10:34 PM
In the didacted server, yes
Avatar
inside the steam games directory, or did you download the dedicated server files seperately?
Avatar
Aaurizon (Ryan) 3/12/2022 10:35 PM
seperately, i have:
  • c:/steamcmd
  • c:/arkserver
Avatar
so you installed the dedicated server via SteamCMD, and then you placed the API files into the server?
Avatar
Aaurizon (Ryan) 3/12/2022 10:36 PM
Yeah
10:36 PM
Other plugins working well
Avatar
it should work in this case
Avatar
Aaurizon (Ryan) 3/12/2022 10:36 PM
Just the plugin i compiled my self doesn't work
Avatar
you should attach a debugger
Avatar
Aaurizon (Ryan) 3/12/2022 10:38 PM
But i will need to rebuild ARK Api, to use the debugguer
Avatar
why
10:38 PM
😄
10:39 PM
10:39 PM
click this
10:39 PM
and then click
10:39 PM
"Attack to Process"
10:39 PM
then select your server process
Avatar
Aaurizon (Ryan) 3/12/2022 10:39 PM
The github give only the .lib and not the debug files
10:39 PM
Ok
10:39 PM
Wait I have to install visual studio on the dedicated server to debug
Avatar
nope
10:39 PM
you can install just a remote debugger
Avatar
Aaurizon (Ryan) 3/12/2022 10:40 PM
Oh yeah, you're right
Avatar
Aaurizon (Ryan) 3/12/2022 10:40 PM
Thanks
Avatar
if VS debugger doesn't work you can always use other debuggers like x64dbg
👍 1
Avatar
Aaurizon (Ryan) 3/13/2022 1:03 AM
Ok, finally it worked, thanks for the help
Avatar
looking for developer for my server
Avatar
Avatar
AnjoCaido
looking for developer for my server
Just ask what you want there might already be plugins people made but are not public.
Avatar
Does anybody know a good chat filter Plugin, that´s adjustable. On the server i administrate, there are plenty of people who are insulting others all the time. This leads to the admin Team spending a lot of time on banning / timeouting these Kids. So it would be great, if there was a solution, that prevents them from being able to write certain words in the global chat.
Avatar
Avatar
itz_m1ch1
Does anybody know a good chat filter Plugin, that´s adjustable. On the server i administrate, there are plenty of people who are insulting others all the time. This leads to the admin Team spending a lot of time on banning / timeouting these Kids. So it would be great, if there was a solution, that prevents them from being able to write certain words in the global chat.
I believe Kal's Cross Chat has language filtering in it for chat.
Avatar
Thanks!
Avatar
Hello, how can I download a paid plugin?
Avatar
Did you already purchase?
Avatar
Avatar
dougy
The server api is trying to run on the game instead of server
hey Dougy i saw your message about the server windows on that image not being run on the server but on the game ? i recently switched to ASM and was wondering if what you mentioned was a wrong way
Avatar
ijust saw that guy had his actual game client open (like to play ark) and it looked like when he opened the game client it attached the server api to the game client
10:49 PM
10:49 PM
shootergame.exe instead of shootergameserver.exe
10:49 PM
server api is only meant to run on shootergameserver.exe
Avatar
ah good catch i missed the word server missing lol thanks for the reply
Avatar
was thinking im doing the same but all good
Avatar
Avatar
Lethal
Did you already purchase?
No and my question is how do I have to do it?
Avatar
Go to the plugins page on the website and click the buy button which looks like this.
Avatar
What was the fee % on the old site?
Avatar
Avatar
Haragon
What was the fee % on the old site?
WoolyPenguin 3/21/2022 3:21 PM
8%
Avatar
When calling the hook void Hook_UShooterCheatManager_ScriptCommand(UShooterCheatManager* _this, FString* commandString) Is there a way to get the Player Controller from UShooterCheatManager ? i only found functions the other way around.
Avatar
Did you try AShooterPlayerController* MyPCField() (edited)
👍 1
Avatar
i cant do this for my life
11:19 PM
need help
Avatar
Avatar
Kal
Did you try AShooterPlayerController* MyPCField() (edited)
That's when you want to get the cheat manager right ? i want to get the controller from the cheat manager.
Avatar
Avatar
Natsu
That's when you want to get the cheat manager right ? i want to get the controller from the cheat manager.
That's what the field is for
👍 1
Avatar
Avatar
Natsu
That's when you want to get the cheat manager right ? i want to get the controller from the cheat manager.
Nah, that method is on the shooter cheat manager and gives you the pc
Avatar
Avatar
Kal
Nah, that method is on the shooter cheat manager and gives you the pc
Thanks both of you 🙂
Avatar
hi, has anyone battled with Torpor in ark api? it seems torpor is very strangely calculated based on damage and no exposed function to really edit it on a shot in short, im trying to optimize Tek Bow tranquilizer mode for end-game where dinos are up to level 300 (which makes Tek Bow extreme garbage) a step further is applying 0 damage but a massive amount of Torpidity (e.g nullifying damage in Hook_APrimalCharacter_TakeDamage and applying torpidity manually) any fields ive tried just doesnt seem to give me what i need, APrimalCharacter ReplicatedCurrentTorporField() does nothing (edited)
8:39 PM
(i can modify damage higher in TakeDamage and a lot more torpor is applied, but i'd like to modify the torpor multiplier per-weapon)
Avatar
Avatar
⭐Nicco
hi, has anyone battled with Torpor in ark api? it seems torpor is very strangely calculated based on damage and no exposed function to really edit it on a shot in short, im trying to optimize Tek Bow tranquilizer mode for end-game where dinos are up to level 300 (which makes Tek Bow extreme garbage) a step further is applying 0 damage but a massive amount of Torpidity (e.g nullifying damage in Hook_APrimalCharacter_TakeDamage and applying torpidity manually) any fields ive tried just doesnt seem to give me what i need, APrimalCharacter ReplicatedCurrentTorporField() does nothing (edited)
I believe you want to tackle on the UPrimalCharacterStatusComponent That component has function to set current/max status modifier (hp, stam, torpor, etc...) You can get it off APrimalCharacter::GetCharacterStatusComponent
Avatar
the closest is float& OriginalMaxTorporField() in status component, there other are modifiers for starving, dehydration etc is there any other word for torpor/torpidity which it may be sharing with something else?
8:46 PM
float& TorporExitPercentThresholdField() float& TheMaxTorporIncreasePerBaseLevelField() float& OriginalMaxTorporField() float& FortitudeTorpidityDecreaseMultiplierField() float& FortitudeTorpidityIncreaseResistanceField() float& KnockedOutTorpidityRecoveryRateMultiplierField() float& DehydrationTorpidityMultiplierField() float& StarvationTorpidityMultuplierField() float& StarvationTorpidityIncreaseRateField() float& DehyrdationTorpidityIncreaseRateField() float& InjuredTorpidityIncreaseMultiplierField() these are the options in statuscomponent, which don't really seem like the current direct torpor value
Avatar
What I was referring to were functions, not fields
8:48 PM
Something along the lines of BPDirectSetStatusModifier or so
8:48 PM
BPDirectSetCurrentStatusValue and BPDirectSetMaxStatusValue
8:48 PM
You can pass them a EPrimalCharacterStatusValue::Type which has all the possible statuses you want
8:49 PM
Being torpidity EPrimalCharacterStatusValue::Torpidity
Avatar
ah right, yeah it has a type for Torpidity
8:49 PM
ill give it a try, thanks!
Avatar
Those functions are verified working and used extensively when in need of modifying status values
👍 1
Avatar
jraServerAPI 3/27/2022 5:11 AM
Could a plugin be causing this? This has been happening to me at random over the past 3-4 months. After a while of uptime, one of my PVE maps will magically will lose battle-eye and show up under PVP, and players can't find it in the cluster to join. lol It's the weirdest thing... But this is like the 6th time it's happened to me.
5:11 AM
Avatar
Avatar
jraServerAPI
Click to see attachment 🖼️
I've had this happen to my servers. My suspicion has been that it's a server bug related to Epic crossplay. Never did figure out the cause for sure, it was kind of rare. I did have some plugins installed when it happened, but I've seen other Epic login bugs without any plugins installed.
Avatar
Hello, do you know why the store may be giving me a crash?
Avatar
Avatar
FERGOK
Hello, do you know why the store may be giving me a crash?
Aaurizon (Ryan) 3/29/2022 8:42 AM
Are you running multiple servers with the same game instalaltion ?
8:46 AM
Because that can crash if a server try to write on the log file if he got locked by another one
Avatar
Avatar
Aaurizon (Ryan)
Because that can crash if a server try to write on the log file if he got locked by another one
no, just a server
Avatar
Avatar
FERGOK
no, just a server
Aaurizon (Ryan) 3/29/2022 8:55 AM
Do you know what is your last action before the crash (or are you multiple player on the server?) Can you share your crash logs ?
Avatar
Avatar
Aaurizon (Ryan)
Do you know what is your last action before the crash (or are you multiple player on the server?) Can you share your crash logs ?
Avatar
Aaurizon (Ryan) 3/29/2022 11:03 AM
@FERGOK Are you using the last version of Permission and Arkshop ?
11:05 AM
ArkShop require plugin Permission
Avatar
Avatar
Aaurizon (Ryan)
ArkShop require plugin Permission
can you send it to me?
Avatar
Thank you
Avatar
Do you know of any plugin to be able to collect the structures and not break them?
Avatar
There is a plugin (https://ark-server-api.com/forums/resources/game-config-manager.35/) that reloads gameusersettings. Would it be possible to update those settings live as well ? As in Change the value inside the gameusersettings so when you reboot it will stay that way. (edited)
Avatar
Would it matter in terms of speed/networking if you used Scriptcommand to pass data to a mod from c++ or using ProcessEvent ?
Avatar
why add the extra step of adding a scriptcommand
6:23 PM
hooking through ProcessEvent is the fastest
Avatar
Avatar
WETBATMAN
why add the extra step of adding a scriptcommand
because i dont know how to get the owner of the ProcessEvent to pass data back
Avatar
what do you mean?
Avatar
Avatar
WETBATMAN
what do you mean?
"Mod Calls Event GetPoints"The ProcessEvent will show that it triggers but i need to make sure it matches the steamID so i can get the correct points from the Database.
Avatar
then just make a function that has a steam id param
6:27 PM
or a player controller param
Avatar
i have that in my mod
Avatar
and read the steam id (edited)
Avatar
Avatar
Natsu
i have that in my mod
then what’s the problem
6:28 PM
you can read your mod param in c++
Avatar
Avatar
WETBATMAN
then what’s the problem
That's the problem i dont know how to read out the param
Avatar
i’ll send an example once i get to my pc
Avatar
Avatar
WETBATMAN
i’ll send an example once i get to my pc
thanks i want to get rid of HTTPrequest inside my mod and completely use the plugin functions to get the data (edited)
Avatar
Avatar
Natsu
thanks i want to get rid of HTTPrequest inside my mod and completely use the plugin functions to get the data (edited)
alright i'm here
6:48 PM
so basically you're trying to intercept a function invoked from BP in c++ correct?
Avatar
Avatar
WETBATMAN
so basically you're trying to intercept a function invoked from BP in c++ correct?
Yes correct, and want to pass data back
6:49 PM
i currently use HTTPSrequest to get the data
Avatar
to pass data back you'll need to create another function in your mod
6:52 PM
6:52 PM
this is how you intercept the params
6:52 PM
you basically create a struct that has the same structure as your function params in bp
6:53 PM
then you perform a cast. (you cast the Params argument from ProcessEvent into a pointer to the struct you created)
6:53 PM
once you do this you can access the members of this struct
Avatar
So Something like this? Or did i get it completely wrong ?
Avatar
that's fine
7:12 PM
name lookup in this hook is quite resource intensive though
7:13 PM
i would recommend caching the functions you require 😄
7:13 PM
instead of name lookup
7:13 PM
you can look up the function name on server boot and cache it's internal index
7:14 PM
then you can check the internal index in ProcessEvent hook to determine if it's the function you want
Avatar
Avatar
WETBATMAN
then you can check the internal index in ProcessEvent hook to determine if it's the function you want
Hooking into UObject.FindFunctionChecked ?
Avatar
Avatar
Natsu
So Something like this? Or did i get it completely wrong ?
In the function you showed from devkit you are not returning anything, and steam id variable is FString rather than int32.
9:04 PM
In that case, if you do not want to modify the event/func in devkit, you can process event, and then get the steam id variable from the object. Example: void Hook_UObject_ProcessEvent(UObject* _this, UFunction* Function, void* Params) { UObject_ProcessEvent_original(_this, Function, Params); // get the steamid UProperty* steamIdProperty = _this->FindProperty(FName("Steam ID", EFindName::FNAME_Add)); if (steamIdProperty) { // variable was found FString steamId_String = steamIdProperty->Get<FString>(_this); uint64 steamId = std::stoull(*steamId_String); } }
9:05 PM
-ish, I am not in visual studio atm so can't say accurately
Avatar
substitute 4/5/2022 2:55 AM
People using my method
2:55 AM
Yay
pepehype 1
2:55 AM
The system works
Avatar
Wouldn't you also want to make sure the current function being processed is the function you want before doing something like that?
3:43 AM
Or does FindProperty only return a valid property if it was found on that UObject
Avatar
Avatar
Frigoff
Or does FindProperty only return a valid property if it was found on that UObject
substitute 4/5/2022 5:15 AM
Should only return if a valid property is found
5:15 AM
It’s been awhile since I wrote it
5:15 AM
It just iterates the property linked list until it finds the property
Avatar
Pretty cool
5:18 AM
Probably would still want to cache the function ptr and not do that on every function but that’s interesting stuff
Avatar
Avatar
substitute
People using my method
Wish i understand any of it 😄 but i am trying to figure it out
Avatar
Avatar
substitute
The system works
It's done wonders for me 😛
Avatar
Avatar
Pelayori
In that case, if you do not want to modify the event/func in devkit, you can process event, and then get the steam id variable from the object. Example: void Hook_UObject_ProcessEvent(UObject* _this, UFunction* Function, void* Params) { UObject_ProcessEvent_original(_this, Function, Params); // get the steamid UProperty* steamIdProperty = _this->FindProperty(FName("Steam ID", EFindName::FNAME_Add)); if (steamIdProperty) { // variable was found FString steamId_String = steamIdProperty->Get<FString>(_this); uint64 steamId = std::stoull(*steamId_String); } }
Tried using that but it will crash the server on boot up. 😦 i can make some functions in the dev kit tough to test around with 🙂
Avatar
Avatar
WETBATMAN
you can look up the function name on server boot and cache it's internal index
Did I (or someone else) add the GNames/GObjects searching ?
10:36 PM
I had it locally but I don’t remember if I added it to base
Avatar
Avatar
substitute
I had it locally but I don’t remember if I added it to base
10:56 PM
and not GObjects
10:57 PM
Nvm
10:57 PM
Phone just formatted it poorly
Avatar
I'm trying to learn more about blueprint functions and how they can be modified. You can access a blueprint UFunction's bytecode through its TArray<unsigned char> &UStruct::ScriptField(). Is it safe to modify that? Do UFunctions get overwritten or garbage collected during runtime or anything like that I need to worry about?
5:12 PM
Been playing around with calling injected dll code directly from blueprint scripts. My approach (I've had success with the individual pieces of it, haven't put it all nicely together yet) is basically: 1. Create a UFunction with a Func field (not currently exposed in ArkServerApi) that points to my dll function 2. Modify an existing blueprint function by inserting EX_FinalFunction or similar bytecode instructions with a call to my dll UFunction
Avatar
If I'm understanding what you want to do correctly, it's probably easier to just intercept the function in ProcessEvent and then trigger your function within the dll.
Avatar
I've seen that method, definitely easier. There are a couple blueprint functions I'm interested in eventually trying to modify a little more heavily. Starting out with reliably calling native injected functions seems like a fun starting point.
Avatar
I don't see why a UFunction would get garbage collected
5:21 PM
But I personally haven't seen any information or dealt with it so can't say for sure
5:21 PM
You could hook into the GC system to check what it's deleting
5:21 PM
If you're just replacing bytes then the GC should still collect all the bytes, if it does need to do that (edited)
5:22 PM
Keep in mind you'll most likely have to deal with relocations as well
5:22 PM
Cool project though
👍 1
Avatar
Avatar
Frigoff
Keep in mind you'll most likely have to deal with relocations as well
yeah this is the sort of thing I was worried I might have issues with, but so far (very early investigations still) hasn't been a problem with what I find at runtime
Avatar
Yeah that's really cool stuff
Avatar
i agree, very cool project
Avatar
Avatar
TheMollusk
I'm trying to learn more about blueprint functions and how they can be modified. You can access a blueprint UFunction's bytecode through its TArray<unsigned char> &UStruct::ScriptField(). Is it safe to modify that? Do UFunctions get overwritten or garbage collected during runtime or anything like that I need to worry about?
Hi
5:43 AM
I’ve had this idea for a long while
5:43 AM
I can post the op codes UE has
Avatar
This page really helped me. Also http://awforsythe.com/unreal/blueprints_vs_cpp/ had some nice information about how the vm handles function calls
9:04 AM
I haven't really messed around with argument passing and stack handling yet. hoping to find some time this weekend to play some more
Avatar
Avatar
TheMollusk
I haven't really messed around with argument passing and stack handling yet. hoping to find some time this weekend to play some more
If you get something. keep me posted, I could also see about making a basic compiler for it as well. (edited)
Avatar
Does anyone know of any kind of plug-in that would allow achatinas to mate? Wiki says they aren’t breedable but… I beg to differ Server I play has gender changer but not sure that would automatically allow N/A Dino’s to mate unless you set the gender
Avatar
Avatar
DaddyDuck
Does anyone know of any kind of plug-in that would allow achatinas to mate? Wiki says they aren’t breedable but… I beg to differ Server I play has gender changer but not sure that would automatically allow N/A Dino’s to mate unless you set the gender
If I remember correctly, Achatinas have been bredeable since last year 🤔
Avatar
There’s no other way to farm paste if you can’t keep them on enable wondering tho
Avatar
This is becoming an invasive species.. lmao
Avatar
Avatar
substitute
If you get something. keep me posted, I could also see about making a basic compiler for it as well. (edited)
I spent a little more time on this. Here's a simple (incomplete and not fully safe, just an early starting point) example of Blueprint script "hooking". This places a function call to native code at the end of a Blueprint script UFunction. From our native function, we can access the Blueprint function's inputs, outputs, and local variables through the FFrame* Stack argument. This SetScriptHook() example currently only works on some functions (I've been playing with the cryopod's CanDeploy and TryDeploy functions, which are internal calls handled by UObject::CallFunction(), not UObject::ProcessEvent()). Shouldn't be too hard to make function insertion more intelligent to generalize this to most BP functions, regardless of how they're invoked.
8:38 PM
c++ #define UFUNC_FLAG_Native 0x400 #define UPROP_FLAG_Edit 0x001 #define UPROP_FLAG_Parm 0x080 #define UPROP_FLAG_OutParm 0x100 #define USCRIPT_EX_Return 0x04 #define USCRIPT_EX_Nothing 0x0B #define USCRIPT_EX_FinalFunction 0x1C #define USCRIPT_EX_EndOfScript 0x53 #define UFUNCTION_SIZE 0xB0 // Better to calculate this at runtime struct FProperty : UField {}; struct FOutParmRec { FOutParmRec* NextOutParmField() { return *GetNativePointerField<FOutParmRec**>(this, "FOutParmRec.NextOutParm"); } uint8* PropAddrField() { return *GetNativePointerField<uint8**>(this, "FOutParmRec.PropAddr"); } FProperty* PropertyField() { return *GetNativePointerField<FProperty**>(this, "FOutParmRec.Property"); } }; struct FFrame : FOutputDevice { UFunction* NodeField() { return *GetNativePointerField<UFunction**>(this, "FFrame.Node"); } FOutParmRec* OutParmsField() { return *GetNativePointerField<FOutParmRec**>(this, "FFrame.OutParms"); } uint8* LocalsField() { return *GetNativePointerField<uint8**>(this, "FFrame.Locals"); } }; typedef void (*FNativeFuncPtr)(UObject*, FFrame*, void* const); struct UFunction : UStruct { int& FunctionFlagsField() { return *GetNativePointerField<int*>(this, "UFunction.FunctionFlags"); } FNativeFuncPtr& FuncField() { return *GetNativePointerField<FNativeFuncPtr*>(this, "UFunction.Func"); } };
8:38 PM
c++ void SetScriptHook(UFunction* scriptUFunction, FNativeFuncPtr nativeFunction) { int scriptSize = scriptUFunction->ScriptField().Num(); if (scriptSize < 3) { Log::GetLog()->error("Too few bytes in script"); return; } // For now, just initialize the new UFunction by copying the one we're hooking. // Maybe not a good idea, need to investigate! UFunction* hookUFunction = static_cast<UFunction*>(malloc(UFUNCTION_SIZE)); if (!hookUFunction) { Log::GetLog()->error("null hookUFunction"); return; } memcpy(hookUFunction, scriptUFunction, UFUNCTION_SIZE); // Point the new UFunction at our native function hookUFunction->FunctionFlagsField() = UFUNC_FLAG_Native; hookUFunction->FuncField() = nativeFunction; // This won't work for all functions. Need to detect dynamically whether or not // there is an EX_Return, etc if ((scriptUFunction->ScriptField()[scriptSize - 3] != USCRIPT_EX_Return) || (scriptUFunction->ScriptField()[scriptSize - 2] != USCRIPT_EX_Nothing) || (scriptUFunction->ScriptField()[scriptSize - 1] != USCRIPT_EX_EndOfScript)) { Log::GetLog()->error("Bad end of script"); return; } // Insert a call to our UFunction at the end of the script scriptUFunction->ScriptField().RemoveAt(scriptSize - 3, 3, true); unsigned char instructions[] = { USCRIPT_EX_FinalFunction, (DWORD64)hookUFunction >> 0 & 0xFF, (DWORD64)hookUFunction >> 8 & 0xFF, (DWORD64)hookUFunction >> 16 & 0xFF, (DWORD64)hookUFunction >> 24 & 0xFF, (DWORD64)hookUFunction >> 32 & 0xFF, (DWORD64)hookUFunction >> 40 & 0xFF, (DWORD64)hookUFunction >> 48 & 0xFF, (DWORD64)hookUFunction >> 56 & 0xFF, USCRIPT_EX_Return, USCRIPT_EX_Nothing, USCRIPT_EX_EndOfScript }; scriptUFunction->ScriptField().Append(instructions, sizeof(instructions)); }
8:38 PM
c++ void ExampleScriptHook(UObject* _this, FFrame* Stack, void* const Result) { if (!Stack->NodeField()) return; Log::GetLog()->info("-- Inputs --"); for (UProperty* property = Stack->NodeField()->PropertyLinkField(); property; property = property->PropertyLinkNextField()) if ((property->PropertyFlagsField() & UPROP_FLAG_Parm) && !(property->PropertyFlagsField() & UPROP_FLAG_OutParm)) Log::GetLog()->info(" " + property->NameField().ToString().ToString()); Log::GetLog()->info("-- Local Vars --"); for (UProperty* property = Stack->NodeField()->PropertyLinkField(); property; property = property->PropertyLinkNextField()) if (property->PropertyFlagsField() & UPROP_FLAG_Edit) Log::GetLog()->info(" " + property->NameField().ToString().ToString()); // Inputs and local vars can be accessed with the FFrame::LocalsField() uint8 ptr plus the UProperty::Offset_InternalField() Log::GetLog()->info("-- Outputs --"); for (UProperty* property = Stack->NodeField()->PropertyLinkField(); property; property = property->PropertyLinkNextField()) if ((property->PropertyFlagsField() & UPROP_FLAG_Parm) && (property->PropertyFlagsField() & UPROP_FLAG_OutParm)) Log::GetLog()->info(" " + property->NameField().ToString().ToString()); // Outputs can be accessed by traversing the FFrame's FOutParmRec linked list and using FOutParmRec::PropAddrField(). // However, the list doesn't seem to be null terminated so this needs to be done carefully (maybe I'm just inspecting the // wrong value or I have something badly defined) }
oh_snap 1
👍 3
Avatar
very cool
Avatar
Avatar
TheMollusk
c++ void SetScriptHook(UFunction* scriptUFunction, FNativeFuncPtr nativeFunction) { int scriptSize = scriptUFunction->ScriptField().Num(); if (scriptSize < 3) { Log::GetLog()->error("Too few bytes in script"); return; } // For now, just initialize the new UFunction by copying the one we're hooking. // Maybe not a good idea, need to investigate! UFunction* hookUFunction = static_cast<UFunction*>(malloc(UFUNCTION_SIZE)); if (!hookUFunction) { Log::GetLog()->error("null hookUFunction"); return; } memcpy(hookUFunction, scriptUFunction, UFUNCTION_SIZE); // Point the new UFunction at our native function hookUFunction->FunctionFlagsField() = UFUNC_FLAG_Native; hookUFunction->FuncField() = nativeFunction; // This won't work for all functions. Need to detect dynamically whether or not // there is an EX_Return, etc if ((scriptUFunction->ScriptField()[scriptSize - 3] != USCRIPT_EX_Return) || (scriptUFunction->ScriptField()[scriptSize - 2] != USCRIPT_EX_Nothing) || (scriptUFunction->ScriptField()[scriptSize - 1] != USCRIPT_EX_EndOfScript)) { Log::GetLog()->error("Bad end of script"); return; } // Insert a call to our UFunction at the end of the script scriptUFunction->ScriptField().RemoveAt(scriptSize - 3, 3, true); unsigned char instructions[] = { USCRIPT_EX_FinalFunction, (DWORD64)hookUFunction >> 0 & 0xFF, (DWORD64)hookUFunction >> 8 & 0xFF, (DWORD64)hookUFunction >> 16 & 0xFF, (DWORD64)hookUFunction >> 24 & 0xFF, (DWORD64)hookUFunction >> 32 & 0xFF, (DWORD64)hookUFunction >> 40 & 0xFF, (DWORD64)hookUFunction >> 48 & 0xFF, (DWORD64)hookUFunction >> 56 & 0xFF, USCRIPT_EX_Return, USCRIPT_EX_Nothing, USCRIPT_EX_EndOfScript }; scriptUFunction->ScriptField().Append(instructions, sizeof(instructions)); }
substitute 5/5/2022 7:08 PM
Great job on the initial first steps
Avatar
Avatar
TheMollusk
I spent a little more time on this. Here's a simple (incomplete and not fully safe, just an early starting point) example of Blueprint script "hooking". This places a function call to native code at the end of a Blueprint script UFunction. From our native function, we can access the Blueprint function's inputs, outputs, and local variables through the FFrame* Stack argument. This SetScriptHook() example currently only works on some functions (I've been playing with the cryopod's CanDeploy and TryDeploy functions, which are internal calls handled by UObject::CallFunction(), not UObject::ProcessEvent()). Shouldn't be too hard to make function insertion more intelligent to generalize this to most BP functions, regardless of how they're invoked.
substitute 5/5/2022 7:09 PM
We could hook CallFunction as well
7:09 PM
The only concern I have with actual script injection is when multiple people want to hook the event
7:10 PM
There’s no clean way to implement pre-call and post-call hooks using trampoline hooks (same issue exists in C++)
7:10 PM
I’ve been working on having a centralized hook for each function that is hooked that has its own callback lists for pre and post calling, similar to an event driven system
7:11 PM
It would still be a trampoline hook, just one central hook instead of N hooks per function
Avatar
Avatar
substitute
Great job on the initial first steps
TheMollusk 5/5/2022 9:24 PM
Thanks. Simply adding definitions for FFrame and FOutParmRec and fixing UFunction opens some really cool doors (I had FProperty in my example but that's really just UProperty which is already in ArkServerApi). I also found that ArkServerApi already has enums for function flags and the UnrealScript bytecode, EFunctionFlags and EExprToken. The UProperty flags are #defines in the Unreal Engine source so I guess they didn't get extracted however the enums did.
9:25 PM
My example code for function call insertion is a super ugly proof of concept, lots of room for improvement there. Inserting a call at the end of a script is pretty straightforward, the scripts always have an Ex_Return (although there may or may not be a return value). You have A LOT of power at the end of a script function with access to its locals and outputs, but I think it would still be nice in some cases to have the ability to insert a call at a specific offset in the script.
9:26 PM
Using a common trampoline/dispatcher function is a good plan. It's crossed my mind but I haven't invested any time yet into figuring out exactly what that would look like. You're way ahead of me there.
9:27 PM
I know people hook ProcessEvent() and you could handle CallFunction() the same way. I always wonder if that has an impact on performance. I guess it may be negligible if done carefully.
Avatar
As long as you're not doing anything slow inside your hook of ProcessEvent the performance slow down will be negligible. (edited)
10:15 PM
If you use the UE4's replication properly it's never going to really matter. ProcessEvent is already pretty "slow"
Avatar
I've been falling in love with Unreal Engine's reflection system. String comparisons scare me a little though lol
10:23 PM
I've seen that people check UFunctions by index in ProcessEvent() rather than name, that seems reasonable
10:23 PM
I still need to familiarize myself with UE4's replication
Avatar
You can the use GlobalObjects array to find the Function ptr (edited)
10:40 PM
Which you can check
10:41 PM
Instead string comparing the functions name
10:42 PM
UE4 reflection system is really nice
10:42 PM
And there's so much to learn with it
Avatar
Avatar
TheMollusk
Using a common trampoline/dispatcher function is a good plan. It's crossed my mind but I haven't invested any time yet into figuring out exactly what that would look like. You're way ahead of me there.
Thanks, for BP stuff it's super easy because of the central ProcessEvent method
11:04 PM
for native code I have a proof of concept. The hardest part is creating a static callback for your central hook while also 1. Ensuring uniqueness 2. Providing generic interfacing
11:04 PM
I've found great success with struct tagging in templates for this
11:06 PM
oh, I guess the proper name is type dispatching
11:06 PM
One of the nice-to-know use cases for classes that have no members is tag dispatch. It can even be found in your standard library implementation.
11:06 PM
but this essentially
11:06 PM
when you compile, the compiler removes the struct because it is empty
11:06 PM
while the type provides context to the template processor (so it doesn't have ambiguous resolves)
Avatar
TheMollusk 5/6/2022 5:40 PM
That's pretty cool, I'm sure it's a much cleaner solution than what I would have come up with
5:41 PM
C++ templates, that's another thing I've been working on familiarizing myself with lately (coming from more of a C background). All kinds of fun tricks
Avatar
Been playing more with blueprint function hooking. My current method is to insert a complete script bytecode at the beginning of any hooked blueprint functions. The new script simply calls a common dispatcher function that: 1) Calls all pre-hooks that have been registered on the original blueprint script UFunction 2) Processes the original blueprint script 3) Calls all post-hooks All registered hooks and the original script use the same script FFrame (can access the blueprint function's inputs/outputs/local vars). c++ typedef void (*BlueprintHookFuncPtr)(UObject*, FFrame*); #define BLUEPRINT_HOOK_USCRIPT_SIZE 12 // EX_FinalFunction + 8 address bytes + EX_Return + EX_Nothing + EX_EndOfScript std::unordered_map<UFunction*, std::vector<BlueprintHookFuncPtr>> preHooks; std::unordered_map<UFunction*, std::vector<BlueprintHookFuncPtr>> postHooks; void BlueprintHookDispatcher(UObject* obj, FFrame* frame, void* const result) { unsigned char instructions[BLUEPRINT_HOOK_USCRIPT_SIZE]; unsigned char* savedCode; // Call pre-hooks for (BlueprintHookFuncPtr preHook : preHooks[frame->NodeField()]) preHook(obj, frame); // Remove the hook dispatcher script from the original blueprint script for (int i = 0; i < BLUEPRINT_HOOK_USCRIPT_SIZE; ++i) { instructions[i] = frame->NodeField()->ScriptField().GetData()[0]; frame->NodeField()->ScriptField().RemoveAt(0); } savedCode = frame->CodeField(); frame->CodeField() = frame->NodeField()->ScriptField().GetData(); // Process the original script with the current stack frame obj->ProcessInternal(frame, result); // Re-insert the hook dispatcher script for (int i = 0; i < BLUEPRINT_HOOK_USCRIPT_SIZE; ++i) frame->NodeField()->ScriptField().Insert(instructions[i], i); frame->CodeField() = savedCode; // Call post-hooks for (BlueprintHookFuncPtr postHook : postHooks[frame->NodeField()]) postHook(obj, frame); }
👍 2
11:43 PM
To process the original function, the dispatcher function temporarily modifies the script to restore the original function in-place. It's a little funky, but it helps simplify working with the script stack and the target blueprint UFunction.
Avatar
Avatar
TheMollusk
To process the original function, the dispatcher function temporarily modifies the script to restore the original function in-place. It's a little funky, but it helps simplify working with the script stack and the target blueprint UFunction.
How are you handling different functions / hooks
2:04 AM
From a conceptual perspective
2:05 AM
Since each jump needs to go to a unique handler OR provide context
2:05 AM
Oh I see
2:05 AM
You get context
2:05 AM
Not bad; much easier than native
Avatar
Avatar
substitute
You get context
Yeah the stack frame points to the original UFunction that was hooked (that was used to set up the frame), and I use the UFunction to look up the registered hooks
2:08 AM
Had to be a little careful setting it up to avoid issues with the stack frame, but it ends up working out pretty nicely this way
Avatar
Avatar
TheMollusk
Yeah the stack frame points to the original UFunction that was hooked (that was used to set up the frame), and I use the UFunction to look up the registered hooks
Lucky we can read the stack frame
2:10 AM
I was thinking from native perspective
2:11 AM
Where that’s kind of hidden 😁
Avatar
Hey everyone, I just made a plugin release for free there: https://ark-server-api.com/forums/resources/auto-fill-crop-plots.575/
4:05 AM
It has not been tested a lot but basic tests were successful.
4:05 AM
Enjoy 😉
Avatar
Also can someone push the associated GitHub repository https://github.com/K07H/AutoFillCrops in #【💻】ᴘʟᴜɢɪɴꜱ ? I don't have permissions.
4:23 AM
@deleted-role
Avatar
Avatar
OSubMarin
Also can someone push the associated GitHub repository https://github.com/K07H/AutoFillCrops in #【💻】ᴘʟᴜɢɪɴꜱ ? I don't have permissions.
GSH | MrOwlSky 6/10/2022 5:25 AM
You can try posting it now
Avatar
Avatar
GSH | MrOwlSky
You can try posting it now
Thank you 👍
Avatar
GSH | MrOwlSky 6/10/2022 6:26 AM
Np
Avatar
Is there a plugin that allows me to search for a dino by putting /search and that gives me the coordinates?
Avatar
Dino Tracker!
Avatar
BladeOfJustice 9/8/2022 4:31 PM
Is there a Plugin that letzs me copy dino colors to other ones of the same type?
Avatar
I am looking for a plugin that has an off map inventory that allows users to upload and download from it with a web interface so they can queue items for download. I have seen this used before but Google has been no help locating it
😍 2
Avatar
any plugin force all new player to PVE mode by days protection ?
Avatar
Avatar
EviL
any plugin force all new player to PVE mode by days protection ?
Wooly's PVPVE
Avatar
Avatar
LustWare
Wooly's PVPVE
Thank u
Avatar
SuperboySebi 11/3/2022 8:29 PM
Hey all, since I could not find any function for this maybe someone here knows if something like this exists: I'm looking to modify dino spawns so that stryders only spawn from level 50 to 150, to make them harder to achieve, since the minimum mission requirement will be higher to tame them.
Avatar
Is there a plugin that prevents a dino being knocked back by tek turrets in lunar biomes?
Avatar
Looking for a plugin that can help achieve the following.
  • Server PvP and PvE timings.
  • During PvE, all kind of turrets will shoot.
If anybody has knowledge of such a plugin or a way to implement this, do please let me know.
Avatar
Avatar
Raptross
Looking for a plugin that can help achieve the following.
  • Server PvP and PvE timings.
  • During PvE, all kind of turrets will shoot.
If anybody has knowledge of such a plugin or a way to implement this, do please let me know.
you can you PVPScheduler. My version has a few fixes. You can download at https://discord.gg/nEq9SFvpt9
Invite to join a server
Avatar
Running in server manager. If the server is down due to internal circumstances by the name of a fatal error or crash stack Sometimes the server goes down. What could be causing the server crash in this case? Is there any way to check? What is the best way to fix the problem again??? i need help Do you have a log of the cause? Or can I leave a log with a plugin?
Avatar
You can attach a debugger and follow the call stack
Avatar
Avatar
Frigoff
You can attach a debugger and follow the call stack
I am very curious what to do tell me how🥲
Avatar
https://x64dbg.com/ That's what I personally would use.
An open-source x64/x32 debugger for windows.
Avatar
@Frigoff Can I just run it on the computer running the server? Do I need to take no action?
Avatar
I don't have the time to teach you how to use a debugger. You're in luck though because there are hundreds of tutorials online.
Avatar
@Frigoff I'll ask you one more question I'm so sorry f:\build\lostisland\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1925 I have the f: drive in this part I There is only C drive and D drive. The f: drive is missing. What can...
Avatar
I hope that the summoned creatures under the water will not be hurt. What function should be HOOK to achieve
Avatar
is making it so dinos can damage all building tiers something scope a plugin can do well or does it need to be a mod? I want to keep base risk always a threat even at metal/tek, and make players keep base defense always a concern even in PVE.
9:24 PM
I am going to try out this Brutal ARK Mod but if that doesnt work out def want to explore plugin based stuff and would be good if random wild dinos from say the modpacks also is included.
9:26 PM
potentially look at expanding brutal arks scope to include modded dinos, as i do see people commenting they feel its too easy still
9:28 PM
thinking id want a hook to be able to control does the dinosaur think it can attack a structure, such as allowing them to attack tek building pieces but ignore soul terms/dedi's etc so not possible to full wipe, but still a pain if dino wrecks your base and destroys crafting stations
Avatar
Damage is all server sided
10:44 PM
So it could be possible
Avatar
i mean though whats the best method to change the "X dinosaur destroys metal", do they even fire a damage hook, or does some metadata need to be applied first so they even know to attack it.
Avatar
No idea
11:13 PM
I think a Dino will attack though even if it does no damage
Avatar
Some Dinos can hit metal, I would definitely begin looking at those differences in the dev kit. Then move onto IDA
Avatar
Is there any way I can control the weight of the item?
Avatar
Avatar
Urang
Is there any way I can control the weight of the item?
Items Plus already does that so believe soo.
lethaltrue 1
Avatar
Dumped SDK for Ark: Survival Evolved. Contribute to SubstituteR/ArkSDK development by creating an account on GitHub.
9:43 AM
9:44 AM
look forward to
Avatar
You wouldn't want to use that for anything other than a reference point. It's 3 years old and the classes are not up to date. But to use an SDK like that you must initialize the Global Names and Global Objects as well as give it a valid ProcessEvent address.
Avatar
I think it might be helpful for rapid development, such as simple debugging when DLL is not deployed.At present, you can only enter the game to attach server processes to debug, which is very troublesome.
10:08 AM
I don't know if my understanding is correct.But if it does, it will be very cool!
Avatar
You can use the API on the client if need be. You might have to tweak it a bit.
10:09 AM
There's little to no reason to use an SDK when you have the PDB shipped.
10:09 AM
The only reason you would do it is so that you can get the information at runtime.
Avatar
yeaaaaaaa
10:12 AM
I don't know much about the role of pdb.
Avatar
It provides information about the types and functions found within the binary. (edited)
10:12 AM
It's to aid debugging.
10:13 AM
Typically you don't ship it but ARK has chosen to do so. It makes reversing the game slightly easier.
Avatar
I tried to open it, but the contents were unrecognizable. It may take some software to read PDB properly.
Avatar
You'd use a PDB parser.
Avatar
All right
10:15 AM
ty
Avatar
Though any analysis tool should have that built in.
10:15 AM
IDA does.
10:15 AM
Ghidra does
10:15 AM
Binary Ninja does
10:16 AM
Keep in mind that the decomplication isn't 100% accurate and you'll need to verify things at runtime with a debugger or log the call stack.
Avatar
😫 It seems that I have a lot to learn.
Avatar
Avatar
Frigoff
You wouldn't want to use that for anything other than a reference point. It's 3 years old and the classes are not up to date. But to use an SDK like that you must initialize the Global Names and Global Objects as well as give it a valid ProcessEvent address.
Initializing the SDK's global objects and names and getting ProcessEvent() is easy if you use the SDK in conjunction with ArkServerApi 🙂 you can just get the addresses from pdb
2:54 PM
Actually there a lot of easy changes you can make to the ARK_Basic and ARK_CoreUObject files using ArkServerApi. Lots of room to improve robustness and optimization
2:55 PM
Or modify the generator to use ArkServerApi calls throughout the SDK and greatly improve robustness.
2:57 PM
Or just re-write the generator from the ground up. The original generator's complexity is O(unoptimized craziness), it loops over global objects way more than it really needs to. It gets some types wrong too even though it's based on reflection. And I think there are sometimes alignment issues still.
Avatar
Avatar
TheMollusk
Or modify the generator to use ArkServerApi calls throughout the SDK and greatly improve robustness.
UE4 SDK generators are primarily for games that don’t ship PDB
11:48 PM
They iterated GNames and GObjects to find everything in memory and then dump everything using reflection from UE4
11:49 PM
I agree though that the original should be rewritten
Avatar
ArkServerApi is more robust since it's not reliant on compiled-in class/struct sizes and offsets. But those UE4-Generator based SDKs are kind of nice because they define all classes/structs in reflection and make it trivial to call Blueprint graph UFunctions, which currently requires some extra legwork under ArkServerApi. One could generate an ArkServerApi-based SDK that offers the best of both worlds. (edited)
Avatar
I've thought that it could be nice to have ArkServerApi cache offsets from reflection at startup, in addition to the pdb offsets it already caches. But there are some additional complexities there: reflection isn't initialized until after plugins are loaded, some BP-generated UClasses get garbage collected, etc.
Avatar
SDKs don’t cache at start up
2:39 AM
They cache at first call
2:39 AM
(Find the UFunction into a local static)
Avatar
Yeah and they don't cache variable offsets at all (well they're hardcoded, which is the problem since that can break over game updates). There's A LOT of easy room for improvement in those generated SDKs (edited)
3:05 AM
All kinds of cool improvements that can be made on those SDKs, especially if they're combined with ArkServerApi
3:06 AM
Like you can generate one that gets BP class offsets from the reflection system instead of hardcoded.
3:07 AM
UFunction hooking 🙂 that's a little complicated though because there's a few different way those get called.
3:13 AM
Just hooking UObject::ProcessEvent() or UObject:: CallFunction() or ProcessInternal() is inadequate in a lot of cases. (edited)
3:19 AM
Can basically eliminate the need for BPLoadClass() or FindClass() if a developer wants to use one of the thousands of classes that's not in ArkServerApi headers. No need for ArkServerApi's currently bugged FindProperty(). Much easier to work with BP-generated classes in particular.
Avatar
Plus then you get easy access to all the native Kismet library functions that have the void Foo(UObject*, FFrame*, void* const) signature instead of regular native arguments.
Avatar
@TheMolluskguess who found an actual MSVC bug yesterday
4:22 AM
and confirmed that it's an issue with MSVC explicitly (and not GCC or Clang)
4:23 AM
Sticker
4:23 AM
really upsetting
Avatar
Ooh cool. What kind of bug?
Avatar
it seems to be evaluating an incomplete type as a complete type and throwing a compiler error
4:24 AM
4:24 AM
(if you use any other convention, it's not an issue)
4:24 AM
it also doesn't happen on x64
4:24 AM
no issue on Clang or GCC either
4:24 AM
namespace moar { namespace types { struct variadic_t {}; struct calling_convention {}; struct cdecl_t : calling_convention {}; struct stdcall_t : calling_convention {}; struct thiscall_t : calling_convention {}; struct fastcall_t : calling_convention {}; struct vectorcall_t : calling_convention {}; struct regcall_t : calling_c...
4:25 AM
showing gcc and clang don't have any issue
4:27 AM
a better way to explain it
4:27 AM
using x = void(__thiscall)(); x* my_ptr; std::cout << typeid(x*).name(); == Error
4:27 AM
using x = void(__thiscall*)(); x my_ptr; std::cout << typeid(x).name();
4:27 AM
== OK
4:27 AM
even though the type of my_ptr and the result of typeid should be the same between these
4:31 AM
4:32 AM
like, (stdcall is ok)
4:32 AM
you can see that x = void(__thiscall)(); x* is congruent with x = void(__thiscall*)(); x
4:33 AM
so it shouldn't throw an error
4:33 AM
you can have incomplete types
4:33 AM
just as long as all runtime references point to complete types
Avatar
Oh yeah I'm not familiar with __thiscall (until googling it just now lol, I guess it's ignored on x64?) but that seems weird
Avatar
(such as a pointer to an incomplete type like void*)
Avatar
Good bug finding!
Avatar
it's a calling convention for x32 code
Avatar
Avatar
TheMollusk
Good bug finding!
it's annoying
4:34 AM
it's an actual blocker for me
Avatar
Turns out I have a problem with the cryopodding of unclaimed baby dinos that I was working on earlier. Once released they cannot be imprinted or at least the imprinting quality will not show in the UI and after you imprint once the countdown is not reset and disappears. Similarly cheat SetImprintQuality 1 does not seem to help. They have the whole ancestry and everything else you'd expect for a bred dino in the UI but as far as imprinting is concerned it seems as if they are treated as tamed. Anyone have any ideas what could be causing this issue? Is there a flag signifying that a dino is bred and can be imprinted?
Avatar
Avatar
Tobias
Turns out I have a problem with the cryopodding of unclaimed baby dinos that I was working on earlier. Once released they cannot be imprinted or at least the imprinting quality will not show in the UI and after you imprint once the countdown is not reset and disappears. Similarly cheat SetImprintQuality 1 does not seem to help. They have the whole ancestry and everything else you'd expect for a bred dino in the UI but as far as imprinting is concerned it seems as if they are treated as tamed. Anyone have any ideas what could be causing this issue? Is there a flag signifying that a dino is bred and can be imprinted?
RIO (Александр) 4/7/2023 4:30 PM
Hi. are u use UpdateImprintingDetails?
Avatar
No, I can't do much at the time they put in cryopods as the player might be offline so there is no player controller. I found out that even if you cryopod an unclaimed dino it will be tamed when released, so taming team and everything gets set just from releasing it. Not sure which things I need to call to initialize it as bred, but I'll check out UpdateImprintingDetails to see if that might be it.
Avatar
Avatar
Tobias
No, I can't do much at the time they put in cryopods as the player might be offline so there is no player controller. I found out that even if you cryopod an unclaimed dino it will be tamed when released, so taming team and everything gets set just from releasing it. Not sure which things I need to call to initialize it as bred, but I'll check out UpdateImprintingDetails to see if that might be it.
RIO (Александр) 4/7/2023 4:53 PM
u try to set imprint after deploy, right? u can get controller of the one who releases dino
Avatar
Calling UpdateImprintingDetails seem to fix the issue. Thanks! Yeah, I think calling it on release is probably the best idea. Might also be possible to set it up with the tamer or imprinter from the mother before cryo, but then who it imprints on would be predetermined so not great.
5:02 PM
Although if calling UpdateImprintingDetails on release you have to somehow decide which dinos to call it on.
Avatar
RIO (Александр) 4/7/2023 5:03 PM
yeah. set imprint after release is great idea.
Avatar
Avatar
Tobias
Although if calling UpdateImprintingDetails on release you have to somehow decide which dinos to call it on.
RIO (Александр) 4/7/2023 5:05 PM
u can set hook Hook_APrimalDinoCharacter_SpawnFromDinoDataEx and check targeting team or claim. if ok - claim dino and set imprint
Avatar
Is that only called on cryopod release or upload/dowload/load from save too?
5:10 PM
When I release it the game auto claims the dino for my team even if it was unclaimed before being podded. So I have to check if it is still unclaimed in that hook or not.
Avatar
Avatar
Tobias
Is that only called on cryopod release or upload/dowload/load from save too?
RIO (Александр) 4/7/2023 5:16 PM
it didn't called for me when dino was downloaded from data
Avatar
Awesome. I'll see if I can get it working. Thanks again!
Avatar
RIO (Александр) 4/7/2023 5:21 PM
I will be glad if u succeed 🙂
Avatar
Avatar
Tobias
Awesome. I'll see if I can get it working. Thanks again!
After releasing unclaimed dino imprint owner is not set. It sets only your team (tribe) AFAIK. (edited)
Avatar
I got it working with RIOs help 🙂
Avatar
Not sure where to post this. But a lot of the source code for the plugins found at: https://github.com/ServersHub/Ark-Server-Plugins is out of date. Are there any plans to update these? Was using them as a resource to learn how to make plugins and it would be nice if they were up to date.
Avatar
Avatar
Necronym
Not sure where to post this. But a lot of the source code for the plugins found at: https://github.com/ServersHub/Ark-Server-Plugins is out of date. Are there any plans to update these? Was using them as a resource to learn how to make plugins and it would be nice if they were up to date.
GSH | MrOwlSky 4/28/2023 5:47 PM
I think @Foppa took some of those plugins over if not mistaken might be a good question for him.
Avatar
The repository is pretty inconsistent. I think there's a lot of old stuff in there that not too many people care about, and then there's new stuff added in with entirely different project organization and styles. One of the things that irked me most about that repo when I was first learning to develop plugins is that you can't tell what version of ArkServerApi headers you need for some plugins. The repo has a submodule that points to a 5 year old version of ArkServerApi. Some plugins do seem to use that submodule. Other plugins seem to use that submodule path but a different version of ArkServerApi. Other plugins just have ArkServerApi include paths that point outside the repo. Looks like there's a bunch of GamingOG plugins stuffed in there now too, and mods apparently.
👆 1
Avatar
Was looking into sending and receiving chat messages using a custom plugin. Sending a chat message to all players seems simple enough using ArkApi::GetApiUtils().SendChatMessage() . How would one go about reading the last chat message on the server? (edited)
Avatar
Avatar
Necronym
Was looking into sending and receiving chat messages using a custom plugin. Sending a chat message to all players seems simple enough using ArkApi::GetApiUtils().SendChatMessage() . How would one go about reading the last chat message on the server? (edited)
Just cache them
Avatar
Avatar
SR
Just cache them
How do i get them though? Is there a function that will get the last message or hook or somthing?
Avatar
Avatar
Necronym
How do i get them though? Is there a function that will get the last message or hook or somthing?
Hook every sent message and create variable "last sent message" after new message sent pass the values in this variable
Avatar
Avatar
SR
Hook every sent message and create variable "last sent message" after new message sent pass the values in this variable
ty. i will give this a go.
Avatar
How should I use the function SetUniqueId (TSharedPtr<FUniqueNetId, 0>* InUniqueId)?
Avatar
It's part of the network subsystem (which has implementations for steam, eos etc.) What are you doing with it?
Avatar
Construct an Aplayerstate to simulate players entering and leaving the game
Avatar
Avatar
Tommmmmm
Construct an Aplayerstate to simulate players entering and leaving the game
That isn’t a supported use-case. That’s almost always used for faking players.
Avatar
Avatar
TheMollusk
I've thought that it could be nice to have ArkServerApi cache offsets from reflection at startup, in addition to the pdb offsets it already caches. But there are some additional complexities there: reflection isn't initialized until after plugins are loaded, some BP-generated UClasses get garbage collected, etc.
Saw this message from a while back. Do you know what BP-generated UClasses get garbage collected? I have a lot of code like this: c++ static UClass* Tusoteuthis_Character_BP_C = (UClass*)Globals::FindClass("BlueprintGeneratedClass /Game/PrimalEarth/Dinos/Tusoteuthis/Tusoteuthis_Character_BP.Tusoteuthis_Character_BP_C");
Avatar
Not really. It's something I should look into more. I remember noticing in the past that when the server first starts it has more UClasses loaded than it does later on. So maybe the server just loads more stuff than it actually needs to in the first place, or it's just used on initialization. I think pretty much any UClasses/UFunctions/etc that you use in plugins are going to have other references to them that prevent them from being garbage collected. So caching them by pointer or internal index is probably okay. Maybe using weak object pointers would be more safe, but there's a slight runtime cost there.
Avatar
Okay. That sounds like it hopefully wont be much of an issue 🙂 Thanks!
Avatar
Typically I just look stuff up when the server is ready, check for null, and store the raw pointer for later use. Just need to be a little careful when using classes or structs that don't get loaded on all maps.
Avatar
Avatar
TheMollusk
Typically I just look stuff up when the server is ready, check for null, and store the raw pointer for later use. Just need to be a little careful when using classes or structs that don't get loaded on all maps.
BPLoad class works fine for that
Avatar
If you load an unloaded class with BPLoadClass(), would that be garbage collected later, or does BPLoadClass() prevent that? I should get more familiar with that function too. I tend to go to Globals::FindClass() as my default since you can use it to find anything in global objects, not just classes, and I think BPLoadClass() doesn't work for getting a pointer to native classes (or I just don't know what string to use lol).
Avatar
Is there a plugin that cheats the number of players on the server?
😂 1
🇫 1
Avatar
no, and it's not allowed to make or redistribute one (edited)
Avatar
@WETBATMAN Oh, there was a reason About each other's power while opening the streamer server I tried to make it a non-shareable clause Is there any reason why it couldn't be done?
8:10 PM
` Your plugin is very good Thanks for making such a nice plugin
Avatar
nobody in this server will make it for you and if they do they will be banned from GameServersHub (edited)
Avatar
@WETBATMAN Oh I didn't know this was a ban I'm really sorry I was trying to make it for the purpose of using it as content. I wonder why this is a problem Is there any potential for abuse?
Avatar
it's pretty obvious i think, you're faking the number of players on your server....
Avatar
@WETBATMAN ???? Why are you making me a bad person? Not intended to be abused, only on the streamer's server We don't want to reveal each other's strengths. so i ask you Are there any potential exploits that make me a bad person? I wonder why. It was simply intended for use on streamer servers.
8:21 PM
An attempt to cheat the number of players on the server I'm curious what the problem is. Right now my server is not faking the number of players on the server. When a streamer simply creates a server and plays Because they don't want to reveal each other's player count.
Avatar
Avatar
WETBATMAN
it's pretty obvious i think, you're faking the number of players on your server....
I don't understand why you're making me a bad person.
Avatar
Avatar
WETBATMAN
nobody in this server will make it for you and if they do they will be banned from GameServersHub (edited)
we should probably make a code of conduct
9:58 PM
and just point these people at it lol
Avatar
Avatar
참치
I don't understand why you're making me a bad person.
It's very looked down on in the player, server owner, and developer communities This leads to servers and clusters incorrectly looking more popular than they are and basically lieing to get players to join and making unfair competition for other servers. This is something the developer community has decided to ban completely.
👌🏾 1
Avatar
Avatar
Kal
It's very looked down on in the player, server owner, and developer communities This leads to servers and clusters incorrectly looking more popular than they are and basically lieing to get players to join and making unfair competition for other servers. This is something the developer community has decided to ban completely.
thank you for the reply I didn't know if there was a reason for that. It was a simple reason, but I didn't know it had something to do with it. Besides, Batman's making me a bad guy I felt very bad. It's not a bad thing for me to ask questions.
Avatar
Np Felt like it might be a language barrier or communication issue and wanted to give a straight forward answer
Avatar
Let's think so. But I didn't think about cheating. It's for a simple reason.
2:15 AM
streamer server It is not a competition based on the number of people. I thought of it as pure strength and power.
Avatar
If it was unlisted I could see it being "not abused" but the functionality is still too abusable and not allowed in the community
Avatar
Avatar
Kal
If it was unlisted I could see it being "not abused" but the functionality is still too abusable and not allowed in the community
All right. I just wanted to use it as a personal server If you can't do it, you'll have to think of another way. Is there any way to hide the number of players?
Avatar
server tracking sites will ban your ip if you tamper with playercount which is not what you want most likely
Avatar
Honestly I could see the case being made for a plugin that makes the player count look like 0 😛 But listing sites will ban you completely
2:22 AM
And there would probably be several ways to check for real
Avatar
After all, if you have a problem, don't do it. Too bad. I wanted to use it as content. Thanks for your reply.
Exported 7,815 message(s)
Timezone: UTC+1