Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#633128 23/10/17 07:24 PM
Joined: Jun 2013
addict
OP Offline
addict
Joined: Jun 2013
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)
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 ?


Un chemin de 1000 lieues commence par un premier pas.

Project:
Steam workshop Frontiere
Cromcrom #634158 27/10/17 08:11 PM
Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
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.
Cromcrom #634168 27/10/17 08:34 PM
Joined: Jun 2013
addict
OP Offline
addict
Joined: Jun 2013
Thanks a lot. So, once I define a DB, I cannot "destroy" it ?


Un chemin de 1000 lieues commence par un premier pas.

Project:
Steam workshop Frontiere
Cromcrom #634171 27/10/17 08:40 PM
Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
Removing all facts from a database effectively destroys it. There is no way you can detect in script that this database ever contained any facts afterwards.

Cromcrom #634194 27/10/17 09:43 PM
Joined: Jun 2013
addict
OP Offline
addict
Joined: Jun 2013
Ok, that is clear, thanks a lot Tinkerer.


Un chemin de 1000 lieues commence par un premier pas.

Project:
Steam workshop Frontiere

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5