Open Gichik opened 8 years ago
Can't do this from my iPad. @SinZ163 want to have a look in my stead? I'm boarding a plane in a few hours.
Nothing, I'm not in a hurry :)
So, what about schem?
Landed a few hours ago, and have just woken up. Let's have a look.
In the future, I highly recommend throwing your four files onto hastebin or pastebin, so they can be easily accessed.
I would highly recommend having a variable for each slot, instead of doing the concatenated list.
Up to you though.
function GetItemSlot(hero, slot)
versus function GetItemList(hero)
I've added both schemas, so pick the one you want and let me know so I can reject the other:
You grab the schemaID from: https://getdotastats.com/#s2__my__mods
Oh, thank you very much!
I generally do not care, and you advise the second option? (Sorry for my bad enlgish)
Yes, advise the second. The first will make a lot of combinations that can't be filtered down efficiently.
Well, I understand, it is enough for me to abandon the function GetItemList(hero), instead of a variable "il" to have a few (i1,i2 ...) and send them through name GetItemName()?
Or write a function that will return precisely handle things?
The function already exists. Check the utililities.lua
in the lib folder under stat-collection.
-- String of item name, without the item_ prefix
function GetItemSlot(hero, slot)
local item = hero:GetItemInSlot(slot)
local itemName = ""
if item then
itemName = string.gsub(item:GetAbilityName(), "item_", "")
end
return itemName
end
I should use it or GetItemName(hero, slot) ?
They seem to be the same:
function GetItemName(hero, slot) local item = hero:GetItemInSlot(slot) if item then local itemName = item:GetAbilityName() itemName = string.gsub(itemName, "item", "") --Cuts the item prefix return itemName else return "" end end
Yea, whatever floats your boat. At the end of the day, they are your stats, and as long as they aren't creating a burden on the shared resources of the server, then I don't mind too much.
Well, I send you the new schema file?
For archiving purposes yes. If it matches that second schema, then you're ready to go.
Yes, I used the GetItemSlot (hero, slot) Now I send.
If i right understand:
What about slot 6? lol
Oh, right :D I forgot
and it's 0 based, like the rest of LUA.
i1 = slot0, i2 = slot1
LoD does their stats differently, but here's the relevant part:
https://github.com/LegendsOfDota/LegendsOfDota/blob/master/src/scripts/vscripts/pregame.lua#L333
Yeah, right, I have not woken up :))
Well, if that's all, then once again thank you and good day for you.
No problem. Thanks for putting up with me. Been awfully busy as of late. :(
Oh, and I see that the majority of your games aren't finishing. If you have dedi's you will want to check that you actually end games by setting a teamWinner.
Games that don't finish don't get end of game stats.
@SinZ163 can weigh in if it's not a simple case of setting the team as winner.
I have bad englesh, what is dedi?
In some my games people just leave, becouse all die or another problems.
official dedicated servers.
If your games have Valve official hosting, then all games play to the end. Without dedicated servers, they don't end if the person hosting the game rage quits.
Oh, yes, i have dedi.
Hmmm, ok, i try to see. Maybe the problem is in my sometimes inaccurate code.
Let us know if you need help. It appears to work about 40% of the time. You must have some unexpected condition that causes this. Figure out all the winning and losing posibilities and see how they are covered. Make sure you don't use the SetTeamLoser (don't remember the exact name) function.
In one map, I counted a victory if the NPC will not die for 24 minutes.
The other two - if for 20 minutes all not die.
In both cases, it is time dependent. And, I do not check the situation where everyone can leave.
I use SetGameWinner(), and also in one in Hammer in npc_dota_base use SetGameWinner then this entity die.
Looks like you found the cause, very quickly.
You may want to look at how we wait for game states, and add some logic in your main LUA file similar to ours. You should add a detection for game state entering post_game (DOTA_GAMERULES_STATE_POST_GAME
), and setting victory for the NPC team if it reaches this state before your time limit.
@SinZ163 found these, to further corroborate that post_game is the best place to be checking for this. There is no in-between state from start of game and end of game.
https://github.com/ModDota/API/blob/master/dota_enums.d.ts#L14
I'm off for now. Holler if you need help. There is no particular rush to fix this, but your stats won't be very representative until you do.
I'm sorry, I do not quite understand: After the death of the NPC, I have to check stage game and if this a POST_GAME then set winner?
Or after the death of the NPC to establish the winner and also in a POST_GAME?
Just set a listener to check if the game state changes. If the game state changes to post game before your time limit of 20mins, then set the NPC team (or any team that does not have real players on it) as the winners.
ohh, ok, thanks
console_log_invasion.txt
invasion_files.zip