all doods to yer own targets
Moderator: Moderators
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:
all doods to yer own targets
Ok so like I give several doods the same targetname but each one of them has his own target node. Can I command them all to go to they individual targets? With one line eg.....
$doods runto local node
Somthing like that.
$doods runto local node
Somthing like that.
How does a dood 'know' which targetnode is his? If you store that targetnode in $doods.targetnode, you could do:
Possibly your code would work too, but I would recommend against it since it doesn't lead to a better understanding of targetname arrays.
Code: Select all
for(local.i = 1; local.i <= $doods.size; local.i++)
{
$doods[local.i] runto $doods[local.i].targetnode
}
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:
group1
Can't you give them #group and #set numbers? It's been a while for me, but I remember something about using those for patrol members.
-
vonderbakluft
- Corporal
- Posts: 46
- Joined: Fri Aug 01, 2003 11:15 am
- Location: NL
- Contact:
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
have on the pathnode
key: targetname
value: pathnode
key: #dood_number
value: 1
then value: 2, etc...
key: #node_number
value: 1
(number 1 as his 1st destination, then 2 accordingly)
then on the ai have
key: targetname
value: doods
key: pathnode_group
value: 1
and 2, 3 etc... again as needed
player_start:
for (local.i=1;local.i<=$doods.size;local.i++)
{
$doods thread run_run_run
}
end
run_run_run:
self.destinations = 0
for (local.i=1;local.i<=$pathnode.size;local.i++)
{
if ($pathnode[local.i].dood_number == self.pathnode_group)
{
self.destination[local.i] = $pathnode[local.i].node_number
self.destinations++
}
}
for (local.i=1;local.i<=self.destinations;local.i++)
{
self runto self.destination[local.i]
self waittill movedone
}
end
should work for many ai wih many paths...
A->A1->A2->A3
B->B1->B2,
you may need to put in
if !(isalive self)
{
end
}
key: targetname
value: pathnode
key: #dood_number
value: 1
then value: 2, etc...
key: #node_number
value: 1
(number 1 as his 1st destination, then 2 accordingly)
then on the ai have
key: targetname
value: doods
key: pathnode_group
value: 1
and 2, 3 etc... again as needed
player_start:
for (local.i=1;local.i<=$doods.size;local.i++)
{
$doods thread run_run_run
}
end
run_run_run:
self.destinations = 0
for (local.i=1;local.i<=$pathnode.size;local.i++)
{
if ($pathnode[local.i].dood_number == self.pathnode_group)
{
self.destination[local.i] = $pathnode[local.i].node_number
self.destinations++
}
}
for (local.i=1;local.i<=self.destinations;local.i++)
{
self runto self.destination[local.i]
self waittill movedone
}
end
should work for many ai wih many paths...
A->A1->A2->A3
B->B1->B2,
you may need to put in
if !(isalive self)
{
end
}
hope this helps, prob not cos it's all foreign 2 me :-/
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:
Sadly nuggets is not right
(the code is almost good though)
As he posted it the AIs would try to run to an integer
which obviously wouldn't work.
self.destination[local.i] = $pathnode[local.i].node_number
(...)
self runto self.destination[local.i]
In fact, this line:
self.destination[local.i] = $pathnode[local.i].node_number
should be changed to:
self.destination[($pathnode[local.i].node_number)] = $pathnode[local.i]
Make sure not to skip #node_number values though (i.e. don't go from #3 to #5).
As he posted it the AIs would try to run to an integer
self.destination[local.i] = $pathnode[local.i].node_number
(...)
self runto self.destination[local.i]
In fact, this line:
self.destination[local.i] = $pathnode[local.i].node_number
should be changed to:
self.destination[($pathnode[local.i].node_number)] = $pathnode[local.i]
Make sure not to skip #node_number values though (i.e. don't go from #3 to #5).
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:
Well sorry to be the boy who cried wolf but I think I will go for the more labor intensive but simpler route of telling each dood what he should do instead of making arrays. You explaned it quite well but it would take me quite a while to do it because I will surely get it wrong along the way.
Btw I am making a copy paste kind of tutorial (color coded nodes and all) for doing bots in a map, should come out soon after gen cobras stalingrad with bots.
Btw I am making a copy paste kind of tutorial (color coded nodes and all) for doing bots in a map, should come out soon after gen cobras stalingrad with bots.


