Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Serentus
Apprentice


Joined: 28 Sep 2001
Posts: 103
Location: USA

PostPosted: Fri Feb 27, 2004 7:19 am   

Default Values for DataRecord variables
 
I'm wanting to keep my defenses in Data Record type variable like this.

@Insomnia.State
@Insomnia.Desire
@Insomnia.AnotherRecord
@Insomnia.StillAnother
etc.

How can I enter a default value for these. I need to have .State and .Desire set to 0 when ever I startup.

I tried putting State=0|Desire=0 and some variations of that but that didn't seem to work.
Reply with quote
Timas
Novice


Joined: 05 Jan 2003
Posts: 39
Location: Netherlands

PostPosted: Fri Feb 27, 2004 12:37 pm   
 
I've noticed that you need to do "#VAR yourVar.dataField value" if you want to set those fields. So, instead of "@status = A" do "#VAR status A".

After that its ABC, put the two lines below in your atconnect alias and your set.

#VAR Insomnia.state 0
#VAR Insomnia.desire 0
Reply with quote
Serentus
Apprentice


Joined: 28 Sep 2001
Posts: 103
Location: USA

PostPosted: Fri Feb 27, 2004 1:09 pm   
 
Thanks for input, but doing the

#VAR Insomnia.state 0
#VAR Insomnia.desire 0

in an alias called by atconnect is what i'm doing now. It's cubersome because there are 8 fields in each variable and 30+ variables. Plus using the Atconnect dosen't run automaticly when i'm working offline.

I was looking for a way to set up default values like you can for normal variables, by filling in the "Default:" Edit box.
Reply with quote
Timas
Novice


Joined: 05 Jan 2003
Posts: 39
Location: Netherlands

PostPosted: Fri Feb 27, 2004 3:09 pm   
 
I think the default setting is for single string variables.. maybe there is an option but I don't know about it, sorry :)
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Feb 27, 2004 4:33 pm   
 
Atconnect can be called just like a regular alias if thats any help at all :P
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Mar 04, 2004 9:48 pm   
 
Create the variable with the desired default values. Then use the following command, at the command line, to insert those values to the Default field.
#VAR Insomnia {@Insomnia} {@Insomnia}
Reply with quote
Serentus
Apprentice


Joined: 28 Sep 2001
Posts: 103
Location: USA

PostPosted: Fri Mar 05, 2004 1:05 pm   
 
Thanks Lightbulb! That did the trick.

I was hoping someone would know, and i figured if anyone did, you would. I have seen you use alot of record variables in your posts. That's acually what gave me the idea for using them. Wink And they work great.

Edit:Typos
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net