Page 1 of 1

Partial Turn Actions

Posted: Wed Oct 07, 2015 12:24 am
by Charidan
Some talents take less than a full turn of time. Archers, for example, generally end up shooting more than once a turn. Most inscriptions and racial traits take 0% of a turn. How do you tell if using a talent will end your turn or not? Talents (from what I've looked at) don't seem to have a variable in them to indicate time cost.

Currently the player AI will use a talent, but if that talent didn't end its turn then it stops acting until the user manually ends a turn (what I've started calling a "soft hang").

Ideally, I want something to check after I use a talent to confirm whether or not my turn is over. Failing that, a way to see how much time a talent costs so I can manually track the time I have left should be sufficient.

Re: Partial Turn Actions

Posted: Wed Oct 07, 2015 3:28 am
by HousePet
Talents do have variables on them that indicate how turn energy use is calculated. 'no_energy = true' makes a talent instant.
From there you want to determine what speed a talent uses. Talents marked as spells or mind powers are easy. If not its tricky.

Re: Partial Turn Actions

Posted: Wed Oct 07, 2015 3:41 pm
by grayswandir
You might be able to use self:enoughEnergy().

Re: Partial Turn Actions

Posted: Fri Oct 09, 2015 2:22 am
by Charidan
Good call with self:enoughEnergy(). I just call that after I use a talent, and if it gives me a non-zero I run my player_ai_act() function again to take another action. The AI seems downright competent now that it stops hanging every time it uses an infusion. Thanks guys!

I finally pushed out v1.2 now that it's working. I even finally made an official forum thread for it: http://forums.te4.org/viewtopic.php?f=5 ... 57#p205957