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