Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Darthseid> Previously, onModDota
- <Darthseid> Dartjseid:Is it possible to get the attribute bonuses from an item to also apply when it is in stash? Or do you need to write out the txt of each item or something like that?
- <Darthseid> Noya:You need to do a loop of slots 6 to 11
- <Darthseid> with GetItemInSlot
- <Darthseid> then GetIntrinsicModifierName em
- <Darthseid> and apply them
- <Darthseid> everytime the stash changes you have to remove/reapply
- <Darthseid> https://codeshare.io/662cN
- <Darthseid> I am getting no prints or errors in console.
- * Disconnected (Connection reset by peer)
- * Now talking on #dota2modhelpdesk
- * Topic for #dota2modhelpdesk is: Dota 2 Modding Helpdesk: Ask your question, and we'll try to answer you | Forum: https://d2md.me/ | If in doubt, refer to https://d2md.me/d/14 | Use http://codeshare.io/new to share code bits. | Check for dota updates at http://store.steampowered.com/news/?appids=570&feed=steam_updates
- * Topic for #dota2modhelpdesk set by *.GameSurge.net (Sun Dec 13 19:11:13 2015)
- * ChanServ gives voice to Noya
- <Darthseid> Well show me how its done cuz incontestably, there's a disagreement.
- <Darthseid> Noya, do you need me to fill you in the deets or can you already guess what's going on?
- <BMD> wtf is "(attribute)"
- <BMD> why are you just guessing
- <BMD> why do you always guess
- <BMD> like, you're kind of on the right track, though it still needs some work
- <BMD> but you seem to think nthat somehow "(attribute)" will get the value from your local named "attribute"
- <BMD> which is crazy, but what's even crazier is instead of "(attribute)", all you had to do was
- <BMD> attribute
- <BMD> because that's how variables work
- <BMD> now that said, you don't provide any way to remove modifiers applied ikn this way, this way will only work for default dota items or item_lua
- <BMD> and nothing else
- <BMD> or wait
- <BMD> it'll work for nothing
- <BMD> because ability:ApplyModifier isn't a thing
- <BMD> it's nothing
- <BMD> there's ability:ApplyDataDrivenModifier
- <BMD> and npc:AddNewModifier
- <BMD> you've chosen neither
- <BMD> and the thing is, whichever one you choose isn't sufficient
- <Darthseid> I was going to use ApplyDatadriven but I didn't think it would be datadriven
- <BMD> one covers only datadriven, and the other covers only built-in dota items adn item_lua
- <BMD> additionally, if it IS datadriven, then item:GetIntrinsicModifierName doesn't work
- <BMD> because a datadriven doesn't have an intrinsic modifier, it has potentially multiple Passive modifiers
- <BMD> which work similarly but aren't accessed in the same way
- <BMD> if you want to know how to get at that stuff, then you get to check out some of the fun KV diving code I wrote for my containers library
- <BMD> and now, let's assume that you fix all that
- <BMD> and now you can handle datadriven + regular dota items + item_lua
- <BMD> and add them correctly
- <BMD> now you need to handle removal correctly
- <Noya> wait
- <BMD> because shit is going to go really badly unless you have extraordinarily tight controls over your items
- <BMD> really really badly
- <Noya> datadriven doesnt have intrinsic modifier?
- <Noya> Even if its "Passive" "1" ?
- <BMD> that didn't show up when i build containers.lua
- <Noya> in an item
- <BMD> so unless it was added in the last patch
- <Noya> I see
- <Noya> so yeah you'll have to read some KVs
- <func_door> An ability can only have one intrinsic but a data driven can have multiple "Passive" "1"
- <func_door> Afaik
- <BMD> https://github.com/bmddota/ContainersPlayground/blob/master/game/dota_addons/containersplayground/scripts/vscripts/libraries/containers.lua#L342-L385
- <BMD> that's how i handle finding the passives for datadrivens
- <Darthseid> What were you saying about removal?
- <BMD> and here's how oyu apply them correctly https://github.com/bmddota/ContainersPlayground/blob/master/game/dota_addons/containersplayground/scripts/vscripts/libraries/containers.lua#L101-L141
- <BMD> notice all of the tracking actions
- <BMD> because you need fun stuff like this
- <BMD> https://github.com/bmddota/ContainersPlayground/blob/master/game/dota_addons/containersplayground/scripts/vscripts/libraries/containers.lua#L1647-L1657
- <BMD> in order to handle cases like where your items get pulled into a recipe from stash
- <BMD> and are effectively "destroyed"
- <BMD> or in my case, where a user eats a mango in their equipment container
- <BMD> so that i can properly remove the mango +1 hp regen passive
- <Darthseid> So should this code be on the ability file or should it be apart of the library?
- <BMD> you need to explain what you want to do
- <BMD> very carefully and correctly
- <BMD> and i'm going to tell you if it's even remotely possible for you to accomplish it
- <Darthseid> I want the passive modifiers in inventory to also apply from the stash.
- <BMD> that's a terrible idea
- <BMD> don't do it
- <Darthseid> So if I have boots in my stash, I move faster
- <BMD> there are dozens of seriouslty fucked up edge cases
- <BMD> when workign with this stuff
- <BMD> and at least 4 ways to crash a server
- <BMD> by doing incredibly simple things
- <BMD> you're literally asking for something no one else has done except me
- <BMD> ever
- <BMD> and there's a reason for that
- <Darthseid> I thought this was a community of boundary pushers who's motto is "The sky is the limit."
- <Darthseid> If only we had an actual Valve employee with us.
- <Darthseid> Well, I guess my 3rd ability is officially in beta stage now.
- <func_door> I mean, if every item in the game is custom, it becomes more sane
- <Darthseid> If the game was coded completely in lua and we had the source code, it would be doable.
- <BMD> dude
- <BMD> you can't write code for shit
- <BMD> you're literally the worst i've ever seen at it
- <BMD> who didn't give up immediatley after realizing it
- <BMD> and you're asking to do something that literally no one else besides me has done
- <Darthseid> But I'll get over it, I almost in the beta stage for my mod.
- <BMD> adn that's the thing, i have done it
- <BMD> and i can do it
- <BMD> but *you* can't do it
- <BMD> i could write every line for you
- <BMD> and i don't think you'd be able to even use it
- <BMD> this isn't a simple change
- <BMD> this is the fucking real world of dota modding you're asking about
- <BMD> not some bullshit fuckaround time
- <BMD> you're asking for a way to evade one of the intrinsic properties of the game engine
- <BMD> and literally no one does that but me
- <BMD> i can also tell you for sure that i know more about this side of the engine that almost anyone at valve
- <Darthseid> you must truly be the duke of modders here.
- <BMD> so trust me when i tell you that what you want to do shouldn't be done
Add Comment
Please, Sign In to add comment