Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#647673 30/07/18 08:27 AM
Joined: Feb 2018
D
apprentice
OP Offline
apprentice
D
Joined: Feb 2018
We had a little chat over on the discord server in the scripting channel yesterday as we've discovered a dot syntax in the Osiris script language. In the shared mod helper, several examples like this can be found:

Code
PROC
ProcFreezePlayers()
AND
_Player.DB_IsPlayer()
THEN
CharacterFreeze(_Player);


Note the first condition _Player.DB_IsPlayer() which uses a dot syntax like in an object oriented language. Well, this code style is not used very often in the shared mod helpers and it is not mentioned in the Osiris documentation. After some research we found out that this syntax seems to be enabled for pretty much all calls and queries, e.g. the following line compiles just fine:

Code
_Character.ApplyStatus("KNOCKED_DOWN", -1.0, 1);


So, as it is not written down nowhere... we have questions wink

Could someone enlighten us as why this syntax variant is there and what it exactly does? Does it behave different than the function style syntax? Is it a deprecated syntax or is Larian teaming up to rewrite everything using this syntax? So many questions!

Last edited by DerCapac; 30/07/18 08:28 AM.
Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
It was added a long time ago (I think during DOS1 or DOS1:EE times), indeed to make Osiris more OOP-like. That's also why some Osiris error messages talk about "the this object" when it's about parameter 1. It behaves exactly the same as when you pass that object as the first parameter.

That said, it did not really catch on inside Larian and we don't use it (any more). I'm not aware of any plans to remove it right now.

Joined: Feb 2018
D
apprentice
OP Offline
apprentice
D
Joined: Feb 2018
Great, thanks for the insights!


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