Terraforming Add-on 1.6

This bundle is marked as awaiting update. A staff member has requested changes to it before it can be approved.
Terraforming Add-on is a simple standalone system meant to be used alongside larger systems that have an effect on the terrain. The system is fairly easy to understand and use - all one needs is to follow the instructions left inside.

It is well known that terrainers separate the use of doodads and destructibles. Doodads the goal of looks, and destructibles to serve as the pathing blocker underneath the doodad. You may ask why that is relevant, and the answer is - this system takes advantage of that,

Here's how...

In the configuration section - you are able to set up which ability/abilities will cause the trigger to take effect. Not only that, but you are also able to configure which destructibles will not be affected by the spell and which doodad types will be affected.

You may also ask yourself "What is the use of this?"

Here Are some examples of it's use:

- Say you are in a game with a farming system, where you plow the land and change the terrain. Then suddenly - you notice there's tall grass everywhere. Map maker never made the system for the weeds to be removed, so you are forced to watch weeds in the crop field. This system would hide those weeds.

- You are in a city creation map, and you are making a city. Yet suddenly you realize - in order to make a really nice looking city, you have to remove some rocks. Normally you would be frustrated with that rock there ruining it all, and you would not be able to do anything about it. But with this system - the rock would be removed - both it's pathing, and it's general appearance (As long as the map maker didn't make the rock a doodad with it's own pathing rather than using destructibles underneath...)

- Say you are casting some really strong spell in any map. The spell is supposed to destroy the terrain from it's strength, reshape it, change the tileset in that area.... But as soon as that is done - you realize the only thing it didn't do is.... you get the picture.

In any case - the uses for this short little system, no matter how simple, are very vast.


Changelog 1.1
-Changed "start casting ability" to "Begins effect of".
-Combined the triggers into a much more neatly organized whole.
-Removed the "Do Nothing" commands from where they were not needed.
-Instead of making everything invulnerable permanently, the triggers now quickly shift to invulnerable and back to vulnerable without affecting anything.
-Instead of always relying on a global "pick destructible", it now relies on the ability cast selection.
-Made triggers no longer require mass "pick destructible" to work.
-Added some configuration.
-Better map test representation.
-Better Images.


Changelog 1.2 - I had amazing help from Insanity_AI on the rework, big thanks!
-Redid some points of the code and added more things to it
-Separated configurables from the core
-Added more to work with to the system

Changelog 1.3
-Bugged the coding...

Changelog 1.4 - Current one (Thank you Rheiko for pointing things out!)
-Fixed coding error caused by variable's name change
-Fixed leak in the triggers (Hopefully it was done correctly)
-Has Description on how to use it...
-Removed an useless "If, Then, Else"
-No more "Do Nothing"

Changelog 1.5
-Blacklist and Whitelist choice (Will it specify not to destroy certain things, or kill those certain things)
-Possibility of making abilities affect select destructables (Maximum of 269, 30 Destructibles each)
-Would Like to say my BIG thanks to Insanity_AI

Changelog 1.6 [New]
-The system coding has been compressed from three cores to one.

