I use the Cargo Train Event plugin from Nikedemos.
This cargo train has 1 bot as a driver that uses a player prefab and when killing him this is counted as a player kill in the statistics.
I talked with Nikedemos about this but he explained in a very complex way why he cannot change anything about it.
He said "unfortunately no API" btw. as he took a look at your plugin. Tbh. I have no clue what that means. :)
So, my question is if you see any way to prevent Player Challenges from recognizing this bot kill as a player kill.
I could surely give you contact to Nikedemos if you wish.
Thank you.
Cargo Train Event driver kill gets noticed as player kill
API stands for Application Programming Interface. In short, it's a generic term to describe a way for two programs (plugins) to talk to each other.
I have an in progress plugin for automating workcarts and somebody pointed out a similar issue for another plugin, which is that the conductors are on a leaderboard and their stats are updated as they run over tunnel dwellers.
I believe the fix for a plugin like this is to simply check the user id of the player to see if it's a steam id. I believe the ulong data type already has a method for this so the developer can do something like basePlayer.userID.IsSteamID() (capitalization might be wrong there).
However, I'm concerned that there will be many plugins affected, so I wonder if using an NPC prefab for the train conductor is preferred over a player prefab. I haven't worked with NPCs before and there are a lot of plugins affecting them (some that try to remove them), so it would also likely have some compatibility issues. I believe it is also possible to automate the workcarts without a player, at least to prevent the engine turning off after it had started (though with a minor performance cost).
WhiteThunder
API stands for Application Programming Interface. In short, it's a generic term to describe a way for two programs (plugins) to talk to each other.
I have an in progress plugin for automating workcarts and somebody pointed out a similar issue for another plugin, which is that the conductors are on a leaderboard and their stats are updated as they run over tunnel dwellers.
I believe the fix for a plugin like this is to simply check the user id of the player to see if it's a steam id. I believe the ulong data type already has a method for this so the developer can do something likebasePlayer.userID.IsSteamID()(capitalization might be wrong there).
However, I'm concerned that there will be many plugins affected, so I wonder if using an NPC prefab for the train conductor is preferred over a player prefab. I haven't worked with NPCs before and there are a lot of plugins affecting them (some that try to remove them), so it would also likely have some compatibility issues. I believe it is also possible to automate the workcarts without a player, at least to prevent the engine turning off after it had started (though with a minor performance cost).
I went with one of the standard Scientist NPCs prefabs. The side effect was, unfortunately, the NPC would drive the train AND shoot at you at the same time when mounted, facing you and spraying bullets through the door. It looked and worked really awkward. Nope. Focus on the train track, Driver, you have one job, leave the rest to the boys in the blue.
Sure, you can have a driverless train... but that's not what the Cargo Train Event is. You can try and keep the driver alive and they will randomly traverse the train system (and provide infinite fuel while they do so) - but the driver will stop when the train is attacked.
Or you can kill the driver and take control of the train yourself. In that case, whenever you get off the train, since there's nobody left on the train, it will stop. Also, you need to have fuel.
So using an actual physical driver is not a clutch, it's a gameplay choice to allow players some strategy. That's why I don't network the driver out or manually feed server input to the train.
He said "unfortunately no API" btw. as he took a look at your plugin. Tbh. I have no clue what that means.
You never asked me what that means ;) In this specific case, I wanted to see if Player Challenges called a hook like "OnPlayerStatisticAdded" or something that I could intercept and "tell" Player Challenges "no, I [the plugin that's subscribed to respond to this hook] have decided that this shouldn't count. Here's a lovely non-null return value for you, Player Challenges, that's how you know you should not count this"he explained in a very complex way why he cannot change anything about it.
(sorry, couldn't use "quote" inline, this effing post editor does not know what one paragrph is, instead it quotes everything up to the first inline quote... fix this please, it's really annoying!)
I said there's nothing I could do from the side of my plugin, but I offered to send k1lly0u a patch that checks the user ID to determine if it's a real player or not - and you have conveniently ommited that part ;)
Maybe a naive question, but can you dequip the NPC and disable their AI?
WhiteThunder
Maybe a naive question, but can you dequip the NPC and disable their AI?
Haven't played around with AI much more after that, since spawning a plain BasePlayer did the trick just right
Yesterday I resumed work on the Automated Workcarts plugin so I will try it this week and let you know how that works out.
WhiteThunder
Yesterday I resumed work on the Automated Workcarts plugin so I will try it this week and let you know how that works out.
Yeah that'd be swell, let me know for sure
this issue is also happening with Space Plugin by Adem as well
Merged post
if (killed == null killed.IsNpc) return; => if (killed == null !killed.userID.IsSteamId()) return
This is what i told a fix could be havent tried just yet however