Buildings Creating doodads on creation

Holla.

New Member
Reaction score
14
Allright, blizzard has no forresters hut, no farmers house, (farm doesn't count)


Anyway, what i need help with is this:
When a farm gets built or starts building, i want either some crop terrain below it plus some doodads like carrots or pumpkins, and a fence. Rather than make the model i think its possible to spawn the doodads when the farm is built and destroy the doodads when the said farm is destroyed. It should look like this:

FARM.jpg


IS THIS POSSIBLE

I also want the same with trees, exept no fences. If not, this soesn't seem to hard to model soo, if someone can model here, and would like to help speak up!
 

Azlier

Old World Ghost
Reaction score
461
It's possible, with some dummies and some good mathing. Oh, and struct attachment. Or you can use a stack of arrays, which gives the same result only bulkier.
 

Holla.

New Member
Reaction score
14
Whats the easyest possible way to do it, without looking like a pieceofcrap
 

Azlier

Old World Ghost
Reaction score
461
How good are you with angling and how good is your spatial sense? Oh, and toss me that corn model. I'll see what I can throw together.
 

Holla.

New Member
Reaction score
14
its just the normal corn model from wc3, i can give you pumpkins or carrots if you'd like.
Spatial sense? Pretty much nothing, never tried anything like that before. sry.
 

Azlier

Old World Ghost
Reaction score
461
Oh. We have a corn model already. I always thought that was something of Morpheus'! Alright then. Lemme figger dis out... Ah hah! This works perfectly! It has exactly the effect you wanted! Two triggers...

Trigger:
  • Corn Farm
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to (==) Farm
    • Actions
      • -------- Four unit arrays needed. One for each fence, and one for the corn. --------
      • -------- You also need a dummy unit with the fence model, and one with the corn model. --------
      • -------- Each needs to be Invulnerable and have Locust --------
      • -------- You also need your standard tempPoint variable. --------
      • -------- And, your non-standard tempPoint2 variable. --------
      • -------- Yes, even an integer variable called Index. --------
      • Unit - Set the custom value of (Triggering unit) to Index
      • Set tempPoint = (Position of (Triggering unit))
      • Set tempPoint2 = (tempPoint offset by (-64.00, -128.00))
      • Unit - Create 1 Fence Dummy for (Owner of (Triggering unit)) at tempPoint2 facing 0.00 degrees
      • Set Fence1[Index] = (Last created unit)
      • Custom script: call RemoveLocation(udg_tempPoint2)
      • Set tempPoint2 = (tempPoint offset by (64.00, -128.00))
      • Unit - Create 1 Fence Dummy for (Owner of (Triggering unit)) at tempPoint2 facing 0.00 degrees
      • Set Fence2[Index] = (Last created unit)
      • Custom script: call RemoveLocation(udg_tempPoint2)
      • Set tempPoint2 = (tempPoint offset by (0.00, -192.00))
      • Unit - Create 1 Fence Dummy for (Owner of (Triggering unit)) at tempPoint2 facing 90.00 degrees
      • Set Fence3[Index] = (Last created unit)
      • Custom script: call RemoveLocation(udg_tempPoint2)
      • Set tempPoint2 = (tempPoint offset by (0.00, -128.00))
      • Unit - Create 1 Corn Dummy for (Owner of (Triggering unit)) at tempPoint2 facing 90.00 degrees
      • Set Corn[Index] = (Last created unit)
      • Custom script: call RemoveLocation(udg_tempPoint2)
      • Set Index = (Index + 1)
      • -------- Drawback: this will work for only 8191 units total. --------


Trigger:
  • Corn Farm Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to (==) Farm
    • Actions
      • Unit - Remove Corn[(Custom value of (Triggering unit))] from the game
      • Unit - Remove Fence1[(Custom value of (Triggering unit))] from the game
      • Unit - Remove Fence2[(Custom value of (Triggering unit))] from the game
      • Unit - Remove Fence3[(Custom value of (Triggering unit))] from the game


Let me tell you, as a JASSer, going through those GUI menus again was nightmarish. 15 clicks just to get the custom value of the triggering unit?! Jesus Christ!
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top