i dont have heartstoned installed here, just look through the directoys for a outputlog.txt or something![]()
i dont have heartstoned installed here, just look through the directoys for a outputlog.txt or something![]()
it's Hearthstone/HearthstoneData/output_log.txt.
You should see a message like: Loading <yourdll> and maybe some error after that
Indeed, the output is called 'output_log' in Heartstone_data subfolder.
And i understood my misstake : i forgot to copy my custom dll into heartstone folder ... Stupid misstake.
I will begin my developpement now.
Thanks.
I was trying to implement a way to compile and run scripts at runtime (eg. "run foo.cs" in cheatmgr console) but it can't find System.CodeDom.Compiler. Based on some web searches, it seems by default Unity compiles against a subset of .NET and thus it's not included.
Does anyone with more experience know if there's a way around this?
I am currently trying to play a card.
I have used maddin's sample : function playcard(Card).
The right card is passed as a parameter, the whole function seems to be executed but thread could crash...
When not any card can be played, custom dll use button "next ruen" but when a card can be played, i have some logs indicating which card is currently played but nothing happends ... And then thread isnt execute anymore...
Is your helperclass working righ ?
Thanks
Iam unsure if the class is uptodate , but Even then its highly hackish :-) try to catch the exception which is Killing the Thread , should at least Give you a starting Point
Oh, right.
Do you have some advises on how find right workflow to use to do some actions ?
Is it only by searching in decompialted dll ?
Thanks![]()
Yep, you need to read and read, and then read a bit more
After a while you get a good Feeling how they code.
@overture
What benefit do you see in this approach ?
Dont get me wrong, i see some benefits, but iam unsure if they are worth the hassle.
I guess i would first try to copy the .net framework dlls, identify the right one, and alter namespaces and references.
After that i would try to conviniece Unity to load them.
Unsure how good this would work, but i dont see a problem with this approach, could be worth a try.
BUT
Are you gainig enough advantage to make it worth the work? Especial as there is sooomuch work todo which is more important then in process compilation
As a workaround for the moment i would suggest.
Build a Pluginsystem, which is loading in the mainloop of you injected dll, every dll which he thinks isnt loaded yet. Or use some sort of IO and a seconde process. Push source into a file, let theProcess check for the File and Compile.
The idea was to make experimentation quick and easy.
In the end, I did something similar to your suggestion. A filesystem watcher looks for changes to any plugin DLLs in a set directory and additionally I can manually execute them with the cheatmgr console. Since I cannot load a different version of the same dll, I use mono.cecil to modify the assemblies (change name, etc), launch the plugin in it's own thread, and kill the thread corresponding to the old version of the plugin, if there is one.
The end result is a one-click solution (just hit rebuild) and I can immediately see the results in game.
Things I have working:
- playing minions
- attacking (a bit poor and sometimes crashes; probably related to attacking enemy hero, delays between attacks, or invalid attacks)
- switching to practice screen and launching game versus AI
Things still figuring out:
- how to get deck IDs for the various practice AIs [EDIT: solved]
- how to figure out if a minion can attack (card.GetEntity().CanAttack() seems to be whether that card can /ever/ attack and thus is true for all minions I've tested)
Last edited by overture2112; 01-24-2014 at 03:28 PM.
Wow, that is a great start. I have been having problems with the missing framework commands like System.IO.File. it just is not loaded in Unity it seems.![]()
Last edited by viperbot; 01-25-2014 at 03:35 AM.
]
Sure. Here's a git repo https://github.com/sigmundnetski/Sigmund
It'll play through a few turns but probably crash before finishing a game (much sooner if your deck has minions that require targets when you drop them into play or other things that aren't supported). That said, hopefully this accelerates anyone who was interested but maybe couldn't get the basics working.
Note: I mostly spend my time in functional languages and rarely deal with .NET, so I might mess around with doing some plugins in F# later.
Realy nice work!
Thanks for sharing.
We both use pretty much the same design for loading new plugins
@Viperbot iam not aware that such a thing exists, is the execution of this code throwing any exception ?
No, I just could not get this command to work:
System.IO.File.WriteAllText(@"C:\tesths.txt", "test");
It seems like its a bug in unity3d specific to this version, as on the unity forums others have had similiar issues with it.
]
I have some issues while a DoNetworkResponse. Sometimes it works, sometimes not ... Have you any idea why ?
Edit : found, just await a little bit longer before calling this function.
But it looks like some cards are "crash cards", once i try to attack with, game just crash (a murlock for example), strange...
Edit 2 : Found, its when a battlecry dont need any target (such as target ennemy hero), The crash occurs at next attack with this char.
Last edited by hankerspace; 01-25-2014 at 12:36 PM.
overture2112, I tried your app and it works great! However, how do I listen/monitor the log output statements you have?