A few questions about SDL vars

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

A few questions about SDL vars

Postby Sirius » Sat Jan 14, 2012 6:20 am

Hi, I've got a few questions about SDLs (I'm trying with Christopher to supplement some of the Training Wall Python functions missing in MOULa's API. I first tried with Python notifications but it didn't work correctly).

I have a SDL var of this kind:
Code: Select all
VAR BYTE   blahblahblah[20]   DEFAULT=-1

1. Can a BYTE variable have a negative value ?
2. if the default value for this variable is -1, will all 20 "sub-variables" in it be defaulted to -1 ?
3. this variable has no DEFAULTOPTION, which means (I assume) it will be set to -1 on each Age reload as it isn't saved in the vault.
Let's say someone is already in the Age, and he set this var to another value.
A new player links in, and accesses this SDL var. Will its value be the default one or the modified one ?

Thanks.
User avatar
Sirius
 
Posts: 1506
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: A few questions about SDL vars

Postby diafero » Sat Jan 14, 2012 7:47 am

1. Can a BYTE variable have a negative value ?

I would expect it to overflow, so -1 is the same as 255.

2. if the default value for this variable is -1, will all 20 "sub-variables" in it be defaulted to -1 ?
yes

3. this variable has no DEFAULTOPTION, which means (I assume) it will be set to -1 on each Age reload as it isn't saved in the vault.
No, DEFAULTOPTION and DISPLAYOPTION have no effect on the vault storage, as far as I know. Actually I have no clue which effect these flags have at all. Alcugs ignores them, that's working fine :D
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: A few questions about SDL vars

Postby D'Lanor » Sat Jan 14, 2012 8:10 am

An INT can have a default value of -1. Why don't you use that?

SDL variables btw are usually not saved in the age vault but in the age SDL state. It is possible to save them in the age vault but that is exception rather than rule.

DEFAULTOPTION=VAULT is traditionally used for SDL variables that must conform to global SDL values as set within the vault of a shard. For all I know it could be redundant, because I have seen SDL variables without that option conform to global SDL changes just as easily. Cyan however still used DEFAULTOPTION=VAULT in MOULa for sparklies and other reward stuff that they wanted to control through their VaultManager.

Edit: Of DISPLAYOPTION=hidden I know that it hides SDL variables from Cyan's VaultManager. Of course people who build their own vault management tools are free to ignore this. ;)
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: A few questions about SDL vars

Postby Sirius » Sat Jan 14, 2012 12:30 pm

Ok, thanks for the answers.

I was using BYTE because I was re-using a variable that was later deleted from the SDL file (I found some in the early versions of Gahreesen SDL). After a quick search in the forum, I saw INT was used for 32 bits numbers (up to roughly 4 000 000 000), and I don't need that much. BYTE would be fine, but I don't know if it can have a negative value.

I don't really know how these SDLs are stored, but I wanted them to be resetted when no one is in the Age. I'll do it manually in my script then.
User avatar
Sirius
 
Posts: 1506
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: A few questions about SDL vars

Postby diafero » Sun Jan 15, 2012 10:22 am

I don't really know how these SDLs are stored,
You don't want to know the glory details, it's horrible^^

Just make sure to always use the PtGetAgeSDL() to access the age SDL state, and not go through the vault - the SDL of the actual age is stored twice, and both are supposed to stay in sync, but Alcugs (and Dirtsand) don't always do that.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: A few questions about SDL vars

Postby Branan » Mon Jan 16, 2012 2:49 pm

DEFAULTOPTION=Vault means "Use the value from the vault, unless that value is at default". If that option is not set, it will use whichever of the gameserver/vault values is newest.
Image
Your friendly neighborhood shard admin
User avatar
Branan
Gehn Shard Admin
 
Posts: 694
Joined: Fri Nov 16, 2007 9:45 pm
Location: Portland, OR

Re: A few questions about SDL vars

Postby diafero » Tue Jan 17, 2012 1:01 pm

So if a DEFAULTOPTION=Vault variable is changed in the vault, there is no way to override it locally in an age, even by changing it *after* the global change?
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: A few questions about SDL vars

Postby D'Lanor » Tue Jan 17, 2012 4:21 pm

diafero wrote:So if a DEFAULTOPTION=Vault variable is changed in the vault, there is no way to override it locally in an age, even by changing it *after* the global change?

In my experience it can be changed in age just like any SDL variable. My experience with this dates from UU though.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: A few questions about SDL vars

Postby Branan » Tue Jan 17, 2012 4:50 pm

diafero wrote:So if a DEFAULTOPTION=Vault variable is changed in the vault, there is no way to override it locally in an age, even by changing it *after* the global change?


I'm not sure. I've never tried to change a DEFAULTOPTION=Vault variable on the gameserver, just in the age instance vault.
Image
Your friendly neighborhood shard admin
User avatar
Branan
Gehn Shard Admin
 
Posts: 694
Joined: Fri Nov 16, 2007 9:45 pm
Location: Portland, OR

Re: A few questions about SDL vars

Postby Sirius » Wed Jan 18, 2012 5:33 am

Ok, this SDL thing looks crazy. I guess I better reset the SDLs each time I link-in and there's no one in the Age.

Anyway, good news: using SDLs for the Wall is really hard to code, and I found out parts of the current script (on DI I mean) might not be synchronising properly the clients (+ some functions are called twice, or not at all...). Which means I'm wondering whether I should rewrite it from scratch :twisted: :twisted: . I'll see about that.
User avatar
Sirius
 
Posts: 1506
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Next

Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests

cron