Mining

Solidjackal

New Member
Reaction score
0
I was wondering if it is possible to have the trees in the game to "drop" more than one item, I want it to drop wood and maybe a custom item I will make.
Also what triggers will I need to make in order to get the worker unit mine trees automatically. I searched google but I cannot seem to find an answer to this question, is there a similar item to the mining crystals in SC that I can find here?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
By drop do you mean when peasants gather from the tree, or when the tree dies and an item appears in its position? The former isn't possible, but the latter certainly is.
 

OMGOMGOMG

UMBWGMG (Unidentified Human Being.)
Reaction score
28
Heh make a trigger like this
Trigger:
  • PickAllDestructiblesForEvents
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Create Lumber from Trees <gen> the event (Destructible - (Picked destructible) dies)
          • Trigger - Add to Create Stone from Rock <gen> the event (Destructible - (Picked destructible) dies)
          • Trigger - Add to Create Special Lumber From Special Trees <gen> the event (Destructible - (Picked destructible) dies)

Trigger:
  • Create Lumber from Trees
    • Events
    • Conditions
      • (Destructible-type of (Dying destructible)) Equal to Summer Tree Wall
    • Actions
      • Set TreePoint = (Position of (Dying destructible))
      • Item - Create Bundle of Lumber at TreePoint
      • Item - Create Bundle of Lumber at TreePoint
      • Custom script: call RemoveLocation(udg_TreePoint)

TreePoint is a point variable

EDIT EDIT EDIT EDIT EDIT EDIT EDIT EDIT
Didn't know what you meant, if you want that, i'll keep it up. (it should be self explanatory) the first trigger adds the event
The second trigger gets the event and it checks the conditions if a dying destructible is a summer tree wall then it creates 2 items. Although, keep in mind, I didn't know what you mean.
 

Solidjackal

New Member
Reaction score
0
That is just what I need, thank you so much. Also I am guessing there is no mining crystals from SC in the editor is there?
 

RedOrb

You can change this now in User CP.
Reaction score
14
Hi Jackal,

While Kaerf is correct, there are some things you can do to at least give the illusion of gathering wood, and get the effect you want.

Try this:
Code:
Untitled Trigger 001
    Events
        Unit - A unit Is issued an order targeting an object
    Conditions
        (Destructible-type of (Target destructible of issued order)) Equal to Summer Tree Wall
        (Unit-type of (Ordered unit)) Equal to Peasant
    Actions
        Set harvestedtree[(Custom value of (Ordered unit))] = (Target destructible of issued order)
        Wait (Random real number between 2.00 and 4.00) seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Current order of (Ordered unit)) Equal to (Order(harvest))
                        (Current order of (Ordered unit)) Equal to (Order(smart))
            Then - Actions
                Item - Create Tome of Experience at (Position of harvestedtree[(Custom value of (Ordered unit))])
                Game - Display to (All players) the text: Someone's being a l...
            Else - Actions

This will, at the very least, fire the trigger when you order the peasants to harvest lumber, and after a short random wait, the trigger checks to see if the current order of the peasant is STILL harvest. If so, it'll create an item at the position of the destructible. I used the custom value which means you will have to SET this custom value at some point. Assuming you are building your peasants from a town hall or something you can use a trigger that works like this:

Code:
Untitled Trigger 003
    Events
        Unit - A unit Finishes training a unit
    Conditions
        (Unit-type of (Trained unit)) Equal to Peasant
    Actions
        Set peasantcustoms = (peasantcustoms + 1)
        Unit - Set the custom value of (Trained unit) to peasantcustoms

This will give each peasant a unique ID, and thus each destructible a unique slot in the destructible array (you'd probably have to make the array bigger..).

Finally, to get peasants to harvest lumber automatically, you can go with a simple order:

Code:
Untitled Trigger 002
    Events
        Map initialization
    Conditions
    Actions
        Unit - Order Peasant 0012 <gen> to Harvest Summer Tree Wall 0009 <gen>
        Unit - Order Peasant 0013 <gen> to Harvest Summer Tree Wall 0008 <gen>

Switch the event to whatever you like, and make sure to use unit groups to select all your peasants if you wanted that.
 

Solidjackal

New Member
Reaction score
0
how do I get the if statements? and I do not understand how to add "Set harvestedtree[(Custom value of (Ordered unit))] = (Target destructible of issued order)" is it a custom script?
 

jnZ

I
Reaction score
64
what do you mean "how do i get the if statement"? how to implement conditions?
and the "Set harvestedtree[(Custom value of (Ordered unit))] = (Target destructible of issued order)" ist just a variable being set.
its an destructible array by the name of harvestedtree
 

jnZ

I
Reaction score
64
in the contextmenu for adding actions there should be something like "If / Then / Else / Multiple Actions"
you should find it without problems
 

Solidjackal

New Member
Reaction score
0
thank you for that
What does this line of code mean?
" (Current order of (Ordered unit)) Equal to (Order(harvest))
(Current order of (Ordered unit)) Equal to (Order(smart))"

it is the same as (Order((Unit-type of (Ordered unit))) Equal to (Order(harvest))?
what does smart do and mean?
 

jnZ

I
Reaction score
64
well in redorbs trigger are
Set harvestedtree[(Custom value of (Ordered unit))] = (Target destructible of issued order)
and
Item - Create Tome of Experience at (Position of harvestedtree[(Custom value of (Ordered unit))])

first you create the variable of type destructible and check array.

the first action should be "Set Variable" in the actions context menu. Select harvestedtree as the variable. Click inside the [] and select Custom Value of Unit and select Ordered unit.
as a value for the variable select Target destructible of issued order

the second action should be "Create Item" in the actions context menu. Select your item and as location select destructible position. as the destructible select the variable harvestedtree , click in the [] and select Custom Value of Unit and select Ordered unit.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top