Larian Banner
Previous Thread
Next Thread
Print Thread
DB removal #633128
23/10/17 07:24 PM
23/10/17 07:24 PM
Joined: Jun 2013
Posts: 655
Cromcrom Offline OP
addict
Cromcrom  Offline OP
addict

Joined: Jun 2013
Posts: 655
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
Re: DB removal [Re: Cromcrom] #634158
27/10/17 08:11 PM
27/10/17 08:11 PM
Joined: Mar 2016
Posts: 506
Belgium
T
Tinkerer Offline

addict
Tinkerer  Offline

addict
T

Joined: Mar 2016
Posts: 506
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.
Re: DB removal [Re: Cromcrom] #634168
27/10/17 08:34 PM
27/10/17 08:34 PM
Joined: Jun 2013
Posts: 655
Cromcrom Offline OP
addict
Cromcrom  Offline OP
addict

Joined: Jun 2013
Posts: 655
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
Re: DB removal [Re: Cromcrom] #634171
27/10/17 08:40 PM
27/10/17 08:40 PM
Joined: Mar 2016
Posts: 506
Belgium
T
Tinkerer Offline

addict
Tinkerer  Offline

addict
T

Joined: Mar 2016
Posts: 506
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.

Re: DB removal [Re: Cromcrom] #634194
27/10/17 09:43 PM
27/10/17 09:43 PM
Joined: Jun 2013
Posts: 655
Cromcrom Offline OP
addict
Cromcrom  Offline OP
addict

Joined: Jun 2013
Posts: 655
Ok, that is clear, thanks a lot Tinkerer.


Un chemin de 1000 lieues commence par un premier pas.

Project:
Steam workshop Frontiere

Moderated by  Larian_Koala 

Powered by UBB.threads™ PHP Forum Software 7.6.2