Reproducing tree's

WackO_WilL

New Member
Reaction score
4
I am Making a viking map where tree's Will be used Through out the entire game, Youll never Get enough tree's. So i need some way. To make tree's appear, In a random direction, Around a random tree, Of the same typ, (Using 3 different trees) to appear.

This is what i have sofar.
Events
Time - Every 3.00 seconds of game time
Actions
Destructible - Create a Winter Tree Wall at ((Position of (Random destructible in (Entire map) matching ((Destructible-type of (Random destructible in (Entire map))) Equal to Winter Tree Wall))) offset by (3.00, 3.00)) facing (Random angle) with scale 1.00 and variation 0

That one really hurt my mind, Its super long. ANyways. It doesn't Work at all. But i know that you can some how do this, What i need is something like

Actions-
Every 3 seconds.
Results-
Select a random tree equal to Winter Tree wall
Create a Winter tree wall (Random variation) In a random spot Around the selected destructible, between 3 to 6 Feet.

I don't know howlarge a Warcraft III UNit is, If you answear this, Can you tell me a nice intinger for a tree that is 1.80-2.20 Scale? Thank you in advanced.
 

Nigerianrulz

suga suga how'd you get so fly?
Reaction score
198
a little note: Next time when you post your trigger post them with the # CODE so it would be more easier to read:)

Code:
Events
Time - Every 3.00 seconds of game time
Conditions - 
Actions - Destructible - Create a Winter Tree Wall at ((Position of (Random destructible in (Entire map) offset by (3.00, 3.00)) facing (Random angle) with scale 1.00 and variation 0

i dont think WE can create a tree next to the same type to be exact (Thats beocz i dont WE) but you can make a region where a type of trees will be there and create trees there, or make smaller ones everywhere buts thats my opion its your choice
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Code:
Grow Trees
    Events
        Time - Every 3.00 seconds of game time
    Conditions
    Actions
        Set MaxNewTrees = 3
        Destructible - Pick every destructible in (Playable map area) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        MaxNewTrees Greater than 0
                        (Destructible-type of (Picked destructible)) Equal to Snowy Tree Wall
                    Then - Actions
                        Set MaxNewTrees = (MaxNewTrees - 1)
                        Set Point1 = (Position of (Picked destructible))
                        Set Point2 = (Point1 offset by (Random real number between 150.00 and 300.00) towards (Random angle) degrees)
                        Destructible - Create a Snowy Tree Wall at Point2 facing (Random angle) with scale (Random real number between 0.80 and 1.50) and variation (Random integer number between 0 and 9)
                        Animation - Play (Last created destructible)'s birth animation
                        Custom script:   call RemoveLocation( udg_Point1 )
                        Custom script:   call RemoveLocation( udg_Point2 )
                    Else - Actions

Though this has the potential to grow a lot of trees... up to filling the entire map actually.
 

WackO_WilL

New Member
Reaction score
4
Thank you somuch :D This is the best website <3
Also The tree's are actually very few, And the map size is the largest, SO you have to situate your town, Just right, Production of things made from wood, Increase toomuch = Deforresting. I needed growing tree's to keep the game going.

I have a problem, I cant seem to find SET, Under the WE Commands. I searched for Set Point, and Set, But didn't find it.

Oooh, I see. This has to do with Variables... I never learned how to use Variables. I am so lost right now D:
Code:
Events
    Time - Every 3.00 seconds of game time
Actions
    Set MaxNewTrees = 3
    Destructible - Pick every destructible in (Playable map area) and do (Actions)
        Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    MaxNewTrees Greater than 0
                    (Destructible-type of (Last created destructible)) Equal to Winter Tree Wall
                Then - Actions
                    Set Point1 = (Position of (Last created destructible))
                    Set Point2 = ((Point1 offset by ((Random real number between 150.00 and 300.00), 0.00)) offset by ((Random angle), 0.00))
                    Destructible - Create a Winter Tree Wall at (Point2 offset by (0.00, 0.00)) facing (Random angle) with scale (Random real number between 1.80 and 2.20) and variation (Random integer number between 0 and 9)
                    Animation - Play (Last created destructible)'s Birth animation
                    Custom script:   Call RemoveLocation (udg_point1)
                    Custom script:   Call RemoveLocation (udg_point2)
                Else - Actions
This is as close as i could get, But Call Removelocation causes an Error. What do i fix about it?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
JASS is case sensitive.
If your variable is called "Point1", you must use "udg_Point1" in the custom script line. "udg_point1" doesn't work...

"Call" should be "call" btw.
 

WackO_WilL

New Member
Reaction score
4
Thank you somuch, I didn't realise it was, And to tell you the truth, first time withing with variables, And a Trigger that branches like this, And first time using Custom script, But i learned somuch from you, Thank you somuch

Now, I seem to have a problem, IN game. It does nothing. I have 1 tree on the feild for testing. But it sits there. Nothing happens, Why?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Set Point2 = (Point1 offset by (Random real number between 150.00 and 300.00) towards (Random angle) degrees)

Set variable,
point with polar offset.

> Destructible - Create a Snowy Tree Wall at Point2 facing (Random angle) with scale (Random real number between 0.80 and 1.50) and variation (Random integer number between 0 and 9)

This uses "point", not point with any kind of offset.
 

WackO_WilL

New Member
Reaction score
4
Hmmm. I have everything set right? I check it in game, And nothing happens. The shadow doesn't even darken.

Code:
Events
    Time - Every 3.00 seconds of game time
Actions
    Set MaxNewTrees = 3
    Destructible - Pick every destructible in (Playable map area) and do (Actions)
        Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    MaxNewTrees Greater than 0
                    (Destructible-type of (Last created destructible)) Equal to Winter Tree Wall
                Then - Actions
                    Set Point1 = (Position of (Last created destructible))
                    Set Point2 = (Point1 offset by (Random real number between 150.00 and 300.00) towards (Random angle) degrees)
                    Destructible - Create a Winter Tree Wall at Point2 facing (Random angle) with scale (Random real number between 1.80 and 2.20) and variation (Random integer number between 0 and 9)
                    Animation - Play (Last created destructible)'s Birth animation
                    Custom script:   call RemoveLocation( udg_Point1 )
                    Custom script:   call RemoveLocation( udg_Point2 )
                Else - Actions

The Variables are, Point 1 and 2 = Points and MaxNewtree = INtiger right?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> (Destructible-type of (Last created destructible)) Equal to Winter Tree Wall

This should use "picked destructible", not "last created".

> Set Point1 = (Position of (Last created destructible))

This too.


> with scale (Random real number between 1.80 and 2.20)

That's very big, try with less, like 0.8 - 1.2.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
890
You could create a new doodad based off of a tree and just increase its scaling value under Art - Scaling Value, then put that new doodad in your trigger.
 

WackO_WilL

New Member
Reaction score
4
Its cool, I just increased the Destructible Scale size, 1 Whole up. Also i just Redon my trigger, but it still doesn't work. Ill check it out in the morning, I Tired!
 
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