HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Moving units in unit groups

09-27-2007, 12:56 AM#1
Monky-Master
Please note that I DO know I have lots of glitches and what not in this script. The problem I'm having is that the trigger below won't do the given actions. I'm pretty sure I assigned all the variables correctly...and there's nothing really wrong, cept for the fact that I'm using so many calls on getting a player.

If you see anything, or can think of anything to help me solve this matter, please post. Thanks!

Trigger:
Fire
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Shoot
Collapse Actions
Set Sniper_Loc[(Player number of (Owner of (Casting unit)))] = (Position of Unit_Camera_Lock[(Player number of (Owner of (Casting unit)))])
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Zoomed[(Player number of (Owner of (Casting unit)))] Equal to True
Collapse Then - Actions
Set Sniper_Bullet_Distance[(Player number of (Owner of (Casting unit)))] = 0.00
Set Sniper_Bullet_Distance_Max[(Player number of (Owner of (Casting unit)))] = 5000.00
Unit - Create 1 Sniper Bullet for Player 1 (Red) at Sniper_Loc[(Player number of (Owner of (Casting unit)))] facing (Facing of (Casting unit)) degrees
Set Sniper_Bullet[(Player number of (Owner of (Casting unit)))] = (Last created unit)
Unit Group - Add Sniper_Bullet[(Player number of (Owner of (Casting unit)))] to Bullet_Group[(Player number of (Owner of (Casting unit)))]
Else - Actions
Trigger - Turn on Move Bullet <gen>

Trigger:
Move Bullet
Collapse Events
Time - Every 0.03 seconds of game time
Conditions
Collapse Actions
Custom script: set bj_wantDestroyGroup=true
Collapse Player Group - Pick every player in Player_Is_Here and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Sniper_Bullet_Distance[(Player number of (Picked player))] Less than Sniper_Bullet_Distance_Max[(Player number of (Picked player))]
Collapse Then - Actions
Custom script: set bj_wantDestroyGroup=true
Collapse Unit Group - Pick every unit in Bullet_Group[(Player number of (Picked player))] and do (Actions)
Collapse Loop - Actions
Set Sniper_Bullet_Distance[(Player number of (Owner of (Picked unit)))] = (Sniper_Bullet_Distance[(Player number of (Owner of (Picked unit)))] + 50.00)
Set Bullet_Loc[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
Unit - Move (Picked unit) instantly to (Bullet_Loc[(Player number of (Owner of (Picked unit)))] offset by -50.00 towards (Facing of Sniper_Bullet[(Player number of (Owner of (Picked unit)))]) degrees), facing (Facing of Sniper_Bullet[(Player number of (Owner of (Picked unit)))]) degrees
Custom script: set bj_wantDestroyGroup=true
Collapse Unit Group - Pick every unit in (Units within 60.00 of Bullet_Loc[(Player number of (Owner of (Picked unit)))]) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) belongs to an enemy of (Owner of Sniper_Bullet[(Player number of (Picked player))])) Equal to True
(Picked unit) Not equal to Sniper_Bullet[(Player number of (Owner of (Picked unit)))]
Collapse Then - Actions
Set Target_Distance_Check[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
Unit - Cause Sniper_Bullet[(Player number of (Owner of (Picked unit)))] to damage (Picked unit), dealing (5500.00 - (Distance between (Position of Unit_Camera_Lock[(Player number of (Owner of (Picked unit)))]) and Target_Distance_Check[(Player number of (Owner of (Picked unit)))])) damage of attack type Pierce and damage type Divine
Unit - Remove Sniper_Bullet[(Player number of (Owner of (Picked unit)))] from the game
Unit Group - Remove Sniper_Bullet[(Player number of (Owner of (Picked unit)))] from Bullet_Group[(Player number of (Owner of (Picked unit)))]
Unit Group - Remove all units from Bullet_Group[(Player number of (Owner of (Picked unit)))]
Custom script: call RemoveLocation(udg_Bullet_Loc[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
Custom script: call RemoveLocation(udg_Sniper_Loc[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
Trigger - Turn off (This trigger)
Else - Actions
Collapse Else - Actions
Trigger - Turn off (This trigger)
09-27-2007, 01:30 AM#2
burningice95
Trigger:
Unit - Create 1 Sniper Bullet for Player 1 (Red) at Sniper_Loc[(Player number of (Owner of (Casting unit)))] facing (Facing of (Casting unit)) degrees

Should probably be

Trigger:
Unit - Create 1 Sniper Bullet for Owner of (Picked Unit) at Sniper_Loc[(Player number of (Owner of (Casting unit)))] facing (Facing of (Casting unit)) degrees

Second one its probablya problem with the custom script....
09-27-2007, 01:31 AM#3
Monky-Master
I've already changed it, and still, nothing has happened. I slapped in a debug code to see it works, but it goes off only once.
09-27-2007, 05:12 AM#4
Pyrogasm
Remove this line (it's the first line under "Then - Actions"):
Trigger:
Custom script: set bj_wantDestroyGroup=true