- Joined
- Jul 18, 2008
- Messages
- 4,866
It's been a while since I've done any coding, but I had made this system a looooong time ago and submitted it here, which got rejected. I kinda want to go back and make this worthy of being accepted but I'd like some help determining how to optimize the system as much as possible (aside from the obvious "GUI is like driving an old jalopy, vJass iz da shiz" comments people are going to make, I'm way too lazy to bother jassing this up).
Aside from the the other triggers which have no relevance to the system itself, I thought I had gotten this leak free, though I may be wrong though.
Important triggers:
The unit groups on this one leak, I'll have to fix that
Aside from the the other triggers which have no relevance to the system itself, I thought I had gotten this leak free, though I may be wrong though.
Important triggers:
-
Create Maze
-
Events
-
Conditions
-
Actions
-
-------- Init --------
-
Custom script: set udg_Reference = CreateUnitAtLoc( Player(PLAYER_NEUTRAL_PASSIVE), 'hfoo', udg_StartP, 90.00)
-
Unit Group - Add Reference to MazerGroup
-
Set MazInt = 1
-
Unit - Set the custom value of Reference to MazInt
-
Custom script: set udg_Reference = null
-
For each (Integer LoopInt) from 1 to 1500, do (Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in MazerGroup and do (Actions)
-
Loop - Actions
-
Set P1 = (Position of (Picked unit))
-
-------- Randomness --------
-
Set Probability1 = (Random integer number between 1 and 2)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Probability1 Equal to 1
-
-
Then - Actions
-
Set Prob4 = (Random integer number between 1 and (Complexity x 25))
-
Set Prob5 = (Random integer number between 1 and (Complexity x 70))
-
Set Probability2 = (Random integer number between 1 and Prob4)
-
Set Probability3 = (Random integer number between 1 and Prob5)
-
Set TurnsTurnProbability = (Random integer number between 1 and (Probability2 + Probability3))
-
Set TurnProbability = (Random integer number between 1 and TurnsTurnProbability)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Probability1 Equal to 2
-
-
Then - Actions
-
Set Prob4 = (Random integer number between 1 and (Complexity x 10))
-
Set Prob5 = (Random integer number between 70 and (Complexity x 50))
-
Set Probability2 = (Random integer number between 1 and Prob4)
-
Set Probability3 = (Random integer number between 1 and Prob5)
-
Set TurnsTurnProbability = (Random integer number between 1 and (Probability2 - Probability3))
-
Set TurnProbability = (Random integer number between 1 and TurnsTurnProbability)
-
-
Else - Actions
-
-
-------- Turns --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TurnProbability Equal to 1
-
-
Then - Actions
-
-------- Setting which way left or right --------
-
Set WhichWay = (Random integer number between 1 and 2)
-
-------- Adding on to the real which determines the angle the path is being carved at --------
-
-------- It is possible to make mazes with diagnol paths if this is set with values like 45 --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
WhichWay Equal to 1
-
-
Then - Actions
-
Set Angle[(Custom value of (Picked unit))] = (Angle[(Custom value of (Picked unit))] + 90.00)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
WhichWay Equal to 2
-
-
Then - Actions
-
Set Angle[(Custom value of (Picked unit))] = (Angle[(Custom value of (Picked unit))] - 90.00)
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-------- Chance for Branch offs --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TurnProbability Equal to 2
-
-
Then - Actions
-
-------- Creating Unit for reference and setting up Dummies for branch offs --------
-
Custom script: set udg_Reference = CreateUnitAtLoc( Player(PLAYER_NEUTRAL_PASSIVE), 'hfoo', udg_P2, 90.00)
-
Unit Group - Add Reference to MazerGroup
-
Set MazInt = (MazInt + 1)
-
Unit - Set the custom value of Reference to MazInt
-
Custom script: set udg_Reference = null
-
-
Else - Actions
-
-
Set P2 = (P1 offset by 80.00 towards Angle[(Custom value of (Picked unit))] degrees)
-
-------- ClearTrees/Check Pathing --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(MaxArea contains P2) Equal to True
-
(Terrain pathing at P2 of type Flyability is off) Equal to False
-
-
Then - Actions
-
-------- Moving dummy and checking for Trees (destructables) --------
-
Unit - Move (Picked unit) instantly to P2
-
Destructible - Pick every destructible within PathSize of P2 and do (Actions)
-
Loop - Actions
-
-------- Killing and hiding the corpse --------
-
Destructible - Kill (Picked destructible)
-
Destructible - Hide (Picked destructible)
-
-
-
-
Else - Actions
-
-------- Turning maze if the current path is not pathable or out of limits --------
-
Set Angle[(Custom value of (Picked unit))] = (Angle[(Custom value of (Picked unit))] - 180.00)
-
-
-
-------- An Example of Loot --------
-
-------- This first item creation example creates the flag or "endpoint" of the maze, this doesnt have to be an item but it needs to be something that allows the units in out (like stairways or something) --------
-
-------- This is made at the end of the maze, when the loop integer gets to its highest value --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
LoopInt Equal to 1500
-
-
Then - Actions
-
Item - Create Flag at P2
-
-------- Remove trees around the flag --------
-
Destructible - Pick every destructible within 400.00 of P2 and do (Actions)
-
Loop - Actions
-
Destructible - Kill (Picked destructible)
-
Destructible - Hide (Picked destructible)
-
-
-
-
Else - Actions
-
-
-------- Setting int for loot creation --------
-
Set ChanceForLoot = (Random integer number between 1 and (IntegerforLootSpawn x 40))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ChanceForLoot Equal to 1
-
-
Then - Actions
-
-------- creating loot --------
-
Item - Create LootType[1] at P2
-
-
Else - Actions
-
-
-------- Example of Enemies --------
-
-------- Setting int for enemies --------
-
Set ChanceForEnemies = (Random integer number between 1 and (EnemyDifficultyInt x 60))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ChanceForEnemies Less than or equal to 2
-
-
Then - Actions
-
-------- Creating Enemies, Custom script to make it more efficiant --------
-
Custom script: call CreateUnitAtLoc( udg_EnemyPlayer, udg_EnemyType[1], udg_P2, GetRandomDirectionDeg() )
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ChanceForEnemies Equal to 3
-
-
Then - Actions
-
-------- Creating enemies --------
-
Custom script: call CreateUnitAtLoc( udg_EnemyPlayer, udg_EnemyType[2], udg_P2, GetRandomDirectionDeg() )
-
Destructible - Pick every destructible within 200.00 of P2 and do (Actions)
-
Loop - Actions
-
Destructible - Kill (Picked destructible)
-
Destructible - Hide (Picked destructible)
-
-
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ChanceForEnemies Greater than or equal to 4
-
ChanceForEnemies Less than or equal to 5
-
-
Then - Actions
-
-------- Creating enemies --------
-
Custom script: call CreateUnitAtLoc( Player(PLAYER_NEUTRAL_PASSIVE), udg_EnemyType[3], udg_P2, GetRandomDirectionDeg() )
-
Destructible - Pick every destructible within 300.00 of P2 and do (Actions)
-
Loop - Actions
-
Destructible - Kill (Picked destructible)
-
Destructible - Hide (Picked destructible)
-
-
-
-
Else - Actions
-
-
-------- Example of Terrain and other Doodads, since they cant be places via triggers, use special effects instead --------
-
-------- Setting int for special effects --------
-
Set SXProbability = (Random integer number between 1 and (ChanceForTerrain x 5))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SXProbability Equal to 1
-
-
Then - Actions
-
-------- Setting int for which sx --------
-
Set WhichSxtoMake = (Random integer number between 1 and 5)
-
-------- Moving rect so special effects arent just placed only in the center of the path --------
-
Region - Center RectForSXPlacement on P2
-
-------- Setting point --------
-
Set PForSxPlacement = (Random point in RectForSXPlacement)
-
-------- Creating SX --------
-
Special Effect - Create a special effect at PForSxPlacement using SpecialEffectTypes[WhichSxtoMake]
-
-------- Setting variables --------
-
Set NoofSx = (NoofSx + 1)
-
Set MazeSx[NoofSx] = (Last created special effect)
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_P2)
-
Custom script: call RemoveLocation(udg_P1)
-
-
-
-
-
Wait 0.10 seconds
-
-------- Removing dummies --------
-
Unit Group - Pick every unit in MazerGroup and do (Actions)
-
Loop - Actions
-
Unit - Kill (Picked unit)
-
-
-
-------- Removing crap from group --------
-
Unit Group - Remove all units from MazerGroup
-
Wait 0.50 seconds
-
-------- Setting the ground terrain, change the size and shape so it fits your map --------
-
Environment - Change terrain type at (Center of MaxArea) to Tile using variation -1 in an area of size 29 and shape Square
-
-------- Next action not required --------
-
Trigger - Run Create Units <gen> (checking conditions)
-
-
The unit groups on this one leak, I'll have to fix that
-
Trigger CreateMaze
-
Events
-
Player - Player 1 (Red) types a chat message containing -Maze as An exact match
-
Player - Player 2 (Blue) types a chat message containing -Maze as An exact match
-
Player - Player 3 (Teal) types a chat message containing -Maze as An exact match
-
Player - Player 4 (Purple) types a chat message containing -Maze as An exact match
-
Player - Player 5 (Yellow) types a chat message containing -Maze as An exact match
-
Player - Player 6 (Orange) types a chat message containing -Maze as An exact match
-
-
Conditions
-
Actions
-
-------- Change the actions as needed, you could even have no Events and have this activated by another trigger --------
-
-------- Change depending on what you need, remove the vis creater if you dont want to see the maze reset --------
-
Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
-
Visibility - Destroy (Last created visibility modifier)
-
-------- Required --------
-
For each (Integer A) from 1 to NoofSx, do (Actions)
-
Loop - Actions
-
Special Effect - Destroy MazeSx[(Integer A)]
-
-
-
Unit Group - Pick every unit in (Units of type Maze Man) and do (Actions)
-
Loop - Actions
-
Unit - Replace (Picked unit) with a Knight using The old unit's relative life and mana
-
-
-
Unit Group - Pick every unit in (Units of type ) and do (Actions)
-
Loop - Actions
-
Unit - Remove (Picked unit) from the game
-
-
-
-------- Change with themes you need --------
-
Destructible - Pick every destructible in MaxArea and do (Actions)
-
Loop - Actions
-
Set PointForMakeDestructables = (Position of (Picked destructible))
-
Destructible - Remove (Picked destructible)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
IntegerforTheme Equal to 1
-
-
Then - Actions
-
Destructible - Create a Ashenvale Tree Wall at PointForMakeDestructables facing (Random angle) with scale 1.00 and variation 0
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
IntegerforTheme Equal to 2
-
-
Then - Actions
-
Destructible - Create a Magic Box at PointForMakeDestructables facing (Random angle) with scale 1.00 and variation 0
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
IntegerforTheme Equal to 3
-
-
Then - Actions
-
Destructible - Create a Rock Chunks at PointForMakeDestructables facing (Random angle) with scale 1.00 and variation 0
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
IntegerforTheme Equal to 4
-
-
Then - Actions
-
Destructible - Create a Green Rock at PointForMakeDestructables facing (Random angle) with scale 1.00 and variation 0
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
IntegerforTheme Equal to 5
-
-
Then - Actions
-
Destructible - Create a Icecrown Tree Wall at PointForMakeDestructables facing (Random angle) with scale 1.00 and variation 0
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_PointForMakeDestructables)
-
-
-
-------- Alter as needed, the units will either have to be removed or moved somewhere --------
-
Unit Group - Pick every unit in (Units owned by Player 7 (Green)) and do (Actions)
-
Loop - Actions
-
Unit - Remove (Picked unit) from the game
-
-
-
Unit Group - Pick every unit in (Units owned by Neutral Passive) and do (Actions)
-
Loop - Actions
-
Unit - Remove (Picked unit) from the game
-
-
-
-------- Alter as needed, the items will either have to be removed or moved somewhere --------
-
Item - Pick every item in (Playable map area) and do (Item - Remove (Picked item))
-
-------- Alter as needed --------
-
Game - Display to (All players) the text: Randomizing...........
-
Wait 1.00 seconds
-
Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Black mask across (Playable map area)
-
Visibility - Destroy (Last created visibility modifier)
-
Wait 1.50 seconds
-
Trigger - Run Create Maze <gen> (checking conditions)
-
-