• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Instant "Entangle Goldmine" on start

Status
Not open for further replies.
Level 1
Joined
Feb 27, 2012
Messages
7
Hi guys,

although this is my first post as a user, I visit the workshop from time to time (especially the tutorials...). At the moment I am working on a map, where the player starts out with the Corrupted Night Elves if he chooses "Night Elf" as a race. I have completed all buildings and all units.

At first, I had a problem with the Entangled Goldmine being unable to work with my Corrupted Wisps, but I fixed the problem by creating a custom Entangled Goldmine and custom abilities. Now my custom wisps are able to work in the custom mines without problems. Using the tutorial on new races (which will NOT work properly if used with Night Elves, since it turns your Entangled Goldmine into a new worker...), I was able to replace the starting Tree of Life with my Corrupted Tree of Life, the same goes for the wisps. Now to the problem:

I start in range of a Goldmine, with my Corrupted Tree of Life and 5 wisps, but the Goldmine isn't entangled at start. It works fine for the CPU Night Elves, but they don't get Corrupted starting units anyways. I do not start with the original Entangled Goldmine either, I just have the plain old Goldmine (to be more precise, I DO start with it, but it gets destroyed instantly). The cause is clear: My Trees only support Corrupted Entangled Goldmines, I need to alter the starting conditions for the human player. To the main question:

How to let the Corrupted Elves player start with my custom Entangled Goldmine?

I hope someone could help me with that. Sorry for any grammatical and syntactical errors, I am no native English speaker so please be lenient with me


EDIT:
While testing, a new problem popped up. Every time I evolve my Corrupted Tree of Life to the next level, the Entangled Goldmine reverts to a standart Goldmine and the 5 wisps pop out and stop working. I don't know what to read out of this... I used the "Corrupted Tree of Life" and its other forms from the campaign section and moved them to melee. After that, I did some adjustments to it in order to function properly as a main hall. Should I redo the Tree of Life with the Night Elves version as a basis?

EDIT of EDIT:
Solved my second problem. I was negligent when fixing my first gold mine issues and forgot to add my Corrupted Entangling ability to the second and third tier, rendering them unable to keep up my Corrupted mine.

EDIT(Nr.99):
I guess I should say so before anyone tries out the same:
Adding a If/Then/Else conidition, which replaces the original Entangled Goldmine instantly with custom Entangled Goldmine does not work for me. The original Entangled Goldmine devolves instantly (because my Corrupted Tree of Life doesn't support it), therefore there is no Entangled Goldmine to replace anymore. If I change the order from (first Tree, second Goldmine, third workers) to (first Goldmine, second Tree, third workers), the original Goldmine dies.... maybe I should add the custom Goldmine ability to the original Tree of Life? The original would have 2 goldmine abilites, but I do not care since the player does not get to see the original Tree anyways. I'll try that out

Result: Does not work how I want it to work. Rather than changing the Goldmine on the spot, it generates a second custom Entangled Goldmine on a random location near my tree.
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
You could try this:
  • Untitled Trigger 056
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to YourTree)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) controller) Equal to User
              • ((Owner of (Picked unit)) slot status) Equal to Is playing
            • Then - Actions
              • Set u = (Picked unit)
              • Set point = (Position of u)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within 1000.00 of point matching ((Unit-type of (Matching unit)) Equal to Gold Mine)) and do (Actions)
                • Loop - Actions
                  • Custom script: call IssueTargetOrderById(udg_u, 0000000, GetEnumUnit())
              • Custom script: call RemoveLocation(udg_point)
            • Else - Actions
It picks all trees owned by human players and finds a gold mine nearby, and gives the entangle order. You need to replace the 0000000 with the correct order id.

You can check order ids with this trigger:
  • OrderID
    • Events
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
    • Actions
      • Custom script: call BJDebugMsg(OrderId2String(GetIssuedOrderId()) + " ---- " + I2S(GetIssuedOrderId()))
You can also see if the order is given at all or if the entangle is overridden with a stop order.

Also try elapsed game time = 0 event.
 
Last edited:
Level 1
Joined
Feb 27, 2012
Messages
7
Thanks for your reply.
Got some sweat on my hands when typing in all that custom scripts, since it is very unfamiliar to me, so I don't know the correct syntax. I typed in the custom scripts exactly as you wrote above, but received multiple errors.

