punch |
Problem description:
Command works but not against mobs/players it just prints out
Usage: punch high or low [target]
any ideas D:?
Code:
Problem description: Command works but not against mobs/players it just prints out Usage: punch high or low [target] any ideas D:? | ||
#1 Jun 20 2012, 11:51 am
|
||
You can try something like this:
| ||
#2 Jun 20 2012, 12:03 pm
|
|
i forgot to mention this is for telnet clients not byond.
| |
One thing that immediately stands out to me is that those if() statements are always true. I believe you probably meant if(adverb == "high") and if(adverb == "low").
I don't know Ebonshadow's parser very well, but if its failing to match the argument to the template 'mob in view', I suggest experimenting a little. Try using some of the demo commands he has and see if they work in the game, for example. I can heartily suggest AbyssDragon's Parser, and if you need help with it I should probably still be able to find my way around it. Its a good deal more flexible, if slightly more complicated. If you do decide to give it a try, note that there's a small bug with number-arguments that AbyssDragon never fixed. Let me know if you give it a whirl here, and I'll dig the code and related fix (Its a single line) up for you :) | |
#4 Jun 20 2012, 12:29 pm
|
|
Alright thanks Alathon you're so helpful ill give it a try here in a bit.
| |
#5 Jun 20 2012, 1:59 pm
|
|
Alright so im trying out his but uhm where is the bug located ;o
| |
If I remember right, change line #248 in Parser.dm to be:
| ||
#7 Jun 20 2012, 2:32 pm
|
||
Alright well so far that should be fixed i hope but now its not parsing commands at all T.T
| ||
Gokussj99 wrote:
Alright well so far that should be fixed i hope but now its not parsing commands at all T.T You'll need to be a bit more specific here :) How is it not parsing commands? What commands do you currently have? | ||
#9 Jun 20 2012, 3:11 pm
|
||
straight from his readme to test doesnt work. | ||
This in a project by itself works. Do keep in mind that the 'text' argument in AbyssDragon.Parser must be surrounded by "'s. You probably want: format = "'say'; anything" Anything will basically swallow all text from that token and onwards. | ||
Alathon wrote:
yeah it seems that the client command is working fine but abyssdragons parser isnt parsing anything. hmm | ||
If it doesn't parse anything, there is no command matching the input given. With your Command, try typing: say "Hello"
Typing say Hello won't work, because text arguments expect " to surround the text. The alternative is to do as I mentioned, and use format = "'say'; anything" instead. | |
#13 Jun 21 2012, 8:13 am
|
|
okay i got that to work but um how would i make it so that commands with no text work like "look" because i have to include a space when i try that >.<
or who commands like that lol. | |
Gokussj99 wrote:
okay i got that to work but um how would i make it so that commands with no text or arguments work like "look" because i have to include a space when i try that >.< Not as far as I can tell??
Works just fine without a space. | ||
#15 Jun 21 2012, 8:19 am
|
|
Alright i got it working thanks yeah i think this parser should work a lot better ^_^
Thanks so much for your help. | |
#16 Jun 21 2012, 11:07 am
|
|
http://forbiddenduel.net/progress.html working good ^_^
i just now have to figure out how to add some sort of combat with that lol im new to creating muds T.T | |
Cool! Looking forward to seeing what you end up doing :)
| |
#18 Jun 22 2012, 6:47 am (Edited on Jun 22 2012, 8:58 am)
|
|
EDIT: nevermind i figured it out ^_^
| |
#19 Jun 22 2012, 9:16 am
|
|
Another problem the ignorecase in the parser doesnt seem to be working correctly :/ it is apparently case sensitive and just throws errors if not typed correctly D: hmm!
| |