ID:149348
 
Is there a way to set a proc that will create a line of text after each command, like instead of me making a proc then putting it in each verb so it will appear after the verb enters, I just make one proc that I don't have to put into any verbs and will automatically appear after a verb is entered. Any help?




Semaj
You mean like the way it appears in classic telnet MUDs?

<code><126/126hp 42/42mp> The giant slug attacks you! <126/126hp 42/42mp> The giant slug hits you for 15 damage! <111/126hp 42/42mp> You swing at the giant slug with your fly swatter. <111/126hp 42/42mp> You miss the giant slug. <111/126hp 42/42mp> You swing again. <111/126hp 42/42mp> You hit the giant slug for 1 damage. <111/126hp 42/42mp> The giant slug attacks you! <111/126hp 42/42mp> The giant slug hits you for 27 damage! <84/126hp 42/42mp> You run away.</code>

The answer is... No! You can't. Well, not with the default verb parser anyway. You can do it if you build your own custom parser, but that's an excessive pain that should be avoided at all causes. Your best hope would be to add a proc at the beginning of every verb that goes something like this:

<code>mob/proc/status() src << "<[health]/[maxhealth]hp [mana]/[maxmana]mp> \..."</code>

Add that to the beginning of each proc, like this:

<code>obj/item/Get() usr.status() if(src.Move(usr)) usr << "You get [src]." oview() << "[usr] gets [src]." usr << "You can't get that!"</code>

In response to Foomer
Thats what I evading.
In response to Semaj
Well, there is no easy way to do it. Depending on how experienced you are with DM, building a parser may or may not be the easier way to go. But if you don't have a lot of experience, a parser can be more pain that it's worth.
In response to Foomer
Well, I have quite a bit of experience with programming in the DM language, but I stopped like 8 months ago and am not used to the newer terms which there are, trust me....
I think I could program a parcer, I'm just gonna have to do some thinking, thanks anyways.



Semaj
In response to Semaj
If you want some examples, maybe you should take a long look at the one I sent you a few months ago :oP
In response to Foomer
Unforutnately FOOM MUNKEY, I lost all my codes older than 40 days, which was all of them. So I can't, I repeat, I can't.




Semaj J Frog