• 🏆 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!

Oil Patch

Status
Not open for further replies.
Level 2
Joined
Dec 7, 2013
Messages
8
Hello, I am trying to complete the oil resource system. I used someone else's pre-made triggers and the system only has 1 problem, how to ensure oil tankers build oil platforms on oil patches only.

I am currently using the haunt goldmine ability with a goldmine as the oil patch and haunted goldmine as the platform. There are 2 problems. When I build an oil platform it builds it instantly and has 10% hit points but will not finish construction.
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,378
If you know how to use variables, then you could place dummy unit in the center of each oil patch and save that dummy into "unit" variable (array).

Then you catch the build order (this may be tricky to do correctly and it's also hard to say how to order looks, since it changes per building - e.g. the order is "altarofkings" for altar of kings, or "humanbarracks" for barracks that humans build; so it depends on which building you based your oil platform).

Now when you catch the order, you save the point using a point variable
  • Set loc1 = (Target point of issued order)
where "loc1" is the point variable.

Then you will use a "For integer variable" loop and loop it from 1 to X (X being the number of Dummies you placed in game and which you saved in the unit array).
You save position of dummy in second point variable
  • Set loc2 = (Position of Your_Oil_Dummy[X])
and finally you check the distance between loc1 and loc2 using "Real Comparison - Math - Distance Between Points".
If the distance is greater than you would want, you stop the unit which was trying to build the platform.


(I may add a test map with this later during the day)
 
Level 2
Joined
Dec 7, 2013
Messages
8
I appreciate your help =). Sounds like you know what you are talking about, unfortunately I have no idea what that stuff meant.

I think my problem is that it classifies building the oil platform as summoning an undead structure because that is what I based it off. (Building is placed instantly with 10% hp and no build animation)

I would add a test map to show you but I have no idea how to add one. =\
 
Status
Not open for further replies.
Top