Looking for a snippet for an ooc meter in prompt
< Newer Topic
:: Older Topic >
Pages:<< prev 1 next >>
#1 Jan 5, 2012 4:53 pm
Fledgling
GroupMembers
Posts3
JoinedJan 4, 2012
Hello, I am looking for a snippet for an ooc meter. Would look like [OOC: ||||||]. And every
time you use ooc or osay it goes down like this [OOC: |||---]. Any help is appreciated. Thanks
to Zeno for the help he gave me on Titles.
time you use ooc or osay it goes down like this [OOC: |||---]. Any help is appreciated. Thanks
to Zeno for the help he gave me on Titles.
#2 Jan 5, 2012 6:29 pm
Magician
GroupMembers
Posts189
JoinedSep 5, 2010
Just a thought, but create a meter field for players, then call ch->meter in ooc and osay, and make your adjustments to ch->meter wherever you want it adjusted.
i.e.
I use ooc to talk, it drops it by 1 bar out of the 6, so in the ooc command, have it update ch->meter to decrease by 1 and update the meter accordingly.
Could probably make a simple struct to hold the 6 meter stages and have it associated to a value.
If this isn't what you were looking for, sorry. Best I could think of off the top of my head. There's probably a better way to implement something like that.
i.e.
I use ooc to talk, it drops it by 1 bar out of the 6, so in the ooc command, have it update ch->meter to decrease by 1 and update the meter accordingly.
Could probably make a simple struct to hold the 6 meter stages and have it associated to a value.
If this isn't what you were looking for, sorry. Best I could think of off the top of my head. There's probably a better way to implement something like that.
#3 Jan 5, 2012 6:40 pm
Fledgling
GroupMembers
Posts6
JoinedMay 25, 2009
To the best of my knowledge you won't be able to find a snippet for it but Aurin's suggestion is how you want to do it.
#4 Jan 8, 2012 2:32 am
Last edited Jan 8, 2012 2:33 am by Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009
Just don't forget to replenish their ooc channel uses. Would be pretty upsetting to only get to use that channel 6 times each log in.
And that's assuming you don't save the current value to their player file and reset it to max each time.
And that's assuming you don't save the current value to their player file and reset it to max each time.
#5 Mar 10, 2012 8:04 am
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003
Alternatively, you could create that same field on the character and then an additional one in the command table. You could then define a range, say 1-100 for simplicity. Then set the "weight" certain OOC commands have. That would give more flexibility. The replenishment code could attach nicely into the general update code that also replenishes health and such.
Pages:<< prev 1 next >>