Closed arunvickram closed 3 years ago
Not at the moment, but i suppose you could deepCopy
your session right after creating it and use that when you want to restart. Right now the retract
proc requires a specific id + attr.
I just realized, there is in fact a way to clear all facts from the session :D Try this:
for fact in session.queryAll():
session.retract(fact.id, Attr(fact.attr))
Hey sorry, I've been busy with work; I'll try that tonight or tomorrow!
So i tested it in a blank project and it works!
Hi @oakes,
I was wondering if there was a way to clear all facts from the session? IIRC pararules is generally supposed to be the driving force of the engine as it's kind of a replacement for ECS, but I'd like to keep it restricted to the turn based RPG battle mechanics I'm developing, as I'm integrating my Nim code with the Godot engine. I was wondering if there was a way to do something like:
So that the facts don't stay in the session after leaving battle?