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
manbat
Novice


Joined: 21 Mar 2009
Posts: 35

PostPosted: Tue Oct 20, 2009 1:51 pm   

[3.10a] Walk bug?
 
#VAR test "111 temple"
#WALK @test

Doesn't work... yet

#WALK 111 temple

does work...


On another note... my map was upgraded from when it was made in 2.37, and now instead of going "nw" it's trying to go "h" when autowalking.... I use slow walking if that helps... Can't figure that one out..
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Oct 20, 2009 4:31 pm   
 
You can't just put two arguments into @test and then try to use #WALK with it. #WALK takes two arguments: The room name/number and the zone name/number. There isn't any way to store these into a single variable like this without more work.

Here is a procedure that would work if you absolutely must store the zone name along with the room number using string lists:
Code:
#VAR test "111|temple"
#WALK %item(@test,1) %item(@test,2)
Reply with quote
manbat
Novice


Joined: 21 Mar 2009
Posts: 35

PostPosted: Tue Oct 20, 2009 5:23 pm   
 
Ahh... My bad.. I figured #WALK would expand the variable and take the arguments from that....
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Oct 20, 2009 5:36 pm   
 
Nope. zMUD did "early expansion" sometimes with the %1..%99 variables. But CMUD was changed to work more like a normal programming language. For example, in *any* normal programming language, if you have a function that takes two arguments, like:
Code:
function myFunc(a,b)

there is no way to call this with a single variable. For example, there is no way to do this:
Code:
a = "1,2"
print myFunc(a)

No programming language will ever expand the comma within the "a" variable and treat it as two separate arguments. The fact that zMUD allowed this in some situations made zMUD a very weird language and caused lots of problems for people who had any programming background.

Since CMUD/zMUD is the first experience that some people have with programming, it was important in the CMUD design to make it work more like other languages so you could take the knowledge you gained with CMUD and apply it to other programming jobs in the future.
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