From lorph at rootshell.be Fri Jul 4 22:51:11 2003 From: lorph at rootshell.be (lorph@rootshell.be) Date: Fri Jul 4 13:51:08 2003 Subject: [Coldstuff] hello Message-ID: <3f05daaf17aa99.01989595@rootshell.be> Hi I am new to coldc, and I see that it is very similar to lambdamoo. One problem I am having is trying to access object variables using eval. I am using the following code right now: -------------------------------- object $root; var $root name = "Root Class"; public method .gvar() { arg varname; return get_var(tosym(varname)); }; -------------------------------- Unfortunately, it can only access variables that start with var $root Is there a way to access variables in whatever object you want? For example: object $Robert; var $Robert target = "goblin"; how do I find the value of "target" on $Robert Thank you for your time. -- Lorph From roys at mindspring.com Fri Jul 4 17:21:03 2003 From: roys at mindspring.com (Roy Sutton) Date: Fri Jul 4 14:25:02 2003 Subject: [Coldstuff] hello In-Reply-To: <3f05daaf17aa99.01989595@rootshell.be> Message-ID: <5.1.0.14.2.20030704161156.02342520@127.0.0.1> Hello Lorph, The short answer is you can't. The way that Cold variables work they can only be access by methods on the object that defines the variable. In other words, if $Robert is a $User, which defines the variable 'target' then only methods on $User can access target. I refer you to http://ice.cold.org:1180/bin/help?node=$help_coldc_objs_vars for some more information on this. Having said that, the much longer answer is that you /can/ access the variables on any object but you really shouldn't do it that way. Take a look at http://ice.cold.org:1180/bin/help?node=$help_func_data. Roy At 03:51 PM 7/4/2003, Lorph wrote: >Hi I am new to coldc, and I see that it is very similar to lambdamoo. One >problem I am having is trying to access object variables using eval. I am >using the following code right now: > >Is there a way to access variables in whatever object you want? > >For example: > >object $Robert; >var $Robert target = "goblin"; > >how do I find the value of "target" on $Robert >Lorph From bruce at cubik.org Fri Jul 4 15:42:32 2003 From: bruce at cubik.org (Bruce Mitchener) Date: Fri Jul 4 14:40:14 2003 Subject: [Coldstuff] hello In-Reply-To: <3f05daaf17aa99.01989595@rootshell.be> References: <3f05daaf17aa99.01989595@rootshell.be> Message-ID: <3F05E6B8.6060701@cubik.org> lorph@rootshell.be wrote: > Hi I am new to coldc, and I see that it is very similar to lambdamoo. One > problem I am having is trying to access object variables using eval. I am using the following code right now: > > -------------------------------- > object $root; > > var $root name = "Root Class"; > > public method .gvar() { > arg varname; > return get_var(tosym(varname)); > }; > -------------------------------- > > Unfortunately, it can only access variables that start with > > var $root > > Is there a way to access variables in whatever object you want? > > For example: > > object $Robert; > var $Robert target = "goblin"; > > how do I find the value of "target" on $Robert You can do that with eval ... ;as $Robert; target If you had a child of $Robert called $George, and you wanted to access a varaible defined on $Robert: ;as $George<$Robert>; target You can also use @d: @d $Robert, (the comma is important) The +g option can be handy as well: @d $Robert, +g=2 Good luck! - Bruce From brandon at roguetrader.com Wed Jul 9 15:33:49 2003 From: brandon at roguetrader.com (Brandon Gillespie) Date: Wed Jul 9 14:34:07 2003 Subject: [Coldstuff] Re: ColdC extensibility function documentation In-Reply-To: References: Message-ID: <3F0C7C2D.2020408@roguetrader.com> Derrick Coetzee wrote: > Hi, I'm currently attempting to develop a new core on the ColdMUD > engine, and after scratching my head over the on-line language > reference for some time, I realised (as you probably know) that it's > incomplete. Of particular interest to me are the built-in functions > used for run-time code extensibility, such as these (gathered from > opcodes.c): > > add_var > del_var > set_var > get_var > inherited_var > default_var > clear_var > variables > debug_callers > call_trace > list_method > add_method > del_method > method_bytecode > rename_method > method_info > methods > find_method > find_next_method > parents > children > ancestors > has_ancestor > size > create > chparents > destroy > set_objname > del_objname > objname > objnum > lookup > data > > From looking at ColdCore and the Genesis source I get a rough idea > what these do, but is there real documentation for them somewhere? If > not, would you consider accepting contributions of such documentation? > Thanks. The Cold Dark has docs on many of these, they may not have been marked as core, thus their absence from the db.. Of those in the list, all are in the Cold Dark except for inherited_var and default_var. -Brandon From acormany at yahoo.com Tue Jul 15 17:06:28 2003 From: acormany at yahoo.com (Adam Cormany) Date: Tue Jul 15 17:06:07 2003 Subject: [Coldstuff] Weather Message-ID: <20030715230628.30348.qmail@web12803.mail.yahoo.com> Has anyone done anything with weather on their Cold servers? I see $weather and $climate, but I wasn't sure if it's functional. Does anyone have any examples, documentation, anything at all on setting this up? Would it be better for me to write my own weather system and trash the existing $climate/$weather? Any suggestions are welcomed on this. Adam __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From watsojef at ucs.orst.edu Wed Jul 16 09:37:54 2003 From: watsojef at ucs.orst.edu (Jeff Watson) Date: Wed Jul 16 09:39:52 2003 Subject: [Coldstuff] Weather In-Reply-To: <20030715230628.30348.qmail@web12803.mail.yahoo.com> Message-ID: <77D80272-B7A3-11D7-8C45-000393AE8116@ucs.orst.edu> On Tuesday, July 15, 2003, at 04:06 PM, Adam Cormany wrote: > Has anyone done anything with weather on their Cold > servers? I see $weather and $climate, but I wasn't > sure if it's functional. Does anyone have any > examples, documentation, anything at all on setting > this up? Would it be better for me to write my own > weather system and trash the existing > $climate/$weather? Any suggestions are welcomed on > this. I was never able to figure out how to make it work. I wrote my own weather system, but it's horribly convoluted and probably not very useful to anyone but myself. But if you want to see the code, I'm happy to share. Drop me a private e-mail if you like. Jeff *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-* Jeff Watson, Ph.D. Department of Biochemistry and Biophysics Oregon State University ALS 2011 Corvallis, OR 97330 Lab: (541) 737-1870 Office: (541) 737-8018 Fax: (541) 737-0481 watsojef@ucs.orst.edu "Every 10 minutes I'm not at the ballpark means 10 minutes doing something I don't enjoy nearly as much. Frankly, a ballpark is about the only place in the world where I feel completely at peace with myself, so I ain't in no hurry to leave." -- Rob Neyer *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-* From msmouse at kittymail.com Mon Jul 28 09:39:04 2003 From: msmouse at kittymail.com (K Anderson) Date: Mon Jul 28 10:38:33 2003 Subject: [Coldstuff] Weather Message-ID: <20030728163904.4240.qmail@kittymail.com> ----- Original Message ----- From: Adam Cormany Date: Tue, 15 Jul 2003 16:06:28 -0700 (PDT) To: Cold Subject: [Coldstuff] Weather > Has anyone done anything with weather on their Cold > servers? I see $weather and $climate, but I wasn't > sure if it's functional. Does anyone have any > examples, documentation, anything at all on setting > this up? Would it be better for me to write my own > weather system and trash the existing > $climate/$weather? Any suggestions are welcomed on > this. > > Adam Hey there Adam, Check the archives for $weather and $climate. When I couldn't figure out how to get it to work I finally did some serious digging around in the $weather and $climate objects as well as the message passing system and a couple of other things. Check out the helps for both those objects, I know not much help there, then check out @help propagation. Things to do: 1) Create and setup a $climate object 2) Create and setup a $weather object 3) @set room's propagate. Now there's more to it than this, but I can't seem to remember what it was. Somewhere else there is another propagate (or something like it) and if a location's propagate is less or equal than this other propagate then things get reported to the user that there was a weather/climate change for the realm. If you don't want any weather/climate changes reported to the user then don't worry about this. 4) Weather/climate commenting in descriptions or maybe even a +weather command are gotton from CML (@help cml) and if I recall correctly weather/climate is gotten from a generator (@help generators). At this time I do not recall the exact names of the generators but my guess is that if you dump the $weather/$climate objects or even the $place object you can determine the variables. After doing @help generators there is a blurb near the end about var; that might clue you in to what is available. 5) @set the world's heartbeat-rate and weather-rate (@set $world: to display such things). For the purpose of testing everything out I set them pretty low. Also, I put in a temporary hack in, I think, $realm.advance_weather that would let me know if weather advanced or not. Here's what I have going. When the weather/climate changes it announces to the realm that said event happened. Warning, the world/realm world-time is somewhat hard coded so all things have to work off that one setting. If you muck around in the code enough you'll eventually find the spot that actually handles that. It is hinted that you can set something to make it so $realms can have different times (in the case of hemispheres or timezones) but that seemed a little twitchy to me but by all means play with it and see if you can get it to do what you want. Most of the things I learned about the weather/climate was through digging around in the core and putting in debugging messages all over the place until it was all narrowed down to a few things. I hope this helps you in some way. -- _______________________________________________ Get your free email from http://www.kittymail.com Powered by Outblaze