• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Random weather & grow trees & goldmine questions

Status
Not open for further replies.
i wanna make a map that generate random weather affects (wind, rain... uhm... wind) in random times so like [random weather for random secs - wait 4 random time then another random weather 4 random secs and so on]
also i want 2 grow trees
uhm... i want 2 make the trees my workers "chopped off" grow back after some random time
and gold mine regenerate gold. and it won't blow up when its gold reaches 0
so maybe +3gold per second (or something like that)

and this map i'm "planning" 2 make is designed 4 multiplayers
THX 4 ALL INFO/IDEAS

oh and i 4got 2 tell u that i really want the weather affect 2 appear at random part of teh map... if thats "imposible" then just the entire map
 
Last edited by a moderator:
Level 4
Joined
Oct 13, 2007
Messages
62
Tree Creation
Events
Zeit - Every (Random real number between 0.01 and 0.02) seconds of game time
Bedingungen
Actions
Destructible - Create a Ruinen at (Random point in (Playable map area)) facing (Random angle) with scale 1.00 and variation (Random integer number between 0 and 10)
Destructible - Create a Ruinen at (Random point in (Playable map area)) facing (Random angle) with scale 1.00 and variation (Random integer number between 0 and 10)

this is for tree creation

Tree Process
Events
Destructible - A destructible within (Playable map area) dies
Bedingungen
Aktionen
Wait 2.00 seconds
Destructible - Create a Ruinen at (Random point in (Playable map area)) facing (Random angle) with scale 1.00 and variation (Random integer number between 0 and 10)


and this for tree-regrowing

weather
Events
Map initialization
Bedingungen
Actions
Umgebung - Create at (Playable map area) the weather effect Ashenvale-Rain


this for the weather

for the gold mine u can also use the regrow-effect

Mine Process
Events
Unit - Goldmine 0001 <gen> dies
Bedingungen
Actions
Wait 2.00 seconds
Unit - Create 1 Goldmine for Neutral passive at (Center of (Playable map area)) facing (Position of (Triggering unit))

sry forgot the change of weather^^

its this one:

weather change
Events
Map initialization
Bedingungen
Actions
Umgebung - Create at (Playable map area) the weather effect Ashenvale-Rain
Wait 100.00 seconds
Umgebung - Remove (Last created weather effect)
Umgebung - Create at (Playable map area) the weather effect Northrend-Blizzard
 
Last edited by a moderator:
thx... lol just realized ur the only guy whos replyin
still thx
and i'm gonna ask more if it doesn't work out... =)

oh and uhm... if it says 2 seconds... how long exactly is that in real life?? (since its game sec) (if u r not sure then just make a guess since i have no clue XD)
 
Last edited by a moderator:
also uhm.. a few thing is confusing
like wats Bedingungen or Umgebung??? no clue wat ur talking about... and (i'm pretty new 2 wc3 triggers) if u played starcraft, there is a preserve trigger option.. do i need it since i want all the treegrowing and weather 2 keep repeating in the map?
and wats the different between condition and event!!??
and wats variable.. do i just type random ... words in it and it will understand me?
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
a trigger runs whenever an even "happens", for example "a unit dies" makes the trigger run whenever a unit dies.

If you add the condition "triggering unit type is a footman":
the trigger will "run" whenever a unit dies, but will ONLY proceed to the actions when the dying unit is a footman.

In the action part you define actions that happen, e.g. revive dying unit, which will ... revive the footman :)

There are global variables and local variables. locals are variables only used in 1 "function", and are cleaned up afterwards. globals can be accessed by any trigger. GUI only allows you to use globals (well, unless you start using scripts, but hey, big difference with jass). In order to create variables, press cntrl + B in the trigger editor or simply go to EDIT / Variables in the trigger editor. Here you have access to all global variables used in your map.
 
