ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Wed Sep 19, 2018 10:20 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Partial Turn Actions
PostPosted: Wed Oct 07, 2015 12:24 am 
Offline
Higher

Joined: Wed Jul 22, 2015 8:12 pm
Posts: 56
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.

_________________
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.


Top
 Profile  
 
 Post subject: Re: Partial Turn Actions
PostPosted: Wed Oct 07, 2015 3:28 am 
Offline
Perspiring Physicist

Joined: Sun Sep 09, 2012 7:43 am
Posts: 5752
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.

_________________
My feedback meter decays into coding. Give me feedback and I make mods.


Top
 Profile  
 
 Post subject: Re: Partial Turn Actions
PostPosted: Wed Oct 07, 2015 3:41 pm 
Offline
Uruivellas

Joined: Wed Apr 30, 2008 5:55 pm
Posts: 708
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. :)


Top
 Profile  
 
 Post subject: Re: Partial Turn Actions
PostPosted: Fri Oct 09, 2015 2:22 am 
Offline
Higher

Joined: Wed Jul 22, 2015 8:12 pm
Posts: 56
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: viewtopic.php?f=50&t=45000&p=205957#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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group