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
UberChewbacca
Newbie


Joined: 27 Dec 2008
Posts: 1
Location: Washington

PostPosted: Sat Dec 27, 2008 2:02 am   

(In)Accuracy Database
 
I'm trying to make a database that records my accuracy with different attacks, against different targets.

Basically I would make triggers for the different attacks' hit/miss messages, then (and this is where I'm struggling) it would have to add 1 to the appropriate column (hit or miss) next to the name of the target (I have a variable called 'target' it could check for that), then add both hits and misses together into another variable, and finally for percentages, multiply the hits by 100, and divide it by the total.

I don't know how complicated this would actually be, but it's my first database, so that's probably why it's become so frustrating.

This is a little diagram to help me explain: (sorry if the format's ugly)

Name Attack1(hit)---Attack1(miss)---Attack1(total)---Attack1(%)---Attack2(hit)---Attack2(miss)---Attack2(total)---Attack2(%)
goblin---40--------------25---------------65-----------------62---------------10--------------15------------------25-----------------40
kobold--20--------------30---------------50-----------------40---------------65--------------30------------------95-----------------68

Any help you can give would be appreciated.
Thanks in advance.

Edit: Sorry about the double topic meant to just fix up my little diagram Embarassed
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Tue Dec 30, 2008 3:30 am   
 
Here is how I would do it:

Each mob has its OWN data record variable.

goblin and kobold using your example above.

With members of the ATTACK name...

Example:
goblin.kick
goblin.headbutt
kobold.kick
kobold.headbutt

to USE these you would do:
#ADD %concat(@mobname,".",@attackname) 1
Where @mobname and @attackname are the current mob and attack you're gathering data on. This way you can just change the var contents when you change mobs/attacks.

A full blown database for something this simple would probably be overkill, which is why I'd use this method.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Tue Dec 30, 2008 3:57 am   
 
Oh yeah, and you can make a nice little Table display alias for this too ;)

Make a MASTER mob variable that is a list of all mobs you've made a data record for (by the mobname you used as your data record)
#VAR MobTable "goblin|kobold"

Now make the alias...
Code:
#ALIAS strikedata {
   #ECHO {%format("&30s","------------------------------")}
   #ECHO {%format("&10s &10s","Kick","Headbutt")}
   #FORALL @MobTable {
      #ECHO {%format("&10s &10.0n &10.0n",%i,@{%concat(%i,".kick")},@{%concat(%i,".headbutt")})
      }
   #ECHO {%format("&30s","------------------------------")}
   }


Which will give you a nice formatted output. Now, I've made this in a way that only has one tracking for EACH type. Because this is simple. You don't NEED to track misses. If you do a standard number of repeats of each attack (say 10 of each) on each mob, then you'll know 10 less the hits, is your misses. And you'll also know an approximate % of success. 7/10 would be 70% accurate.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
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