View Single Post
Old 11-21-2021, 09:56 AM   #1
lomkiri
Groupie
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
Posts: 168
Karma: 1497966
Join Date: Jul 2021
Device: N/A
[Plugin] How to delete a checkpoint?

Hi,

In a plugin, is there any way to delete a checkpoint by it's name, without action on the container?
I would like to do something like this:
Code:
for i, some_action in enumerate(actions):
	point_name = 'partial checkpoint n. {}'.format(i)
	self.boss.add_savepoint(point_name)
	some_action()	# user get a win-diff and may rewind_savepoint() or not

        # if still existing, just delete our CP with no rewind action,
        # as it's not needeed anymore:
	self.boss.delete_savepoint(point_name)
I ask this because the for loop may create a lot of actions (maybe more than 100, in some circumstances), and I don't want to have the risk to reach MAX_SAVEPOINTS (100, from what I've seen ?).

By the way, is the creation of checkpoints a memory consuming process? Does it have much impact on the performances ?

Thank you.

Last edited by lomkiri; 11-21-2021 at 10:00 AM.
lomkiri is offline   Reply With Quote