Originally Posted by Cromcrom
How do I remove part of a DB, or a complete DB ?

In this example:
Code
IF
ObjectFlagSet("restabortedfrommovement",_Player,_)
AND
DB_restingStatusDuration(_ShittyNight,_duration)
AND
DB_RestingPosition((CHARACTERGUID)_Player,_X,_Y,_Z)
AND
DB_restingremaining(_Player,(INTEGER)_RestingDuration)
THEN
ObjectClearFlag(_Player,"isResting");
//ObjectSetFlag(_Player,"resetTiredness"); //attention, doit absolument venir avant application de shitty night
ApplyStatus(_Player,"SHITTYNIGHT",_duration);
DisplayText(_Player,"You wake up to soon in a bad mood");
ProcObjectTimerCancel(_Player,"restIteration");
NOT DB_RestingPosition(_Player,_X,_Y,_Z);
NOT DB_restingremaining(_Player,_RestingDuration);

It seems I need to call the 2 DBs, so that I can remove them (using NOT)

Nitpick: you cannot "call" DBs. You can either define/add (facts to) them, or undefine/delete (facts from) them. Or, as part of a condition, you can match them.

Quote

However, is there a way to entirely remove a DB ?
What would
1/NOT DB_RestingPosition(_Player);
2/NOT DB_RestingPosition(_Player,1,1,1);
3/NOT DB_RestingPosition(1);
4/NOT DB_RestingPosition();
5/DB_RestingPosition();

do ?

They would all try to undefine the facts from those databases with those specific values. If these don't exist, nothing will happen.

You can probably use https://docs.larian.game/Osiris/API/SysClear (which I just documented)

Last edited by Tinkerer; 27/10/17 08:11 PM.