H34DhUnT3r
Ultra Cool Member
- Reaction score
- 36
Hello,
I'm not sure where to post this kind of stuff, but here it goes:
==============================================
Gate Demo by H34DhUnT3r[NL]
This gives a buildable gate with an open and close ability
Uses:
- 3 triggers
- 3 variables
- 2 regions
- 1 custom unit (the gate)
- 1 custom ability (open and close)
The triggers:
This trigger will create pathing blockers at the place where a gate is build.. It also gives the gate the Open Close ability and sets the ability to 1.. The open close ability is one ability with 2 levels.. 1 level for open and one level for close..
This trigger will remove the pathing blockers when the gate is destroyed.. this has to be done with a region, because the offset action can only place not remove.. It also creates (and destroys) a special effect (an explosion)..
This trigger controls the open close ability when the open gate (level 1) is casted it opens the gate with a animation and destroys the middle 3 pathing blockers (with a region).. it doesn't destroys the pathing blockers at the end (those are placed on the "towers") this way you can walk trough the gate, but it doesn't let you to walk trough both ends..
when the open gate is cast it sets the ability to 2 so that the close gate ability gets available.. same way if it's closed then the level will be set back to 1..
I know that there are people that think that this is not needed as you have the "destructible" gate.. but with that one there isn't an open and close gate like this and it can't be used in battle, cuz you cant build/attack it (yes you can attack it, but it's still a neutral passive (or something like that).. this way you can actually build, open and close the gate.. with the risk of it being destroyed by other players..
Hope you like it.. Plz comment
Greetings,
H34DhUnT3r[NL]
H34DhUnT3r[NL]'s Custom War 3 TFT Maps
P.S. Not sure if it's leak free.. can someone check plz?
I'm not sure where to post this kind of stuff, but here it goes:
==============================================
Gate Demo by H34DhUnT3r[NL]
This gives a buildable gate with an open and close ability
Uses:
- 3 triggers
- 3 variables
- 2 regions
- 1 custom unit (the gate)
- 1 custom ability (open and close)
The triggers:
This trigger will create pathing blockers at the place where a gate is build.. It also gives the gate the Open Close ability and sets the ability to 1.. The open close ability is one ability with 2 levels.. 1 level for open and one level for close..
Code:
PlaceGate
Events
Unit - A unit Finishes construction
Conditions
(Unit-type of (Constructed structure)) Equal to Horizontal Gate
Actions
Set GatePlaceTmp = (Position of (Constructed structure))
Destructible - Create a Pathing Blocker (Both) (Large) at GatePlaceTmp facing (Random angle) with scale 1.00 and variation 0
Destructible - Create a Pathing Blocker (Both) (Large) at (GatePlaceTmp offset by 128.00 towards 0.00 degrees) facing (Random angle) with scale 1.00 and variation 0
Destructible - Create a Pathing Blocker (Both) (Large) at (GatePlaceTmp offset by 256.00 towards 0.00 degrees) facing (Random angle) with scale 1.00 and variation 0
Destructible - Create a Pathing Blocker (Both) (Large) at (GatePlaceTmp offset by 128.00 towards 180.00 degrees) facing (Random angle) with scale 1.00 and variation 0
Destructible - Create a Pathing Blocker (Both) (Large) at (GatePlaceTmp offset by 256.00 towards 180.00 degrees) facing (Random angle) with scale 1.00 and variation 0
Unit - Add OpenClose Gate to (Constructed structure)
Unit - Set level of OpenClose Gate for (Constructed structure) to 1
Custom script: call RemoveLocation(udg_GatePlaceTmp)
This trigger will remove the pathing blockers when the gate is destroyed.. this has to be done with a region, because the offset action can only place not remove.. It also creates (and destroys) a special effect (an explosion)..
Code:
DestroyGate
Events
Unit - A unit Dies
Conditions
(Unit-type of (Dying unit)) Equal to Gate
Actions
Set GateDieTmp = (Position of (Dying unit))
Region - Center GateRegionHori <gen> on GateDieTmp
Destructible - Pick every destructible in GateRegionHori <gen> and do (Destructible - Remove (Picked destructible))
Special Effect - Create a special effect at GateDieTmp using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
Custom script: call RemoveLocation(udg_GateDieTmp)
Special Effect - Destroy (Last created special effect)
This trigger controls the open close ability when the open gate (level 1) is casted it opens the gate with a animation and destroys the middle 3 pathing blockers (with a region).. it doesn't destroys the pathing blockers at the end (those are placed on the "towers") this way you can walk trough the gate, but it doesn't let you to walk trough both ends..
when the open gate is cast it sets the ability to 2 so that the close gate ability gets available.. same way if it's closed then the level will be set back to 1..
Code:
OpenCloseGate
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to OpenClose Gate
Actions
Set GateOpenCloseTmp = (Position of (Casting unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of OpenClose Gate for (Casting unit)) Equal to 1
Then - Actions
Region - Center GateRegionHoriOpenClose <gen> on GateOpenCloseTmp
Animation - Play (Casting unit)'s death alternate animation
Destructible - Pick every destructible in GateRegionHoriOpenClose <gen> and do (Destructible - Kill (Picked destructible))
Unit - Set level of OpenClose Gate for (Casting unit) to 2
Game - Display to (Player group((Owner of (Casting unit)))) the text: Gate Opened
Custom script: call RemoveLocation(udg_GateOpenCloseTmp)
Skip remaining actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of OpenClose Gate for (Casting unit)) Equal to 2
Then - Actions
Region - Center GateRegionHoriOpenClose <gen> on GateOpenCloseTmp
Animation - Play (Casting unit)'s stand animation
Destructible - Pick every destructible in GateRegionHoriOpenClose <gen> and do (Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Hide birth animation)
Unit - Set level of OpenClose Gate for (Casting unit) to 1
Game - Display to (Player group((Owner of (Casting unit)))) the text: Gate Closed
Custom script: call RemoveLocation(udg_GateOpenCloseTmp)
Else - Actions
I know that there are people that think that this is not needed as you have the "destructible" gate.. but with that one there isn't an open and close gate like this and it can't be used in battle, cuz you cant build/attack it (yes you can attack it, but it's still a neutral passive (or something like that).. this way you can actually build, open and close the gate.. with the risk of it being destroyed by other players..
Hope you like it.. Plz comment
Greetings,
H34DhUnT3r[NL]
H34DhUnT3r[NL]'s Custom War 3 TFT Maps
P.S. Not sure if it's leak free.. can someone check plz?