Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Wed May 07, 2008 8:04 pm   

no space!?!?!?
 
When this fires....

Code:
k %arrget( mob_list, @arrnext)~.%item( @key_list, %eval( @arrnext + 1))


This gets sent to the mud (assuming @arrnext = 1 and @key_list = spirit): k1.spirit when from what I think it should be sending is k 1.spirit. I've tried putting quotes around %arrget to the very end of the line, but that still sends everything smooshed together. I've also put quotes around the whole line.... =**[ (I even tried putting another space after the k.....)

Thanks again for all your guy's help! Making cmud SOOO much more appealing! =D And I apologize for my newbish questions.... -.-
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Wed May 07, 2008 8:08 pm   
 
Ok... My bad. That line DOES work, when I enter that in directly. But its part of an alias... Here's the alias:

Code:
#alias {kill} {#if (@bkill) {#variable bcombat 1;#if (@end_cur > @end_min) {@attack %arrget(mob_list, @arrnext)~.%item( @key_list, %eval( @arrnext + 1))} {k %arrget( mob_list, @arrnext)~.%item( @key_list, %eval( @arrnext + 1))}}}


When the alias 'kill' gets sent, its sending k1.spirit....
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Wed May 07, 2008 8:40 pm   
 
Firstly you should really look into using STRING LIST VARIABLES instead of arrays. But that has nothing to do with your current problem.

#send {%concat("k ",%arrget( mob_list, @arrnext)," .",%item( @key_list, %eval( @arrnext + 1)))}

That is unless k is an alias. In that case you may want to do this.

k %concat(%arrget( mob_list, @arrnext)," .",%item( @key_list, %eval( @arrnext + 1)))


CMUD is sometimes picky about implicit concatenation and wants you to explicitly tell it when something should be treated as a string literal.
When you put something into concat, you know the results will be returned, and treated as a string. Cool
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed May 07, 2008 8:51 pm   
 
That's not actually the issue here, though. The problem is this:

#if (@end_cur > @end_min) {@attack %arrget(mob_list, @arrnext)~.%item( @key_list, %eval( @arrnext + 1))}

See this help file.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Wed May 07, 2008 9:21 pm   
 
Hmmm... I'l hafta look into this "string list variable"... I'm not what you call a smart man. (LOVE that forest gump! LoL!) But... For the time being, I'd like to get this working, and then I'll make it more efficient. =]

AWESOME!

Code:
#if (@bkill) {#variable bcombat 1;#if (@end_cur > @end_min) {#exec {@attack %arrget(mob_list, @arrnext)~.%item( @key_list, %eval( @arrnext + 1))}} {k %concat(%arrget( mob_list, @arrnext),".",%item( @key_list, %eval( @arrnext + 1)))}}


works....
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed May 07, 2008 10:38 pm   
 
You might find that #send or #sendraw is better for some applications, though - in this case, I expect that @attack will be the name of an alias, so they won't help.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Wed May 07, 2008 11:40 pm   
 
well... @attack is the type of attack that is set with a different alias. just used to change up how i initiate battle depending on the area i'm at.

i've actually been looking at how i can remove the array's into the string's... but... i don't know if i'm quite to that level yet. easy to do? some good reading links on zuggsoft? i've tried searching, but i just come up with results on what the different type of variables there are, and not really some good examples on how to implement it. *shrug*

thanks for ya'lls help by the way! =D
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu May 08, 2008 1:51 am   
 
If you've mastered arrays, stringlists are a complete piece of cake. Based on the level of difference in development between the two features, stringlists are probably 10x easier to use. ZMud let us do some really amazing things with stringlists that even Zugg didn't even consider, but CMud shook that up a bit.
_________________
EDIT: I didn't like my old signature
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu May 08, 2008 9:14 am   
 
This is probably a good start.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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