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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4772
Location: Pensacola, FL, USA

PostPosted: Sun Apr 19, 2009 5:59 am   

Setting ID's
 
Is there a way for a setting to quickly reference its own ID?

For example, i made a simple push button that i want to display its ID when clicked.

#SAY %id
#SAY %this
#SAY %name

neither of those work.

This functionality could be useful for a number of reasons
_________________
Discord: Shalimarwildcat
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Apr 19, 2009 1:10 pm   
 
IDs aren't supposed to change, so is there a reason you can't hard-code it? You could do this via Lua, but it's a bit of a catch-22 because you need the ID to look up the button object in the first place.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4772
Location: Pensacola, FL, USA

PostPosted: Sun Apr 19, 2009 6:58 pm   
 
I'm not trying to change the ID, i have it hard-coded. i was hoping that there was an equivalent for 'this' in zscript.

I was to referance a dbvar with keys matching setting IDs.
_________________
Discord: Shalimarwildcat
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Apr 19, 2009 9:37 pm   
 
I mean hard-coding the ID into the script. I think having some more information about what you're trying to do would be helpful, but your problem was "I want to make a push-button that displays its own ID" and I was asking why, since the ID of the button shouldn't ever change, you couldn't just write #say whateverYouWroteInTheIDBox in the Script box. That seems to be the easiest way to solve your problem.

So yes, what are you trying to do? Your original post is asking about returning the ID of the setting that's running, which I hope I've made clear is as simple as writing whatever you wrote in the ID box into the script box. Having a list of IDs in a variable and trying to do something (what?) with them is a different problem.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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