Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[SCHEMA] Invasion of zombie #85

Open
Gichik opened this issue Oct 20, 2016 · 34 comments
Open

[SCHEMA] Invasion of zombie #85

Gichik opened this issue Oct 20, 2016 · 34 comments

Comments

@Gichik
Copy link

Gichik commented Oct 20, 2016

console_log_invasion.txt

invasion_files.zip

@jimmydorry
Copy link
Member

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.

@Gichik
Copy link
Author

Gichik commented Oct 21, 2016

Nothing, I'm not in a hurry :)

@Gichik
Copy link
Author

Gichik commented Oct 22, 2016

So, what about schem?

@jimmydorry
Copy link
Member

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.

@jimmydorry
Copy link
Member

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

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

Oh, thank you very much!

I generally do not care, and you advise the second option? (Sorry for my bad enlgish)

@jimmydorry
Copy link
Member

Yes, advise the second. The first will make a lot of combinations that can't be filtered down efficiently.

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

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?

@jimmydorry
Copy link
Member

jimmydorry commented Oct 23, 2016

The function already exists. Check the utililities.lua in the lib folder under stat-collection.

https://github.com/GetDotaStats/stat-collection/blob/master/game/dota_addons/YOUR_ADDON/scripts/vscripts/statcollection/lib/utilities.lua

-- 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

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

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

@jimmydorry
Copy link
Member

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.

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

Well, I send you the new schema file?

@jimmydorry
Copy link
Member

For archiving purposes yes. If it matches that second schema, then you're ready to go.

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

Yes, I used the GetItemSlot (hero, slot)
Now I send.

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

If i right understand:

http://hastebin.com/ceyovalahu.lua

@jimmydorry
Copy link
Member

What about slot 6? lol

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

Oh, right :D
I forgot

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

@jimmydorry
Copy link
Member

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

@jimmydorry
Copy link
Member

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

Yeah, right, I have not woken up :))

http://hastebin.com/apukazayul.lua

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

Well, if that's all, then once again thank you and good day for you.

@jimmydorry
Copy link
Member

No problem. Thanks for putting up with me. Been awfully busy as of late. :(

@jimmydorry
Copy link
Member

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.

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

I have bad englesh, what is dedi?

In some my games people just leave, becouse all die or another problems.

@jimmydorry
Copy link
Member

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.

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

Oh, yes, i have dedi.

Hmmm, ok, i try to see. Maybe the problem is in my sometimes inaccurate code.

@jimmydorry
Copy link
Member

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.

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

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.

@jimmydorry
Copy link
Member

jimmydorry commented Oct 23, 2016

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.

https://github.com/GetDotaStats/stat-collection/blob/master/game/dota_addons/YOUR_ADDON/scripts/vscripts/statcollection/lib/statcollection.lua#L170

@jimmydorry
Copy link
Member

jimmydorry commented Oct 23, 2016

@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.

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

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?

@jimmydorry
Copy link
Member

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.

@Gichik
Copy link
Author

Gichik commented Oct 23, 2016

ohh, ok, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants