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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
ardwick
Novice


Joined: 31 May 2007
Posts: 32

PostPosted: Fri Nov 30, 2007 5:13 am   

[2.13] Loaded CMUD Beta Today
 
Right off the bat I didn't notice anything. After playing some this evening,
I started noticing things. I tried finding the known issues thread, but no luck.

So, I'll just put what I found here.

Some things aren't quite working the way they used to. Either that or I was
just using the commands wrong in the first place. #abort, #color.
No biggie, just recode a little bit and use a different command and things
are working again.

My main issue however, is #addkey is acting weird. On some things. (Go figure)
I have scripts that save the item stats into variables, then loads those variables
into a db record and pops it out to the database. #addkey puts everything in
order and works perfectly.

I have another database that I use to track kills. I track time of kill,
how many times I've killed, exp/second, etc.
When I have all my variables in place and set up, I go to use #addkey
and it sticks things all over the place in the record. Basically my record
doesn't line up in the order I coded it. There was some funky class
stuff in there but I cleaned that up and it was still happening. Some
other triggers were setting my default class to other classes, but even
so, after I cleaned it up, I can still not get the #addkey to build my
record the way I want it. I even tried deleting the alias used and
coding a new alias and pointed my trigger at that new alias and it
still built it all funky.

I also had a static database record that I put level information into
so I could add up used and unused xp on characters and hit the
table (DB Record) to get their level and how much xp it would
take to reach the next level. Anyway, that database record
is all out of whack too. I wrote a script to rebuild it and it builds
all out of order. Even if I hand type stuff in, after I save it,
it gets unordered. Yet, again, in that same package, I have
scripts that build a db record to load into a mob database
that works just fine.

Again, I kind of paged through the Beta forums to see if anyone
else noticed this, and I couldn't find anything. So, if this is known
please point me towards the entry. And if any further info is needed
I can cut/paste scripts or screen shots if needed.

EDIT: Also, uninstalled and reinstalled fresh instead of upgrade. Same symptoms.
Also noticed that unless I am active in that window, #alarm doesn't work. I set up
an alarm to run combat and if I start combat and switch to my immortal character's
window, it stops running. Not sure if that is how it is supposed to work now or not.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Nov 30, 2007 8:08 am   
 
Couple of things...l what do you mean when you say the database record "doesn't line up in order". To my knowledge the database record doesn't guarantee order (especially since I believe it was changed to use a hash map internally). You can access the properties of a database record with %db.

If I'm completely off-base on what you are trying to accomplish then please post your code and some examples of how it's not working.
_________________
Asati di tempari!
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Fri Nov 30, 2007 10:19 am   
 
Indeed, data record variables are displayed in an arbitrary order, perhaps even a different order every time. But then, the whole purpose of data record variables is that you reference values by their key rather than their position relative to other values, so it's not generally seen as a problem.

If you give us more information about your script, we can hopefully help you remove whatever dependence there is on the order of the hash lookup.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
ardwick
Novice


Joined: 31 May 2007
Posts: 32

PostPosted: Fri Nov 30, 2007 5:05 pm   
 
1st Issue) My Kills tracker Database. When I upgraded and tested my scripts, I noticed that the database was getting
updated all wrong. I eventually discovered the issue with my variable database record being out of order. The records
in that were not lining up with my records in the database when I put new entries in or when I update the database.
Last night, I uninstalled everything and reinstalled a full version of Beta 2.13 and only looked at my variable databse
record which was still out of order. However, after reading your message today, I went into 2.13 and tried my scripts out.
The database was being updated properly despite the order of the variable database record. So, long story short, things
must have been out of whack between the two (database and variable record) on the upgrade, but not on full install.

Issue resolved.

2nd Issue) My level/xp tracker on my immortal. Like I said, this is a static db record. I take my total xp on a mortal
character and loop through the record (saving the level in a variable) until their total xp < saved level experience.
Once I get to that point I display Current level, next level, how much xp they have and how much they need to get
to the next level.

I should be able to fix this as well. On our mud we have levels 1-50, then level 51 is lord, 52 is baron all the way up
to emperor levels (60 through 85). If I leave the actual level value 1-86 and sort it I should be able to get it working.
I can then output to screen through another script to determine the non-numeric level if needed. Perhaps another
db_record or a huge if statemetn.

Issue Resolved.

The only other annoyance is the fact that if I have two characters logged in that my alarms only operate in whatever
window is active.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Nov 30, 2007 5:59 pm   
 
What window is the Alarm generated in? Alarms in CMUD only run within the window that creates the alarm. If you want an alarm to run in more than one window then you need to put the alarm into a shared Module. Then the alarm will execute in all windows.

So, you'll need to show us more details on how you are creating and using your alarms.
Reply with quote
ardwick
Novice


Joined: 31 May 2007
Posts: 32

PostPosted: Fri Nov 30, 2007 6:21 pm   
 
Zugg wrote:
What window is the Alarm generated in? Alarms in CMUD only run within the window that creates the alarm. If you want an alarm to run in more than one window then you need to put the alarm into a shared Module. Then the alarm will execute in all windows.

So, you'll need to show us more details on how you are creating and using your alarms.


Connect to Session: Mortal Character (own package)
Connect to Session: Immortal Character (own package)

In Mortal Window:

At Start of Combat (I turn alarm on, every 4 seconds it evaluates or does the following:)

#variable in_combat {YES} (sets a flag to let other triggers know I'm in combat)
#math hp_tracker @max_hp-@current_hp I have a trigger to capture current and max hp, this calulates the difference
#if (@hp_tracker>900) {get cureall @potion_container;quaff cureall;#math fishermans_curealls @fishermans_curealls-1;#abort} {} If I've lost more than 900 hp, quaff heal potion and quit evaluating (not quite working now)
#if (@max_mana=@current_mana && @touch_on=ON) {touch} {
#if (@victim_status=crippled && @disem_on=YES) {disem} {@punch_or_kick}} If my mana is full and I want to use touch ability, touch target, else, if victim is crippled, use a different skill, or just punch/kick the target

When I started combat in my mortal character's window, in v1.34, the alarm wold just continue running in the mortal characters window while combat was occuring even if I flipped over to my immortal characters window and started doing stuff there.

Now, in v2.13 as soon as I flip over to my immortal character's window, the alarm in the other session stops firing.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Nov 30, 2007 6:51 pm   
 
I think this is the same as the Alarm bug posted in the other thread. Let me know if you think this one is different in some way.
Reply with quote
ardwick
Novice


Joined: 31 May 2007
Posts: 32

PostPosted: Fri Nov 30, 2007 7:00 pm   
 
Zugg wrote:
I think this is the same as the Alarm bug posted in the other thread. Let me know if you think this one is different in some way.


I think it is the same. Unfortunately, I didn't see that thread until after I first mentioned it here.

Those threads never seem to jump out at you until after you mentioned your problem in a brand new thread. Rolling Eyes
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Nov 30, 2007 7:04 pm   
 
About the order of database variables...How were you accessing the database variable? Using #SHOWDB and #LOOPDB, the order is undefined (it is based upon the internal hash table). This is true in most all languages that support database variables (or associative arrays), such as Perl and PHP.

If you want to loop through a database by key creation order, you can use this:
Code:
#loop %numitems(@db) {$key=%item(@db,%i);#show {$key = %db(@db,$key)}}

The %item function returns the "nth key" in a database and does this based upon creation order and not hash order.

If you want to loop through a database by alphabetical key order, you can use this:
Code:
#forall %sort(%dbkeys(@db)) {#show {%i = %db(@db,%i)}}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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