HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Sliding trigger and camera bounds!

09-07-2008, 02:06 AM#1
Mike889
Hello! This is my first post here !
Well, I made a sliding trigger for a spell. It works perfectly, however it allow my unit to pass the camera bounds, becoming unusable! How can I prevent that?
Here are my triggers:

Trigger:
Jostle
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to (==) Jostle (Anub'arak)
Collapse Actions
Unit - Pause (Triggering unit)
Unit - Turn collision for (Triggering unit) Off
Unit - Add Jostle Effect to (Triggering unit)
Unit Group - Add (Triggering unit) to Skill_JostleGroup
Set Skill_DistanceRun[(Player number of (Owner of (Triggering unit)))] = 0.00
Set Skill_Caster[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
Animation - Play Skill_Caster[(Player number of (Owner of (Picked unit)))]'s spell channel animation
Trigger - Turn on Jostle Slide <gen>
Trigger - Turn on Jostle UnitDies <gen>

Trigger:
Jostle Slide
Collapse Events
Time - Every 0.01 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in Skill_JostleGroup and do (Actions)
Collapse Loop - Actions
Collapse Set CustomValue = (Player number of (Owner of (Picked unit)))
Collapse Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Skill_DistanceRun[(Player number of (Owner of (Picked unit)))] Greater than or equal to (>=) 1500.00
Collapse Then - Actions
Unit - Unpause (Picked unit)
Unit - Turn collision for (Picked unit) On
Unit - Remove Jostle Effect from (Picked unit)
Unit Group - Remove (Picked unit) from Skill_JostleGroup
Collapse Else - Actions
Set Skill_UnitPos = (Position of (Picked unit))
Set Temp_Angle = (Facing of (Picked unit))
Set Temp_Point = (Skill_UnitPos offset by 5.00 towards Temp_Angle degrees)
Set Skill_DistanceRun[(Player number of (Owner of (Picked unit)))] = (Skill_DistanceRun[(Player number of (Owner of (Picked unit)))] + 5.00)
Unit - Move (Picked unit) instantly to Temp_Point
Camera - Pan camera for (Owner of (Picked unit)) to Temp_Point over 0.01 seconds
Set Skill_Caster[CustomValue] = (Picked unit)
Collapse Unit Group - Pick every unit in (Units within 300.00 of Temp_Point) and do (Actions)
Collapse Loop - Actions
Collapse Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of Skill_Caster[CustomValue]) is an enemy of (Owner of (Picked unit))) Equal to (==) True
Collapse Then - Actions
Unit - Cause Skill_Caster[CustomValue] to damage (Picked unit), dealing ((41.67 x (Real((Level of Spiked Carapace (Anub'arak) for Skill_Caster[CustomValue])))) x (Real((Level of Jostle (Anub'arak) for Skill_Caster[CustomValue])))) damage of attack type Normal and damage type Normal
Else - Actions
Collapse Destructible - Pick every destructible within 300.00 of Temp_Point and do (Actions)
Collapse Loop - Actions
Destructible - Kill (Picked destructible)
Point - Remove Temp_Point
Point - Remove Skill_UnitPos
09-07-2008, 02:25 AM#2
Pyrogasm
The camera bounds, or the map bounds? Because it should stop once it gets to the camea bounds.
09-07-2008, 02:28 AM#3
Mike889
The camera bounds, this way the unit can't enter the black area around the map. I want the unit to turn 180 degrees, so it will slide backwards.
I know I must make the Facing Angle of the unit = Facing of Unit + 180, however I don't know how to see if the unit is out of the playable map area.
09-07-2008, 03:05 AM#4
Pyrogasm
As I said, when you move the unit with this line:
Trigger:
Unit - Move (Picked unit) instantly to Temp_Point
...it should automatically check to see if it's outside the camera bounds and if it is it will not move it.
09-07-2008, 03:41 AM#5
Mike889
Unfortunately, the unit moves outside of the screen and disappears o.O
But I made regions around the map limits, and everytime a unit enters those regions, it's facing angle is turned by 180 degrees.
Thanks for you time anyway ^^
+rep