ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Mon Dec 17, 2018 2:37 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Thu Feb 15, 2018 8:46 pm 
Offline
Uruivellas

Joined: Mon Oct 09, 2006 7:47 pm
Posts: 616
On going to the levelup screen or saving, sustained talents are deactivated. Most of the time, it is OK, but if deactivating does an action, it may be a problem. For instance, in one of my talents, deactivating does a phase door. So anytime I go to levelup, the char has moved...
Slightly annoying, but could be potentially abused seriously.
I know this is an old issue, for instance for the celestial/chant tree.

I wonder if there is solution...

If not, I noticed that deactivate has a third optional parameter for particles (I think). Could we have another one or an ingame variable that could be tested to indicate that it is a fake deactivate and to change the behavior of deactivate accordingly?


Top
 Profile  
 
PostPosted: Thu Feb 15, 2018 10:53 pm 
Offline
Perspiring Physicist

Joined: Sun Sep 09, 2012 7:43 am
Posts: 5780
Stick no_sustain_autoreset = true, in the talent definition.

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


Top
 Profile  
 
PostPosted: Thu Feb 15, 2018 11:21 pm 
Offline
Uruivellas

Joined: Mon Oct 09, 2006 7:47 pm
Posts: 616
Thanks.
It works perfectly.


Top
 Profile  
 
PostPosted: Sat Feb 17, 2018 3:39 pm 
Offline
Uruivellas

Joined: Mon Oct 09, 2006 7:47 pm
Posts: 616
Actually, it works perfectly for the levelup screen.
But not for saves... The talent is desactivated (and for that talent, the player is randomly teleported on save most of the times).
Somehow painful.
And abusable

After some search in the source, I tried to add before the teleport stuff in deactivate

if game.saving then return true end

but it does not work.

Isn't it a way to detect if the game is currently performing a save, in order to adapt the behavior of deactivate?


Top
 Profile  
 
PostPosted: Sat Feb 17, 2018 10:42 pm 
Offline
Perspiring Physicist

Joined: Sun Sep 09, 2012 7:43 am
Posts: 5780
Well that is annoying.
I don't know how to solve that.

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


Top
 Profile  
 
PostPosted: Sun Feb 18, 2018 11:05 am 
Offline
Higher

Joined: Sun Dec 10, 2017 12:27 am
Posts: 79
ghostbuster wrote:
But not for saves...

After some search in the source, I tried to add before the teleport stuff in deactivate

if game.saving then return true end


The check you're looking for is
Code:
if self:attr("save_cleanup") then return true end


Top
 Profile  
 
PostPosted: Sun Feb 18, 2018 12:41 pm 
Offline
Uruivellas

Joined: Mon Oct 09, 2006 7:47 pm
Posts: 616
Thanks, it works perfectly.


Top
 Profile  
 
PostPosted: Sun Feb 18, 2018 12:56 pm 
Offline
Higher

Joined: Sun Dec 10, 2017 12:27 am
Posts: 79
No problem; I've been doing a lot of obscure source diving, so at least I get to help someone else out too!


Top
 Profile  
 
PostPosted: Sun Feb 18, 2018 5:16 pm 
Offline
Higher

Joined: Sun Dec 10, 2017 12:27 am
Posts: 79
Oh, one thing to note about this; you might find you get bugs from extra lives if there's any other cleanup that gets skipped as a result of the escape condition.

When an actor dies, all of its sustains are legitimately deactivated, with the save_cleanup flag in place. If there's anything stored outside the talents structure that it ought to be changing on 'real deactivate' you will need to account for this, without teleporting away. As such, you probably want the phase door to be the very last thing called in the deactivate function, immediately preceded by the escape condition for save_cleanup.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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