 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Sun Oct 28, 2007 1:03 am
[2.10] Default variable values not working |
I think we have all had a few odd happening where a variable with a default value just ends up having no value when loaded. This doesn't hurt me too much since most of the variables I have default values set for are meant to be null. One or 2 though are quite a problem. It appears that this problem is caused by some kind of conflict between a database value for the variable and its getting set to the default.
Procedure
1. Launch CMud
2. Close Sessions window (ESC)
3. Open Package Editor (CTRL-G)
4. Select File|New from the PE menu, name the package 'test'
5. Create a variable in your test package
6. Set the name field to 'abc', the value field to 'amazing value', and the default field to '0', click save changes
7. Wait a few moments to let the pkg save like that
8. Set the Use default check box on 'abc' variable to checked, click save changes
9. Close CMud with the big X
10. Take a sip of your favorite beverage
11. Launch CMud
12. Close Sessions window (ESC)
13. Open Package Editor (CTRL-G)
14. Select File|Open from the PE menu, open the package 'test'
15. Click through tabs and whatever else to view the 'abc' variable in the 'test' package
It will show an empty value, this a problem for me when I need something initialized to 0
16. Click on the XML tab for the 'abc' variable
17. Click the Use default box off for the 'abc' variable
18. Click on the text tab for the 'abc' variable
19. Scratch your head in wonder at the appearance of the 'amazing value' |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums
Last edited by Vijilante on Sat Nov 03, 2007 3:34 pm; edited 1 time in total |
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Mon Oct 29, 2007 2:49 am |
Very weird and confirmed. If you click back to the XML it's there as well.
|
|
_________________ Asati di tempari! |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Sat Nov 03, 2007 3:34 pm |
Bump for 2.10, still seeing this one with the original procedure. Step 10 and 19 are not actually required, but they do seem helpful. 
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Nov 03, 2007 5:22 pm |
Still on bug list.
|
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Sun Nov 11, 2007 12:59 am |
Giving this a bump with 2.11. The version history says default values are fixed, but I am still seeing the problem with this same procedure.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sun Nov 11, 2007 5:11 am |
Variables are only initialized to their defaults when they are loaded as the part of your session. Just using the File/Open package in the settings editor loads the package but does not reset the default values. This is on the bug list.
The bug that was fixed in the version history was that previous versions would only initialize the default values when connecting to a session, but not when just opening it offline (and they also got reset on recoonect, which they no longer do) |
|
|
|
 |
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: Mon Nov 12, 2007 8:12 am |
Sorry Zugg, when when I close CMUD and load it back up again, I still have it giving variables that have default values set, a null value. I'm not talking about opening offline or anything - I just mean that I always get a null value, no matter how I open it. Is this a separate bug?
|
|
_________________ Athlon 64 3200+
Win XP Pro x64 |
|
|
 |
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: Mon Nov 12, 2007 8:35 am |
I have just tested this out some more. I connected to the default session for Lusternia (I don't play that mud, but it is one of the ones that ship with the char selection screen by default. The point being that the untitled session would not work for the test since it requires saving settings, but I wanted to make sure I was using blank settings). I created a class called "test". I created two variables, @eqbal and @armb, inside that class. I set their values and default values to eb and lr respectively. I saved, closed CMUD, started up again, connected to lusternia, and found that the correct default values had been set.
I then created a new package called 'bugtest', cut/pasted the 'test' class to this new package, closed CMUD, restarted CMUD, connected to lusternia - and both variables had been given null values. |
|
_________________ Athlon 64 3200+
Win XP Pro x64 |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Nov 12, 2007 5:51 pm |
So are you saying that default values are working in the main session package, but not when additional packages are loaded?
|
|
|
|
 |
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: Mon Nov 12, 2007 7:32 pm |
Yes! (Well put). In retrospect, it would have been a lot easier if I'd just said that.
|
|
_________________ Athlon 64 3200+
Win XP Pro x64 |
|
|
 |
|
|
|