Grags_1977
Ultra Cool Member
- Reaction score
- 32
Firstly please don't be put off by the triggers. They are not complicated whatsoever.
Around the map, I have many unlit torches.
These torches are stored into a unitgroup (UnitGroup_Torches)
The hero can light these torches with his Firebolt ability.
The hero SHOULD have shared vision with a lit torch.
The problem is... It's very random whether or not the torch will grant shared vision.
But whats most confusing, is that in order for the torch to light, it has to run through the trigger that grants shared vision (see trigger 2, light torch) and when Firebolt is cast on a torch, the torch allways lights
Can anyone see what is going on?
EDIT: SOLVED!
This is my workaround... Stupid, but whatever. It works.
Around the map, I have many unlit torches.
These torches are stored into a unitgroup (UnitGroup_Torches)
The hero can light these torches with his Firebolt ability.
The hero SHOULD have shared vision with a lit torch.
The problem is... It's very random whether or not the torch will grant shared vision.
But whats most confusing, is that in order for the torch to light, it has to run through the trigger that grants shared vision (see trigger 2, light torch) and when Firebolt is cast on a torch, the torch allways lights
Can anyone see what is going on?
Trigger:
- FireBolt
- Events
- Unit - A unit Begins casting an ability
- Conditions
- (Ability being cast) Equal to Firebolt
- (Casting unit) Equal to Unit_Hero
- Actions
- Set Unit_FireBolt = (Target unit of ability being cast)
- Set TempPoint[6] = (Position of (Casting unit))
- Set TempPoint[7] = (Target point of ability being cast)
- Wait ((Distance between TempPoint[6] and TempPoint[7]) / 1000.00) seconds
- Custom script: call RemoveLocation( udg_TempPoint[6] )
- Custom script: call RemoveLocation( udg_TempPoint[7] )
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of Unit_FireBolt) Equal to Torch
- (Unit_FireBolt is in UnitGroup_Torches) Equal to True
- Then - Actions
- Trigger - Run Light Torch <gen> (checking conditions)
- Else - Actions
- If - Conditions
- Events
Trigger:
- Light Torch
- Events
- Conditions
- Actions
- Unit Group - Remove Unit_FireBolt from UnitGroup_Torches
- Unit - Grant shared vision of Unit_FireBolt to Player 1 (Red)
- Animation - Play Unit_FireBolt's stand animation
EDIT: SOLVED!
This is my workaround... Stupid, but whatever. It works.
Trigger:
- Light Torch
- Events
- Conditions
- Actions
- Unit Group - Remove Unit_FireBolt from UnitGroup_Torches
- Set TempUnitGroup[1] = (Units of type Torch)
- Unit Group - Pick every unit in TempUnitGroup[1] and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Picked unit) is in UnitGroup_Torches) Equal to False
- Then - Actions
- Unit - Grant shared vision of (Picked unit) to Player 1 (Red)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Custom script: call DestroyGroup ( udg_TempUnitGroup[1] )
- Animation - Play Unit_FireBolt's stand animation