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.
Partial Turn Actions
Moderator: Moderator
Partial Turn Actions
Currently developing the Player AI addon. You can get it from the T-Engine Addon Hub or Steam
You can also view the source code.
You can also view the source code.
Re: Partial Turn Actions
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.
From there you want to determine what speed a talent uses. Talents marked as spells or mind powers are easy. If not its tricky.
My feedback meter decays into coding. Give me feedback and I make mods.
-
- Uruivellas
- Posts: 708
- Joined: Wed Apr 30, 2008 5:55 pm
Re: Partial Turn Actions
You might be able to use self:enoughEnergy().
Addons: Arcane Blade Tweaks, Fallen Race, Monk Class, Weapons Pack
Currently working on Elementals. It's a big project, so any help would be appreciated.
Currently working on Elementals. It's a big project, so any help would be appreciated.

Re: Partial Turn Actions
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
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
Currently developing the Player AI addon. You can get it from the T-Engine Addon Hub or Steam
You can also view the source code.
You can also view the source code.