HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Small JASS Request

01-21-2005, 11:12 PM#1
ShadowWolf
From what I know, this shouldn't be very big, and I do not have the time to learn JASS, so here's my request:

I need something to redirect these trigger to not random doodads, but ones nearest to the tree attacking sheep.

Level 9a
Events
Unit - A unit enters Attackers Command Region <gen>
Conditions
LevelNumber Equal to 9
Actions
Unit - Order (Triggering unit) to Attack-Move To (Center of Pasture <gen>)

Level 9b
Events
Unit - A unit Is issued an order targeting a point
Conditions
(Unit-type of (Triggering unit)) Equal to Tree Eating Sheep - 9
(Issued order) Equal to (Order(attack))
Actions
Unit - Order (Triggering unit) to Attack (Random destructible in (Playable map area))

Thank you so much in advance to whomever cares enough to help me out.
01-24-2005, 04:42 AM#2
curi
one way to do it is: pick all trees on the map, (or pick all in some convenient area) anyway then you could pick random trees from the group, check if they are close enough, and send sheep off to eat. if the tree is too far away, remove it from the group and try again. if the group of trees gets empty, then there are no trees near the sheep, make him walk forward. don't need jass, GUI will work. hope that's clear how to do it.
01-24-2005, 12:53 PM#3
ShadowWolf
Quote:
Originally Posted by curi
one way to do it is: pick all trees on the map, (or pick all in some convenient area) anyway then you could pick random trees from the group, check if they are close enough, and send sheep off to eat. if the tree is too far away, remove it from the group and try again. if the group of trees gets empty, then there are no trees near the sheep, make him walk forward. don't need jass, GUI will work. hope that's clear how to do it.

I would have to do a crapload of regions, some for the groups of trees, and even more for where the sheep enter to determine the clump of trees they are to atack. Then triggering each group to attack to that one. I was hoping that someone could do this, the JASS would make it alot easier and faster ^^;;
01-25-2005, 03:26 AM#4
curi
you don't need any regions. ok here is psuedocode, you can put this into GUI in a few minutes i think:

loop for each sheep (pick all units matching condition of being a sheep, then use: unit group do multiple actions for all the units in the group)

set unit_group = units in range 150 of (location of picked unit) matching condition: is a tree

if count of unit_group >= 1 then
issue order to picked unit to eat a random unit in unit_group

else
issue order to picked unit to walk towards wherever it's going

I hope that's clearer.
01-25-2005, 03:15 PM#5
ShadowWolf
I'll try it/play with it and see if it works. Thanks.