Upcoming Changelog for 1.7
-Immolation type abilities will be recognized and will work
-Possibly finalized version

  • TA Core
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • For each (Integer TTA_Short_HV) from 0 to TTA_Sp_Am, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to TTA_Dood_CS[TTA_Short_HV]
            • Then - Actions
              • Set TTA_Sp_Loc = (Target point of ability being cast)
              • Trigger - Run Config Doodads <gen> (ignoring conditions)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TTA_White_or_Black[TTA_Short_HV] Equal to False
                • Then - Actions
                  • Destructible - Pick every destructible within TTA_RoCS[TTA_Short_HV] of TTA_Sp_Loc and do (Actions)
                    • Loop - Actions
                      • For each (Integer TTA_ForLoop_Var) from 0 to TTA_Destr_BlackL_Am, 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 TTA_Destr[((TTA_List_Limit x TTA_Short_HV) + TTA_ForLoop_Var)]
                            • Then - Actions
                              • Destructible - Make (Picked destructible) Invulnerable
                            • Else - Actions
                • Else - Actions
                  • Destructible - Pick every destructible within TTA_RoCS[TTA_Short_HV] of TTA_Sp_Loc and do (Actions)
                    • Loop - Actions
                      • For each (Integer TTA_ForLoop_Var) from 0 to TTA_Destr_BlackL_Am, do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Destructible-type of (Picked destructible)) Not equal to TTA_Destr[((TTA_List_Limit x TTA_Short_HV) + TTA_ForLoop_Var)]
                            • Then - Actions
                              • Destructible - Make (Picked destructible) Invulnerable
                            • Else - Actions
              • Destructible - Pick every destructible within TTA_RoCS[TTA_Short_HV] of TTA_Sp_Loc and do (If (((Picked destructible) is invulnerable) Equal to False) then do (Destructible - Remove (Picked destructible)) else do (Destructible - Make (Picked destructible) Vulnerable))
              • Custom script: call RemoveLocation(udg_TTA_Sp_Loc)
            • Else - Actions
  • Config Destructibles
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TTA_Destr_BlackL_Am = 1
      • Set TTA_List_Limit = 30
      • -------- ================ --------
      • Set TTA_Destr[0] = Ashenvale Tree Wall
      • Set TTA_Destr[1] = Barrel
      • -------- ============== --------
      • Set TTA_Destr[30] = Volcano
      • Set TTA_Destr[31] = Volcano
  • Config Spells
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TTA_ForLoop_Var = 0
      • Set TTA_Short_HV = 0
      • Set TTA_Sp_Am = 1
      • -------- =============== --------
      • Set TTA_Dood_CS[0] = Dispel Magic
      • Set TTA_RoCS[0] = 256.00
      • Set TTA_White_or_Black[0] = False
      • Set TTA_Grass[0] = True
      • Set TTA_Rock[0] = True
      • -------- ================== --------
      • Set TTA_Dood_CS[1] = Rain of Fire (Neutral Hostile 2)
      • Set TTA_RoCS[1] = 300.00
      • Set TTA_White_or_Black[1] = True
      • Set TTA_Grass[1] = False
      • Set TTA_Rock[1] = False
  • Config Doodads
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TTA_Grass[TTA_Short_HV] Equal to True
        • Then - Actions
          • Animation - Play the hide animation for all doodads of type Grass within TTA_RoCS[TTA_Short_HV] of TTA_Sp_Loc
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TTA_Rock[TTA_Short_HV] Equal to True
        • Then - Actions
          • Animation - Play the hide animation for all doodads of type Rock within TTA_RoCS[TTA_Short_HV] of TTA_Sp_Loc
        • Else - Actions
Previews
Contents

True Terraforming Addon (Map)

Reviews
Tank-Commander
Alright there's been some decent progress on this, it's look much better than when it started out, few things still to deal with though: V1.5: - Your triggers should all have the same prefix which matches the system - Don't put the triggers into...

Tank-Commander

Spell Reviewer
Level 29
Joined
May 26, 2009
Messages
1,839
Thanks for the submission to the spell section, I have a few notes regarding the current version

v1.0:
There's a number of issues with the system as it stands - it's much more like a tutorial than an actual system due to the inflexibility of it first and foremost. I suggest reading tutorials we have on how to make submissions for the spell section in particular I suggest Things That Leak and GPAG - GUI Proper Application Guide as a basic reference (the latter must be adhered to as a matter of rules). some more specific points though:
- Do nothing actions do just that, so there's no point in putting them in your code
- The system lacks a proper configuration, you don't want to have to pick every single destructible every time we want to add a single doodad type to the exclusion list, you want to make use of "Or - any condition" functions at the very least and ideally use an array storing all the exclusions you want so users don't need to go near the pick all destructible function(s) at all
- Use a unit begins the effect of, not unit starts casting (can be abused)
- Your last two triggers can be combined
- you don't need the empty if-then-else in either of your last two triggers
- Spell types can be configurables (see proper configuration)
- Making doodads/destructibles invulnerable has some other side effects that users may not want, these side effects should be listed - for example try harvesting a tree with some workers after it has been made invulnerable
- If users only want exclusions via terraforming but not via other methods (e.g. want a summer tree wall to be kill-able by meat wagons) it would be better to only make these things be excluded when the terraforming goes through, rather than making them outright invulnerable all the time but I leave that to your discretion with regards to the previous point

