HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Problems making units move...

03-12-2007, 04:29 PM#1
botanic
I am trying to get this to work however the only way I can get the units to ignore there guard positions is to set the Gameplay constants...

Variables:
Trigger:
Variable set
Collapse Events
Map initialization
Conditions
Collapse Actions
Set Spawn_Regions[1] = Region 000 Copy <gen>
Set Spawn_Regions[2] = Region 000 <gen>
Set Spawn_Regions[3] = Region 007 <gen>
Set Spawn_Regions[4] = Region 007 Copy <gen>
Set Spawn_Regions[5] = Region 025 Copy <gen>
Set Spawn_Regions[6] = Region 025 <gen>
Set Spawn_Regions[7] = Region 011 <gen>
Set Spawn_Regions[8] = Region 011 Copy <gen>
-------- --------
Set Spawn_Regions[9] = Region 001 Copy <gen>
Set Spawn_Regions[10] = Region 001 <gen>
Set Spawn_Regions[11] = Region 006 <gen>
Set Spawn_Regions[12] = Region 006 Copy <gen>
Set Spawn_Regions[13] = Region 015 Copy <gen>
Set Spawn_Regions[14] = Region 015 <gen>
Set Spawn_Regions[15] = Region 010 <gen>
Set Spawn_Regions[16] = Region 010 Copy <gen>
-------- --------
Set Path_Makers[1] = Path Maker 0140 <gen>
Set Path_Makers[2] = Path Maker 0046 <gen>
Set Path_Makers[3] = Path Maker 0057 <gen>
Set Path_Makers[4] = Path Maker 0061 <gen>
-------- --------
Set Path_Makers[5] = Path Maker 0140 <gen>
Set Path_Makers[6] = Path Maker 0046 <gen>
Set Path_Makers[7] = Path Maker 0057 <gen>
Set Path_Makers[8] = Path Maker 0061 <gen>
-------- --------
Set Unit_Spawns[1] = Grunt
Set Unit_Spawns[2] = Troll Headhunter
Set Unit_Spawns[3] = Footman
Set Unit_Spawns[4] = Rifleman
Custom script: call DestroyTrigger(GetTriggeringTrigger())

Create and Move:
Trigger:
Spawn
Collapse Events
Time - Every 25.00 seconds of game time
Conditions
Collapse Actions
-------- Red --------
Collapse For each (Integer A) from 1 to 4, do (Actions)
Collapse Loop - Actions
Collapse For each (Integer B) from 1 to 2, do (Actions)
Collapse Loop - Actions
If ((Integer B) Equal to 1) then do (Set temppoint = (Center of Spawn_Regions[(Integer A)])) else do (Set temppoint = (Center of Spawn_Regions[((Integer A) + 8)]))
Unit - Create creepNum Unit_Spawns[(Integer B)] for Neutral Victim at temppoint facing Default building facing degrees
Custom script: call RemoveLocation( udg_temppoint )
Set temppoint = (Position of Path_Makers[(Integer A)])
If ((Integer B) Equal to 1) then do (Set tempunitgroup = (Units in Spawn_Regions[(Integer A)] owned by Neutral Victim)) else do (Set tempunitgroup = (Units in Spawn_Regions[((Integer A) + 8)] owned by Neutral Victim))
Unit Group - Pick every unit in tempunitgroup and do (AI - Ignore (Picked unit)'s guard position)
Unit Group - Pick every unit in tempunitgroup and do (Unit - Order (Picked unit) to Attack-Move To temppoint)
Custom script: call RemoveLocation( udg_temppoint )
Custom script: call DestroyGroup( udg_tempunitgroup )
Collapse For each (Integer A) from 5 to 8, do (Actions)
Collapse Loop - Actions
Collapse For each (Integer B) from 1 to 2, do (Actions)
Collapse Loop - Actions
If ((Integer B) Equal to 1) then do (Set temppoint = (Center of Spawn_Regions[(Integer A)])) else do (Set temppoint = (Center of Spawn_Regions[((Integer A) + 8)]))
Unit - Create creepNum Unit_Spawns[((Integer B) + 2)] for Neutral Extra at temppoint facing Default building facing degrees
Custom script: call RemoveLocation( udg_temppoint )
Set temppoint = (Position of Path_Makers[(Integer A)])
If ((Integer B) Equal to 1) then do (Set tempunitgroup = (Units in Spawn_Regions[(Integer A)] owned by Neutral Extra)) else do (Set tempunitgroup = (Units in Spawn_Regions[((Integer A) + 8)] owned by Neutral Extra))
Unit Group - Pick every unit in tempunitgroup and do (AI - Ignore (Picked unit)'s guard position)
Unit Group - Pick every unit in tempunitgroup and do (Unit - Order (Picked unit) to Attack-Move To temppoint)
Custom script: call RemoveLocation( udg_temppoint )
Custom script: call DestroyGroup( udg_tempunitgroup )
AI - Ignore the guard positions of all Neutral Victim units
AI - Ignore the guard positions of all Neutral Extra units

Thank you anyone who helps I have been working on this problem for almost a week now...
03-15-2007, 09:38 PM#2
botanic
and bump PlZ!!!!!
03-16-2007, 01:48 AM#3
Anopob
Quote:
Originally Posted by botanic
I am trying to get this to work however the only way I can get the units to ignore there guard positions is to set the Gameplay constants...

Thank you anyone who helps I have been working on this problem for almost a week now...

Then why dont you do that?
03-16-2007, 07:35 AM#4
botanic
because I also have neutral creeps and that causes them to chase you all over the map
03-16-2007, 07:40 AM#5
Earth-Fury
So write a custom creep camping AI. Check their position every 1 secont, and if its too far from their camp location, order them to move back to it.
03-17-2007, 03:29 AM#6
Pyrogasm
Quote:
Originally Posted by Earth-Fury
So write a custom creep camping AI. Check their position every 1 secont, and if its too far from their camp location, order them to move back to it.
That works, but there are a myriad of ways to exploit that. One of which being that one could stand just outside of their camp radius with a ranged hero and camp them.
03-17-2007, 03:35 AM#7
wantok
Make a region for each creep camp. Use the unit leaves region event to order the creeps back to their spawn site when they move out of the region.

If you're worried about people abusing this you could make two regions for each camp. One big one and one small one. When a creep leaves the big one give it invulnerability and order it to move back to the spawn site. When it enters the little region, remove the invulnerability.
03-17-2007, 07:16 AM#8
Earth-Fury
Quote:
Originally Posted by Pyrogasm
That works, but there are a myriad of ways to exploit that. One of which being that one could stand just outside of their camp radius with a ranged hero and camp them.

True, but one could always make it much more complex. For example, have the creeps attack someone if they are being attacked. Maybe even institute camp groups so when one member of the camp is attacked, they all try to help out.

But just a basic "if im being attacked, attack back" wouldnt be that hard to add to such a system.
03-17-2007, 12:54 PM#9
botanic
ok so i ne3ed an ai... um can anyone help with that I tried looking that the tutorials for AI making and well im completely confused to how I would make the creeps do that ^.^