Re-grow Trees trigger help

Status
Not open for further replies.
Level 2
Joined
Jun 10, 2010
Messages
9
I have a question about a regrow tree trigger. I've been just starting out mapping and I wanted to make the ability for players to choose a base location at game start up, even if that base may be in a forrested region of the map. I was hoping that I could maybe salvage the Spell/Trigger combination from a tree tag game to have the beggining builder unit be able to destroy trees and then to create trees again if they wanted to seal off their base. To my dismay after opening the trigger editor to see if I could match the script the entire thing was in a written code and certainly nothing I understood. I'm not trying to make my own tree tag but the ability to regrow trees (ability) would be a great help. I'm sorry if there are a couple posts regarding this topic but I'm very new to written code and like I said, just starting mapping.

~RoY
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Well in tree-tag there is an "area of effect" ability that targets a designated circular area and it regrows any trees within that area. This can quite easily be done in GUI (the default action-script supplied by the World Editor) using various destructable actions.

This is a basic example, though you would need to customize it for your specific case. Currently the target of an "ability being cast" or an "ability being put into effect" will allow the actions to use the "Target point of ability being cast" event response. It sounds like you're not very familiar with things, so I won't even bother you about memory leaks for now.

  • Actions
    • Destructible - Pick every destructible within 200.00 of (Target point of ability being cast) and do (Actions)
      • Loop - Actions
        • Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Show birth animation
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
Well in tree-tag there is an "area of effect" ability that targets a designated circular area and it regrows any trees within that area. This can quite easily be done in GUI (the default action-script supplied by the World Editor) using various destructable actions.

This is a basic example, though you would need to customize it for your specific case. Currently the target of an "ability being cast" or an "ability being put into effect" will allow the actions to use the "Target point of ability being cast" event response. It sounds like you're not very familiar with things, so I won't even bother you about memory leaks for now.

  • Actions
    • Destructible - Pick every destructible within 200.00 of (Target point of ability being cast) and do (Actions)
      • Loop - Actions
        • Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Show birth animation

That doesn't filter other type of destructible.
 
Level 2
Joined
Jun 10, 2010
Messages
9
I realize the eat tree spell redneck I was hoping for re-grow which thankyou to Berb and Mortar.
 
Level 5
Joined
Nov 22, 2009
Messages
181
just add an if statement within the loop. if destructible type of (picked destructable) equal to summer tree wall then Revive picked destructible
else do nothing
 
Level 9
Joined
Oct 11, 2009
Messages
477
You can create a GUI MUI Tree Revival System like this and it only requires 2 triggers and one(1) Hashtable global:

  • Initialize Tree Revival Hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set TreeRevivalHashtable = (Last created hashtable)
      • Destructible - Pick every destructible in (Entire map) and do (Actions)
        • Loop - Actions
          • Hashtable - Save 0 as (Key tree counter) of (Key (Picked unit)) in TreeRevivalHashtable
  • Tree Revival
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • Set EntireMap = (Entire map)
      • Destructible - Pick every destructible in EntireMap and do (Actions)
        • Loop - Actions
          • Set TreeRevivalLocation = (Position of (Picked destructible))
          • Set TreeRevivalGroup = (Units within 300.00 of TreeRevivalLocation matching (((Matching unit) is alive) Equal to True))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in TreeRevivalGroup) Equal to 0
              • ((Picked destructible) is dead) Equal to True
            • Then - Actions
              • Custom script: call RemoveLocation(udg_TreeRevivalLocation)
              • Custom script: call DestroyGroup(udg_TreeRevivalGroup)
              • Hashtable - Save ((Load (Key tree counter) of (Key (Picked unit)) from TreeRevivalHashtable) + 3) as (Key tree counter) of (Key (Picked unit)) in TreeRevivalHashtable
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load (Key tree counter) of (Key (Picked unit)) from TreeRevivalHashtable) Greater than TIME INTERVAL OF TREE REVIVAL
                • Then - Actions
                  • Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Show birth animation
                  • Hashtable - Save 0 as (Key tree counter) of (Key (Picked unit)) in TreeRevivalHashtable
                • Else - Actions
            • Else - Actions
              • Custom script: call RemoveLocation(udg_TreeRevivalLocation)
              • Custom script: call DestroyGroup(udg_TreeRevivalGroup)
      • Custom script: call RemoveRect(udg_EntireMap)
 
Status
Not open for further replies.
Top