so ur saying that variables are just Addressing-names? (cuz if they are not, then that means i need 2 REMEMBER a huge list of CODE-names?)
like i name a variable 2 uhm... <hero dies> (assume this is global one)
so when the event HERO DIED the game "turn on" this variable
and in another different trigger's event HERO DIES (the variabled i named) is on some... werid action will apply?? or something like that?
also uh... i made this trigger 4 grow trees and stuff but when i play nothing happens...
so can some1 tell me how 2 paste my trigger from the editor on2 this page so u ppl can take a look at it and tell me wats run with it?
thx
 
Level 8
Joined
Feb 20, 2007
Messages
338
Tree regrowth:

You can only select the first 64 destructible (read the editor gray letter guide to destructible in region dies) when using the event of:

Destructible - A destructible within (Playable map area) dies


So you need to triggers here, a set up which will pick all the destructibles and one that will cause the regrowth:

If you have gates and barrels and other destructible types on your map you need to set the Picker part of the two set triggers to pick only those you want to grow back:

  • Tree Picker
    • Events
      • Time - Elapsed game time is (0.01 + 1.00) seconds
    • Conditions
    • Actions
      • 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
              • (Destructible-type of (Picked destructible)) Equal to Ashenvale Tree Wall
            • Then - Actions
              • Trigger - Add to Tree Regrowth <gen> the event (Destructible - (Picked destructible) dies)
            • Else - Actions
              • Do nothing
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Ashenvale Canopy Tree
            • Then - Actions
              • Trigger - Add to Tree Regrowth <gen> the event (Destructible - (Picked destructible) dies)
            • Else - Actions
              • Do nothing
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Dark Forest Giant Tree wall
            • Then - Actions
              • Trigger - Add to Tree Regrowth <gen> the event (Destructible - (Picked destructible) dies)
            • Else - Actions
              • Do nothing
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Dark Forest Giant Tree
            • Then - Actions
              • Trigger - Add to Tree Regrowth <gen> the event (Destructible - (Picked destructible) dies)
            • Else - Actions
              • Do nothing
Tree regrowth is the trigger that the picker directs the computer too:

  • Tree Regrowth
    • Events
    • Conditions
    • Actions
      • Wait 65.00 seconds
      • Destructible - Resurrect (Dying destructible) with (Max life of (Picked destructible)) life and Show birth animation
It has no event because another trigger triggers it.


* - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * -

Gold Mine:
  • Gold mines
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Gold Mine) and do (Actions)
        • Loop - Actions
          • Neutral Building - Add 1 gold to (Picked unit)
In this instance I set it to add 1 gold every 2 seconds - most likely the gold mine would become worth more and more as time goes on. You would have to test it and figure out how much gold to add every so often to keep pace with harvesting.

Down side is that gold mines that are not being used will also be added to with this as it is.

An alternative is to wait until the unit dies, then replace it with a "new" gold mine:
  • Gold mines Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Gold Mine
    • Actions
      • Wait 2.00 seconds
      • Unit - Replace (Dying unit) with a Gold Mine using The new unit's max life and mana
      • Neutral Building - Add 10000 gold to (Last replaced unit)
However that leads to your gold mind moving and all of the units harvesting it stop and await orders.

Your best bet is most likely to add gold every so often.

* - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * -

Weather:
There are several ways one can do this. I'll give you one that has a random time between a series of weather events. The weather itself does not come up randomly just the time between weather fronts.



In one trigger there is:

  • Weather
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait (Random real number between 180.00 and 600.00) seconds
      • Game - Display to (All players) the text: Looks like rain
      • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Light)
      • Wait 0.50 seconds
      • Environment - Turn (Last created weather effect) On
      • Wait (Random real number between 180.00 and 600.00) seconds
      • Environment - Turn (Last created weather effect) Off
      • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
      • Wait 0.50 seconds
      • Environment - Turn (Last created weather effect) On
      • Wait (Random real number between 180.00 and 600.00) seconds
      • Environment - Turn (Last created weather effect) Off
      • Game - Display to (All players) the text: How about some fair...
      • Wait (Random real number between 180.00 and 600.00) seconds
      • Environment - Turn (Last created weather effect) Off
      • Environment - Create at (Playable map area) the weather effect Outland Wind (Light)
      • Wait 0.50 seconds
      • Game - Display to (All players) the text: Brr, that wind is c...
      • Environment - Turn (Last created weather effect) On
      • Wait (Random real number between 180.00 and 600.00) seconds
      • Environment - Turn (Last created weather effect) Off
      • Game - Display to (All players) the text: Fair weather ahead
      • Trigger - Run (This trigger) (ignoring conditions)

