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?
 
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.
 
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.
 
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?
 
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.
 
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?
 
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
 
in the contextmenu for adding actions there should be something like "If / Then / Else / Multiple Actions"
you should find it without problems
 
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?
 
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 The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      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