As I mentioned before this system is more suited to a tutorial generally speaking since people would in most cases would not use the last two triggers even when they want such a system as they'd have their own wanted method of removal rather than necessarily a spell. This may also fall under the "too simple" clause of the rules
 
Level 21
Joined
Aug 27, 2013
Messages
3,963
This is rather simple. Too simple, in fact.

It should be a unit starts casting an ability because the spell will take effect before it is finished being cast if you use a unit begins casting an ability.
Do nothing slows down your trigger, no need to put anything there and it is exactly the same as do nothing.
There is also a location leak.

Agree with Tank that this is more suited to a tutorial.
 
Level 7
Joined
Jun 27, 2014
Messages
228
Alright, I'll look into the triggering and try to fix all the leaks, but like I stated - I'm really a newbie at making triggers so I ain't sure how much I can fix - but I'll follow the instructions given. In any case I simply made this because I saw so many maps use systems for farming, yet never a system which also removes the doodads or destructibles in the same time.
 
Level 21
Joined
Aug 27, 2013
Messages
3,963
Your code still leaks. Please read what Tank-Commander said and the link he provided. Target point of ability being cast should be stored inside a variable and destroyed after use. I don't understand what the loop is for, exactly? Also, There's still no configuration trigger for this thing.
 
Level 7
Joined
Jun 27, 2014
Messages
228
Your code still leaks. Please read what Tank-Commander said and the link he provided. Target point of ability being cast should be stored inside a variable and destroyed after use. I don't understand what the loop is for, exactly? Also, There's still no configuration trigger for this thing.
Will do, the only problem for me is that I'm a complete newbie at triggers so it takes me a while to understand. Doing arrays was completely new for me as it is.

Edit : Can't find where the leak is no matter how many times I look at the code and the link, as per the loops - they are crucial for all the destructibles within the array. If I removed those then even the destructibles set as an exclusion to the removal would get removed, plus it makes the code look neater.

Also, a major thing to note : Pick Dest in Area only picks at max 64 dest per execution.
I might not be able to fix that sadly, I thought if I use a trigger loop if there are more destructibles that are not invulnerable, but I realized doodads still exist. I'll still try to think of something.

Edit : I don't think that will actually be a problem. the animation plays for the doodads correctly and hides them no matter how many there are. Destructibles are simply for the use of blocking, thus I don't think there will be more than 64 pathing blockers in an ability's AoE. So, I don't think it's much of a major thing that will have a overall big impact.If there truly are more destructibles than 64, then all you'd have to do is re-cast the ability. The 64 would be gone and what other destructibles would be there would now be affected, yes?
 
Last edited:

Tank-Commander

Spell Reviewer
Level 29
Joined
May 26, 2009
Messages
1,839
Alright there's been some decent progress on this, it's look much better than when it started out, few things still to deal with though:

V1.5:
- Your triggers should all have the same prefix which matches the system
- Don't put the triggers into separate folders, if you feel a need to keep them separated then use a comment trigger (like you did with the authors note) to keep them apart.
- Your whitelist and blacklist triggers both have lots of code duplication, they could both be put in their respective sides of the IF condition in the "Core Conditions" trigger and have the ubiquitous parts outside of that if condition which is pretty much all of it and reduces the system down to 1 non-configuration trigger. You can actually make them fully ubiquotous by modifying your filter to say "(((Destructible-type of (Picked destructible)) Equal to TTA_Destr[((TTA_List_Limit x TTA_Short_HV) + TTA_ForLoop_Var)]) Equal to (TTA_White_or_Black[TTA_Short_HV])"
- Config doodads should have the IF statements nested really if you want to do it the way you have - otherwise for every additional ability the whole system gets slower - also it's leaking locations at the moment, it could also be changed into a boolean list and combined with the spell config e.g. "TTA_HideGrass[0] = true" and "TTA_HideRocks[0] = true" which avoids that whole issue and would run faster in the long run.
- in core conditions there's no need to exit and have another IF condition, where you have "Abi_Check" just put the IF statement there - it would make the system run faster.
- When you make some destructibles immune and then decide whether or not you should remove them by picking them all again and checking which ones are now immune, you could just remove the ones you wouldn't make immune the first time you pick all the desctructibles instead and avoid that whole thing
- If you do all the compression I've said the entire core code of the system should fit into about roughly 30 lines and 1 trigger with 2 configuration triggers
 
Top