call IssueTargetOrderById(udg_u), 000000, getEnumUnit())
It says "expects end of the line" (crude translation, I use the German version). I simply removed the line for now, since I don't need it as I don't know the order ID yet. Isn't it just a bracket too much at the end? No wait. You wrote something different above, I guess I mistyped

set bj_want DestroyGroup = true
It says "expects name of a variable". Can I fix this by removing the spaces around the "=" ?

set udg_i = GetIssuedOrderId()
Same as above

call BJDebugMsg(OrderId2String(udg_i) + "----" + I2S(udg_i))
It says "expects name".

call BJDebugMsg(I2S(GetHandleId(GetTriggerEventId()))
Shows an error, but does not adress it.

Hope you can help me with that, I atleast understand what you want to achieve with these triggers. Although I am more or less experienced with several editors (TES Construction Kits), scripting is something I have rarely ever done before. Please have patience with me, even though my questions might be rather trivial.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
call IssueTargetOrderById(udg_u), 000000, getEnumUnit())
->
call IssueTargetOrderById(udg_u, 000000, GetEnumUnit())

set bj_want DestroyGroup = true
->
set bj_wantDestroyGroup = true

I edited the second trigger, removed all the unneeded things. You can copy and paste the text instead of typing it.
 
Level 1
Joined
Feb 27, 2012
Messages
7
Thanks!
Changed these, and they work properly and get accepted. What still does not work is:

EDIT: Didn't see the change above. I'll try it out

The script works fine. But it still does not work right.
Now I start with a custom Entangled Goldmine, which is really a great progress. But instead of using the Goldmine which is near my starting zone, it simply spawns an Entangled Goldmine (while keeping the old GM), looking quite random.

entangle.jpg


I propably wouldn't mind just removing the starting GM, but I really want to place the mine at a specific place. At the moment, it looks like it could also spawn over Doodads and the like, which would be a bit too messy. Also: If I unroot my Tree, the custom Entangled Goldmine stays as it is, meaning I could just move the Tree elsewhere and set up a second GM at start, which would be quite broken.
 
Last edited:
Level 9
Joined
Nov 19, 2011
Messages
516
Maby your problem at start was not replaceing goldmines, but that you tried to do it with initialization event. Try this:

  • check
  • Events
    • Time - 0.01 sec passed
  • Conditions
    • none
  • Actions
    • Unit Group - pick evry unit of type (your_goldmine) and do (multiple actions)
      • Actions
        • Set x picked unit
        • Pick evry unit in range of 500 and do (...)
          • Actions
            • Set y picked unit
            • If unit type of (y) equals goldmine then remove y from game
 
Level 1
Joined
Feb 27, 2012
Messages
7
@ MajorKaza

Thank you for your suggestion. I think I will try that out later, it always takes me a long while to work on triggers so I'll take my time

@ Maker

I'll upload it then.

The map has not been designed by me.
I don't know why I started working on this map, but I wanted a 12 player-map to battle the computer and used a custom one, since the original 10-12p maps of RoC and TFT did not appeal to me. The map has been made by a user named "NohmaeV" and is called Pool of Sorrow (as you'll propably see in the editor). I assure you that it will be (aside from a game with some friends maybe) for my personal enjoyment and I do not intend to take any form of authorship on it. I'll make my own proper map for the race in the future though (the setting does not really fit), as this is more or less a temporary solution. The map description is still English while all the units, technologies and abilites I worked on are German



EDIT:

Thank you MajorKaza, your suggestion is working fine. The Entangled Goldmine is still somewhat off it's original place, but it is just a few points so I can live with that and everything else would be just cosmetics.

EDIT2:

Just when I thought that every problem has been solved and I could work on the balancing, abilities and models, the map got corrupted as a whole :/ Now you are able to build and move on Doodads :/ Anyone knows how this could have happebed? The list of Doodads in the Editor is messed up too...
 

Attachments

  • (12)PoolofSorrowCorruptedElves 0.1b.w3x
    381.4 KB · Views: 116
Last edited:
Level 1
Joined
Feb 27, 2012
Messages
7
I tried, but it didn't really help. Well, since I'm fed up with the Entangled Goldmine I changed my workers to small Satyr-Worker units who will harvest gold and wood like the Human workers do. The Entangled Goldmine brought nothing but trouble and is not really vital for my race. Thank you for all your help
 
Status
Not open for further replies.
Top