Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
I was gonna make a custom human or orc race by building a custom haunted gold mine, but the problem is that the error says "Unable to use a Haunted Gold Mine" once my custom haunted gold mine is finally constructed. Is there any solutions to deal with this problem? Thank you.
I don't think this thread was posted in the appropriate forum, but... to answer your question, Haunted Gold Mine or its copies must have the Blighted Gold Mine ability or a copy of it, and the Worker must have the Harvest (Acolyte Gold) ability or a copy of it, with its race value set to Undead.
However, changing a Worker's race value to Undead means that its building construction ability will be changed to Summon automatically, because the construction method is hardcoded based on the worker's race value.
Additionally, special Gold Mine units and abilities have many hardcoded elements, so custom abilities copied from them tend to be problematic. This is especially true in cases where AI needs to handle them smoothly, such as in Co-op or Campaign modes—AI Players cannot properly utilize these modified Gold Mines.
This is also one of the main reasons why many custom races do not (or cannot) deviate from the traditional building and harvesting mechanics of Orcs and Humans.
This is totally spitballing an idea here that probably isn't what you want, but for what it's worth: in my project over the past few years to play Warcraft III on a separate game engine by rewriting all of the code, functions of the game such as Haunted Gold Mine that are built into the game and cannot be changed necessarily had to be reinvented in my "rewrite" because I did not have the code of the originals to copy from.
If you wanted to be fancy, you could try porting the code that I wrote back onto your Reforged map to essentially recreate the entire system of haunted gold mines, and then cause that system to work in the manner you prefer. However, this would obviously be time consuming because even with a code cookbook of how the system works, the APIs in my version are probably better and easier to use than the APIs on Warcraft III.
public int tryAddMiner(final CUnit acolyte, final CBehaviorAcolyteHarvest behaviorAcolyteHarvest) {
if (behaviorAcolyteHarvest == null) {
throw new NullPointerException();
}
int minerIndex = NO_MINER;
double minerDistSq = Float.MAX_VALUE;
for (int i = 0; i < this.activeMiners.length; i++) {
if (this.activeMiners[i] == null) {
final double thisMineDistSq = acolyte.distanceSquaredNoCollision(this.minerLocs[i].x,
this.minerLocs[i].y);
if (thisMineDistSq < minerDistSq) {
minerIndex = i;
minerDistSq = thisMineDistSq;
}
}
}
if (minerIndex != NO_MINER) {
this.activeMiners[minerIndex] = behaviorAcolyteHarvest;
this.currentActiveMinerCount++;
}
return minerIndex;
}
...wherein, as we can see, I check through all 5 (or however many specified in World Editor) of the mining slots are surrounding the building, and find the one whose distance-square to the unit is the smallest, and put him at that mining slot visually.
If we reconstruct it from its component parts like that, then we can construct new parts in our own way instead of being stuck with some code from 2001 that somebody wrote and never published.
As another similar example, I made something called "OverlayedMinableMine" which similar to Haunted Gold Mine is constructed as an overlay on top of an existing building, but after constructing it we mine using an ability that walks into and out of the building like Peons, if I recall:
An emulation engine to improve Warcraft III modding - Retera/WarsmashModEngine
github.com
But I don't know how to do that on Warcraft III and as I get older, I am not certain that I would want to. Basic functions like showing a yellow error message, such as "Must target a Gold Mine" are missing in the Warcraft III APIs. So if you were going to port my re-implementation of Warcraft III back into Warcraft III itself, how would you overcome that? There are script libraries available on Hive which would create a second text message on top of the original in-game one and try to switch between them, but that seems extremely contrived and painful versus just calling the error function to show an error. In my system I could go to that function I linked above, where it publishes "must target a gold mine," and change it to send the "Must target a Fel Mine of the Fel Orcs!" text error or something. Why not?
As a sidenote, I was informed a few years ago that my rewrite of Haunted Gold Mine is not correct. Apparently if we shift+click with an acolyte while he is mining on the ring, in Reforged he will travel to where we tell him about 1 second later, but on my code he thinks he has never finished mining and waits until the 12500 gold in the mine is all gone and it explodes before he goes to perform the shift+click action. These are problems you would have to heavily consider if you make your own code.
But if you want to see my rewrite of Haunted Gold Mine, there's an example here in the first few seconds of this video. You can see I had the acolytes hopping on and off of the gold mine, looking at whether that code I pasted above to scan for the nearest slot was actually working or not.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.