HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

make unit face angle when near a unit not already in game

07-29-2006, 04:46 PM#1
evilmapcreater
basicly i want my footman to face the other direction when it gose near a farm. the farm is contructed in game .... i thought that if i could make a region a lil bigger than the farm, and move it rely fast to a farm like this
Trigger:
move region
Collapse Events
Time - Every 0.01 seconds of game time
Conditions
Collapse Actions
Region - Center Region 000 <gen> on (Position of (Random unit from (Random 1 units from (Units of type Farm))))
and this
Trigger:
footma hits region
Collapse Events
Unit - A unit enters Region 000 <gen>
Collapse Conditions
(Unit-type of (Triggering unit)) Equal to Footman
Collapse Actions
Unit - Make (Entering unit) face (360.00 - (Facing of (Entering unit))) over 0.00 seconds
but that dosent work.. im realy fustrated.. any ideas or suggestions or anything i can build off of?
07-29-2006, 06:34 PM#2
Fin.
Use the a unit comes withing range of unit event, then pause the unit and turn and order to stop and unpause, also your angel is messed up it should be facing of triggered unit +180 to get him to face opposite way
07-29-2006, 07:26 PM#3
Captain Griffen
The region you specify is not the object used for the 'unit enters region' event, which actually creates a new region, thus meaning that doing anything to the region has no effect on the event.
07-30-2006, 02:30 AM#4
evilmapcreater
is there a way i can use unit comes withing range of unit event with a contructed in the game? thats what i asked :)
07-30-2006, 02:37 AM#5
Wyvernoid
Well I could have answered lilanime's questions if I thought out the problem... In fact it seemed impossible... Dunno if any master can think it out.
07-30-2006, 03:27 AM#6
evilmapcreater
is there a alturnitive? :(

EDIT: O.o this dosent work too
Trigger:
Footman gose near farm
Collapse Events
Time - Every 0.03 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in (Units of type Farm) and do (Actions)
Collapse Loop - Actions
Collapse Unit Group - Pick every unit in (Units within 512.00 of (Position 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
(Unit-type of (Triggering unit)) Equal to Footman
Collapse Then - Actions
Unit - Move (Picked unit) instantly to (Position of (Picked unit)), facing (180 + (Facing of (Picked unit))) degrees
Custom script: set bj_wantDestroyGroup = true
Collapse Else - Actions
Custom script: set bj_wantDestroyGroup = true
07-30-2006, 10:29 AM#7
Captain Griffen
Trigger - Add event is there for this purpose.
07-30-2006, 10:43 AM#8
Wyvernoid
Wow! It worked! Captain, you're right the "master" I mentioned. ^_^