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?
How to change the behavior of deactivate when 'G' or save?
Moderator: Moderator
-
- Uruivellas
- Posts: 617
- Joined: Mon Oct 09, 2006 7:47 pm
Re: How to change the behavior of deactivate when 'G' or sav
Stick no_sustain_autoreset = true, in the talent definition.
My feedback meter decays into coding. Give me feedback and I make mods.
-
- Uruivellas
- Posts: 617
- Joined: Mon Oct 09, 2006 7:47 pm
Re: How to change the behavior of deactivate when 'G' or sav
Thanks.
It works perfectly.
It works perfectly.
-
- Uruivellas
- Posts: 617
- Joined: Mon Oct 09, 2006 7:47 pm
Re: How to change the behavior of deactivate when 'G' or sav
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?
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?
Re: How to change the behavior of deactivate when 'G' or sav
Well that is annoying.
I don't know how to solve that.
I don't know how to solve that.
My feedback meter decays into coding. Give me feedback and I make mods.
Re: How to change the behavior of deactivate when 'G' or sav
The check you're looking for isghostbuster 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
Code: Select all
if self:attr("save_cleanup") then return true end
-
- Uruivellas
- Posts: 617
- Joined: Mon Oct 09, 2006 7:47 pm
Re: How to change the behavior of deactivate when 'G' or sav
Thanks, it works perfectly.
Re: How to change the behavior of deactivate when 'G' or sav
No problem; I've been doing a lot of obscure source diving, so at least I get to help someone else out too!
Re: How to change the behavior of deactivate when 'G' or sav
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.
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.