-
Notifications
You must be signed in to change notification settings - Fork 39
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
NOT AN ISSUE FOR THIS PROJECT BUT: #227
Comments
utility = require(GetScriptDirectory() .. "/utilityFunctions"); <-- LINE #4 seem like that file doesn't exist for you |
actually, seems it exists, but probably doesn't have a return (b/c "utility" is being treated as a boolean, not a module) |
@Nostrademous already fixed that edit: the link to the other script: http://collabedit.com/ryu9a |
utils.GetWeakestUnit() can return "nil". You don't check before passing it on line #80 in ability_item_usage_phantom_assassin.lua |
Yes, thank you @Nostrademous , that was the problem. |
what is the name of that file? Is it ever being called? |
@Nostrademous yes, I added two prints in the two ifs (it jumps into 2nd one, that one that matters to purchase smthg.) but it does not purchase the item. |
this is not working: npcBot:Action_PurchaseItem( sNextItem ); |
it should be: npcBot:ActionImmediate_PurchaseItem( sNextItem ); |
But I used the example scripts by valve? how can they be wrong? |
also @Nostrademous pls come online in steam. quicker and easier to chat... |
IT IS WORKING! #fuckValve |
@Nostrademous I have a working hero_selection.lua script, but then I play with another person (me + the other guy = 2 human players) one of the bots does not pick a hero. Why |
the bot player-id slot # changes depending on how many people are in the game |
@Nostrademous thank you. will look into that. http://collabedit.com/vcen9 |
that's harder - you either send the courier there, or walk there and buy it. |
but how. and what if I go there? I don't see an action or smthg in the list to purchase secret shop items, only normal items. Can you help me? |
It is the same as buying normal items, you (or courier) just have to be at the right location. |
Yeah, but how do I send the bot there? is there a command GetBot():ACTION_IMMEDIATE_GOTO_SECRET_SHOP() or smthg like that? |
Nope... there is a "Action_MoveToLocation( vecLocation )" and you can specify the Vector of the shop location. "Immediate" actions are only for actions that take less than 1 frame to complete. Move locations are harder, because it might take you 30 seconds to walk there.. and while you are walking you might run into enemy heroes... what then? That is why my code has a mode named shop "https://github.com/Nostrademous/Dota2-FullOverwrite/blob/master/modes/shop.lua" which does all that work. Yes, it gets complicated. |
That does not help me too much. Can you not just write an example code for how to walk to the secret shop, purchase the item in the list and remove it from the list? I am using this: function ItemPurchaseThink()
end; |
But the bot keeps not purchasing the item and just skips over it. (The secret shop item; all others are bought just fine) |
you cannot do that because "ActionImmediate" happen right away. You need to do your ActionPush_MoveToLocation() and get to the shop first, before you do the rest.
The code above should work (but doesn't do anything if you run into enemy heroes for example on your way to shop). I assume 400 is the interaction distance with a shop... would have to check to be sure that value is sufficient. |
@Nostrademous Thank you, did not test it yet, but I have no doubt it works. Other thing, I noticed my pa does use the dagger to harss, but not in creeps, although I tell her to;
|
only the lower part works |
Not enough code for me to tell you honestly, chances are that the "WeakestCreep" variable is simply "nil" and thus it doesn't work. |
print the value of "WeakestCreep" and "nLowestCreepHitPoints" |
No, the variable is not nil. I can see the Action_ImmediateSay( "Tryint to lasthit with dagger", true ) in allchat. @Nostrademous Print? is it not easier to let the bot call it? |
It is possible that PhantomStrike is over-writing it then. You should return with BOT_ACTION_DESIRE_MEDIUM... but in the higher level function you have code that says only do the Dagger if castDesireStiflingDagger > castDesirePhantomStrike. If Phantom Strike evaluation is also BOT_ACTION_DESIRE_MEDIUM the ">" is not met and it won't use it. If that's not the case then perhaps he is casting the dagger, but before the cast point of the ability is met (the animation) you tell the bot to do another action, canceling the currently executing one. |
Updated the code (and the collabedit). I added +0.1 after the BOT_ACTION_DESIRE_MEDIUM |
@Nostrademous so I tested it, pa is not using any of the skills on creeps. And only throws her dagger on enemy heroes. |
Then it is a case of another command over-riding it. |
@Nostrademous could it be something the original default bots do? |
Did you create your own "bot_phantom_assassin.lua"? If so, what is your "Think()"? |
No, I did not. I have no think. What is the bot_pjhantom_assassin.lua" script for? |
@Nostrademous @eteran @reidzeibel @RabidCicada @dralois I really need some help. I tried to do some coding again, so I can or maybe will be of help for this project some day, but I am too stupid for lua.
CONSOLE OUTPUT:
VScript] Script Runtime Error: ...ts\vscripts\bots\ability_item_usage_phantom_assassin.lua:68: attempt to index global 'utilityFunctions' (a boolean value) stack traceback: ...ts\vscripts\bots\ability_item_usage_phantom_assassin.lua:68: in function 'ConsiderStiflingDagger' ...ts\vscripts\bots\ability_item_usage_phantom_assassin.lua:22: in function <...ts\vscripts\bots\ability_item_usage_phantom_assassin.lua:8>
my script: "http://collabedit.com/ej2py"
The text was updated successfully, but these errors were encountered: