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


Joined: 13 Jun 2006
Posts: 8

PostPosted: Fri Jul 21, 2006 2:56 pm   

[1.03] alias targets?
 
so i imported my settings file from zmud...

and all of my aliases that require targets just aren't working...

for instance:
locate aliases "sing 'location'" (its a bard... deal with it)

in zmud i could "locate (item)" and it would actually find the item

in cmud it won't pick up the (item) and use it in the alias?

am i missing someting?
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Jul 21, 2006 8:06 pm   
 
You need to show us the exact Alias definition that you are using for us to help with this. Also, make sure you have read the article linked in the Sticky topics about how to convert zMUD scripts to CMUD.
Reply with quote
RigNFool
Newbie


Joined: 13 Jun 2006
Posts: 8

PostPosted: Sat Jul 22, 2006 5:19 am   i think i got somewhere... but i was wrong
 
ok
so after doing some thumbing thru the forums...

i found i need a $target

so i made the alias read

#alias locate {sing 'location' $target}

and it worked... and i logged off, closed cmud, relogged... and now instead of working, it sends the $target to the mud... instead of the target i typed...

i am confuzed
Reply with quote
Pyron
Beginner


Joined: 11 Mar 2003
Posts: 19
Location: USA

PostPosted: Sat Jul 22, 2006 6:09 am   
 
While we're on this topic, I'm experiencing some wierd things myself with aliases. I loaded up my zmud file, and most of it works... However, some aliases no longer work. Consider the following:

Zmud:
#alias mm {cast plasma blast}
Then in the command line I'd type in something to this effect:
mm monster
And it would essentially 'cast plasma blast monster'

This is not the case in Cmud. When I type in 'mm monster' it sends cast plasma blast to the mud, not cast plasma blast monster. In order for it to work property, I have to:
#alias mm {cast plasma blast %1}

However, sometimes this isn't appropriate. On my mud, if I'm in combat I can just type 'cast plasma blast' and the mud will interpret that as me wanting to cast plasma blast on the monster I'm in combat with. Or, for misc spells like invis I can just 'cast invisibility' and my mud will default to casting invis on myself.

The issue is that Cmud isn't taking into consideration anything you type after your alias for output to the mud unless you specify it as part of the alias. This is different from Zmud. Why? I don't know but I like it the other way :)
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Sat Jul 22, 2006 3:53 pm   
 
I'm fairly certain that CMUD is supposed to have that behaviour so it looks like it's a bug.

For now it is okay for you to put the %1 in because typing mm on it's own means that %1 is null so just 'cast plasma blast' gets sent.
_________________
Taz :)
Reply with quote
Zugg
MASTER


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

PostPosted: Sat Jul 22, 2006 5:36 pm   
 
The need for %1 has been discussed in other topics. Yes, it is a change between CMUD and zMUD, but it is needed for compiled scripts to work properly in CMUD, so the need for %1 isn't going away.

What I *will* fix is to make %1 work and return null if no argument was specified, rather than giving an error.

But back to the original poster: $target would be used to refer to a local variable or alias argument. In other words, the correct alias would be:

#alias locate($target) {sing 'location' $target}

Otherwise, if you don't want to specify it by name, just use %1 as the last poster did:

#alias locate {sing 'location' %1}
Reply with quote
Pyron
Beginner


Joined: 11 Mar 2003
Posts: 19
Location: USA

PostPosted: Sat Jul 22, 2006 6:25 pm   
 
Quote:

The need for %1 has been discussed in other topics. Yes, it is a change between CMUD and zMUD, but it is needed for compiled scripts to work properly in CMUD, so the need for %1 isn't going away.

What I *will* fix is to make %1 work and return null if no argument was specified, rather than giving an error.


Thanks for the clarification. That leads me to my next question... 'mm monster 2'
If I #al mm {cast plasma blast %1} mm monster 2 doesn't work :P

I personally use a lot of aliases in this fashion and typically on multiple targets within a short period of time, ie rw cast reduce weight: rw armour, rw armour 2, rw armour 3... Will %1 be able to take on the rest of the items or should I be using a different syntax, perhaps a (*)?
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Sat Jul 22, 2006 10:30 pm   
 
Zugg: I tested earlier putting in %1 into the alias and not giving the alias an argument and it worked fine, %1 got expanded to null for me and the spell went off fine with no target.

Pyron: Either %0 or %-1, though I'm still a little upset %0 got put back in.
_________________
Taz :)
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