Cycles through the game over a couple of hours.

Randomized time between weather events, you can adjust the random wait to a hard number, and you can use what weather effects you want.

I am using 180 (3 minutes) and 600 (10 minutes) you can elect any variation on that you desire. I desired a series of weather events with random cycled durations.

Works nice for all outdoor maps. if you have interior areas you will need to turn off this trigger and turn off last created weather effect in a trigger that defines when your unit goes inside.

You may remove Game message if you want to.

There is another way to do this WITH randomized weather, but it means setting up variables and setting up a random trigger to pick at random a weather event.

since you were confused by the variables used, I have tried to keep from using variables in these triggers.

I also warn you need to consider Things that Leak: http://www.hiveworkshop.com/forums/showthread.php?t=35124 when consulting my triggers here.

I quickly made them without adjusting for leaky points.

Also I have seen Jass versions of tree regrowth and random weather effects on either this site or http://www.wc3campaigns.net/ in the maps sections where authors have made a map with the triggers involved.

Sorry I'm just a little lazy today to hunt up those maps for ya :wink:
 
Level 4
Joined
Oct 13, 2007
Messages
62
kk sry I'm just new in a forum ;)

if the umgebung or these things were confusing so sry cause the editor i use is in german language and changed all the names there for example the area icecrown has the editor-name eiskrone...

couldnt translate it cause i didnt have the original names:ugly:
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
First things first: in order to paste a trigger on this forum, go to the trigger editor and right click the name of the trigger NAME in the right bottom part of the trigger editor.
Then add a reply and put the text in
  • [./trigger] tags.
  • In my experience, triggering in WE has MANY more possibilities than triggering in SC. That's why I advice you to read some tutorials first.
  • [url=http://www.hiveworkshop.com/forums/showthread.php?t=5885]This one[/url] might be a good start; alternativelly you can read [url=http://www.hiveworkshop.com/forums/showthread.php?t=32113]this one[/url].
  • When you have read these, you can proceed to more specific tutorials on triggering (such as creating leader boards, dialogs, etc.) on [url=http://www.hiveworkshop.com/forums/forumdisplay.php?f=279]this[/url] forum.
  • When you feel that you're starting to understand how it all works, do not forget to read [url=http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27242]This[/url] tutorial that covers the subject of Leaks. While it's important to understand the basics of triggering first, removing leaks is very important when you're creating triggers in GUI. But for now, it's not important yet.
  • Gold mines don't need to regenerate gold. In order to avoid it being destroyed, simply set its gold amount to 1 000 000 (double click a gold mine). Assuming a peasant can gather gold at 10 per second (more than he actually can) it would still take 100 000 seconds, which is about 27 hours. For the sake of the warcraft 3 players, I hope your map will NOT last 27 hours.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
A leak is when a object is created (does not have to be a visable object like a location or local) and all references to it are lost, so it can no longer be removed from memory but still takes up memory.

Although thanks to H2I and I2H systems you can techinacly remove all leaks but that could accdently remove non leaked data that is in use ruining your map. So it is recomended to learn JASS (the wc3 trigger script language) since then leaks are easier to avoid.

GUI stands for Graphical User Interface, which in WE basicly means the building block trigger system that is easy to use but lesspowerfull than JASS which is the scripting language WC3 uses for triggers. No matter what you do, GUI triggers will always be converted into JASS appon saving inorder to opperate but they are often VERY unefficent conpaired to the same thing done directly in JASS.
 
Status
Not open for further replies.
Top