Loop?

Dbroadwell
Hello World
Hello World
Posts: 4

Loop?

Post#1 » 29 Nov 2016, 05:14

I'm a robot programmer ... I find no loop structures limiting. For example, on the training teamplay map, I want to chase down the guy with the resource;

Currently, it is move a step towards out of range target, target, enemy is now out of range, repeat not firing and moving a step till he gets where he is going.

If enemy has res at long range -> approach enemy with res till short range. I really want the subtree diamond to be the flowchart yes continue, no loop item.

I need to see how to implement such a thing in the trees.

A variable could fix this.

MGBlitz81
Automaton
Automaton
Posts: 135

Re: Loop?

Post#2 » 29 Nov 2016, 06:21

you need to adjust the use of your filters.

in both examples above just do this...

IF enemy carries resource with filters medium, long, and out of range checked...
THEN move toward closest enemy carries resource

to the LEFT of these two nodes so that the program will activate it first if it applies do...

Attack closest enemy carries resource with the short range filter checked.

Dbroadwell
Hello World
Hello World
Posts: 4

Re: Loop?

Post#3 » 29 Nov 2016, 20:11

I actually want to also attack at medium range so the bot does not 'waffle' staying at the end of the range circle and never getting to fire.

MGBlitz81
Automaton
Automaton
Posts: 135

Re: Loop?

Post#4 » 30 Nov 2016, 01:01

Add to the left of the first set of nodes...

IF enemy currently targeted exists with filters short, medium checked

THEN attack currently targeted enemy with filters shield 0% through 75% checked.

It's a work around to get the results you are looking for. The shield filters are added so that if the enemy is in medium range but has a full shield, you will continue to move towards the enemy until he is in short range. Once you damage him at short range, you will continue to damage him as he moves to middle range.

Dbroadwell
Hello World
Hello World
Posts: 4

Re: Loop?

Post#5 » 30 Nov 2016, 06:31

I'll have to see how that goes, looks like if you do less than 25% in one attack, it goes back to walking, and enemy can recover. My problem was, it would never attack. So ... better.

If I had a 'self' 'moving' filter, I could make it manage the fact that I want two different behaviors out of enemy with res at medium range.

If enemy with res at long range, move towards.

If enemy with res short range, attack.

If enemy with res at medium range AND (self, moving, move towards enemy) OR (self, not moving, attack enemy).

... I do this kind of thing with servo motions for articulated arms to blend moves. So, can do it in tree without loops ... with a 'moving' condition or filter.

Return to “General Discussions”

Who is online

Users browsing this forum: No registered users and 23 guests