HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Custom wisp won't mine gold

07-10-2002, 06:45 AM#1
Guest
I cant figure this out. Unless its just something that can't be changed. I was trying to make a custom wisp. It'll hop on trees no problem, build units and whatever else. But for some reason it wont mine gold. Its like the mine doesn't recognize it. I even went back and just made a custom unit. No changes whatsoever. and the same thing. It sucks because this is actually a very big problem for what i was trying to do.
07-10-2002, 08:01 PM#2
Guest
Heh, the mine is entangled by a tree of life that belongs to the player owing the Wisp, right?
07-11-2002, 03:48 AM#3
Guest
it has something to do with the entangled mines (ne) and houanted mines (undead) require certain models around them for mining. So blizz stuck in something so it would recognize custom units. the work around for both of these is to make your town all (in unit properties) just a town hall.. i think the tree of life is considered a town hall/ancient.

then you can take away entangle gold mine ability. and add return ( gold and lumber ) . they get resources like humans. but thats my only work around so far.
07-11-2002, 05:24 AM#4
DryMaltExtract
I tried making a custom unit and even when I used 'Gather(Wisp gold and lumber) it would not gather the gold from the mine. The only way around this seems to be to take the wisp and edit it to be the same way your custom unit was. This will allow the customized wisps to use the gold mines properly, I have tested it.
07-11-2002, 11:08 AM#5
OrcishSpacesuit
I have 2 methods: First might work, and would be the best, the second will work, but is more messy.

First Method:
Try using triggers to detect when the custom wisp should enter the mine, and then order the gold mine to load the custom wisp. Try
Events
-A unit owned by Player 1 is issued an order
-A unit owned by Player 2 is issued an order
-.... for each player that might have this unit
Conditions
-(Unit type of (Target unit of issued order)) Equal to Entangled Gold Mine
-(Unit type of (Ordered unit)) Equal to Custom Wisp
-(Issued order) Equal to Order smart
-(Owner of (Orderd unit) Equal to (Owner of (Target unit of issued order))
Actions
-Unit - Order (Target of issued order) to load (Ordered unit)

[I don't know if that would work, as I haven't tested it, but it the second method should do it if that doesn't.

Second Method:
Make a custom Entangled Gold Mine (I'm assuming you can't use the original) (you may need a customized .slk - if you do, make sure it enables the entangled gold mine - can't remember is you do need a custom one). Then give it the abilities Load (Goblin Zepplin) and Cargo Hold (Goblin Zepplin), and maybe cargo hold deaht (Neutral Hostile). Take away abilities that conflict, most likely Load and Load Wisp (Entangled Gold Mine, maybe switching out the Unload ability for the Zepplin version too. Then use triggers to detect whenever a player gets an entangled gold mine, and replace it with your custom one (be sure to transfer gold) Then use triggers to

A: every few seconds or whatever, detect how many wisps are in each custom Gold Mine, and add to the player's gold and subtract the mine's gold. To detect the amount, put all custom wisps in a group, use a for loop to go through each one, and determine whether each is in a Custom Entangled Gold Mine (using the boolean expression unit is in in transport), adding to a variable for each one that is, and adding gold based on that amount.
-OR-
B: every time a unit is loaded into the mine, add to a counter variable, and subtract when a unit exits (be sure to account for if the mine is destroyed), then every few seconds add gold based on the variable.
-OR-
C: every time a unit enters a custom gold mine, replace it with a second custom wisp, and have a trigger that every few seconds adds gold based on the total number of those second wisps the player owns. Be sure to also have a trigger that turns them back when they exit (every few seconds pick all units of type 2nd custom wisp matching condition (boolean matching unit is not being transported)).

Finally, if you really want to make it look good, try to figure out how to play special effects or something so that the little +10 (or other number?) is played above the mines. Note that you can easily adjust the mining rate here by adjusting how often the trigger fires and the gold per wisp that the player gets.

----------------------------

I didn't go into all the details on the second method, as it would be real long, and I hope nobody has to actually do it that way. But if my first method does not work, and people need help, I will go into more detail or even write the triggers myself, export them from the map, and post them here. Be sure to post the results of your testing here.
07-13-2002, 05:25 AM#6
OrcishSpacesuit
New method, but requires .slk editing (and users to download .slk):

Go into AbiltyData.slk, find the row Load (Entangled Gold Mine), and copy everything except the alias line into another ability's line that you don't use, such as a chaos ability. Make sure that you replace a unit ability, not item or hero, as that may cause problems.

Then change the column Data11 to the code of your custom unit. Don't know the code? Open the World Editor, and insert the code
Events
  • A unit owned by Player 1 is issued an order targeting a point
  • <you can add other targets too>
[b]Actions[b]
  • Display text message to all players displaying text: (Convert unit type to string(event response-ordered unit)
or somethting like that. Then, get a custom wisp and order it to move somewhere on the ground, and it should display the name of the unit as a 4-letter code. I do not know if capitalization matters.

Now you just give your new gold mine this new ability instead of the old Entangled Gold Mine ability. The ability should have the name of the one you replaced.

Of course, only go with this method if you are using custom files already; otherwise, go with my earlier post.