Counting allies

M4L4
Script
Script
Posts: 49

Counting allies

Post#1 » 29 Nov 2018, 14:49

pretty technical question, i'll try to be as clear as possible:

I'm making a counter to check differences between points, bots carrying resources, resources left etc.
example:

"set Team counter E to my score"
"increment Team counter E with Allies carrying resources"
"Decrease Team counter E with enemy score"
etc......

since every bot get checked in a precise order every tick (as far as i've understood), they will make the same calculation one by one.
The algorithm starts wit "set" so each bot will overwrite previous bot calculation, till the last one.

What if the last one is the one carrying the resource? will it still add the "allies carrying resource" to the count? does it count itself as an allies carrying resources?
is my understanding of ticks/bots mechanics correct?

User avatar
Hairy Phil
Automaton
Automaton
Posts: 147
Contact:

Re: Counting allies

Post#2 » 29 Nov 2018, 15:31

No, bots don't count themselves as allies. For example, if all 4 of your bots were carrying resources, then allies carrying resources would return 3.

M4L4
Script
Script
Posts: 49

Re: Counting allies

Post#3 » 29 Nov 2018, 16:23

Hairy Phil wrote:No, bots don't count themselves as allies. For example, if all 4 of your bots were carrying resources, then allies carrying resources would return 3.


thanks alot.
so an "if myself carrying res true" >> "increase counter by 1" should do the trick.

edit.
i could also use both "increase with allies carrying" and "increase with myself carrying"
Last edited by M4L4 on 29 Nov 2018, 16:52, edited 1 time in total.

User avatar
Hairy Phil
Automaton
Automaton
Posts: 147
Contact:

Re: Counting allies

Post#4 » 29 Nov 2018, 16:29

Exactly.

Return to “Questions”

Who is online

Users browsing this forum: No registered users and 2 guests