HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Noob's facing question

03-25-2008, 03:39 PM#1
teddybear
Hello all, I wante to make a little replace to the auto attacks so Iv'e created a little ability instead.
The ability i created supporsed to pick up 1 unit within 100 of postion of the
using unit's facing angle or somthing like this so it'll be like not auto-attack and not targeted shot.

Im using this trigger: (dont laugh, im new on that!)
Trigger:
Collapse Hero Attack use
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Attack
Collapse Actions
Collapse Unit Group - Pick every unit in (Random 1 units from (Units within 100.00 of ((Position of Hero) offset by (((Facing of Hero) + 100.00), ((Facing of Hero) + 100.00))) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of Play and do (Actions)
Loop - Actions
...

This is more or less what im using and its not that correct as I see...
anyone have suggestions?
03-25-2008, 05:30 PM#2
notsoexpert
That'll leak:
Trigger:
Untitled Trigger 001
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Attack
Collapse Actions
Set unit = (Triggering unit)
Set pos = (Position of unit)
Set point = (pos offset by 180.00 towards (Facing of (Triggering unit)) degrees)
Set group = (Units within 100.00 of point matching ((((Matching unit) belongs to an enemy of (Owner of unit)) Equal to True) and (((Matching unit) is alive) Equal to True)))
Set targ = (Random unit from group)
Unit - Cause unit to damage targ, dealing (Real((Agility of unit (Include bonuses)))) damage of attack type Hero and damage type Normal
Custom script: set udg_unit = null
Custom script: call RemoveLocation(udg_pos)
Custom script: call RemoveLocation(udg_point)
Custom script: call DestroyGroup(udg_group)
Custom script: set udg_group = null
Custom script: set udg_targ = null
Custom script: set udg_pos = null
Custom script: set udg_point = null
-------- You will probably want waits, animations, etc., so some variables are just-in-case. --------

Also, by the way, if you give all of your units the Worker classification, they won't auto-attack and will automatically run from attackers unless ordered otherwise.
03-25-2008, 07:04 PM#3
teddybear
Im not that new,i knew that fact with the workers

Waaah... that was correctly what I looking for, thanks!
+rep