TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

question about map

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
dawang10



Joined: 14 Feb 2015
Posts: 66

PostPosted: Tue Jan 24, 2017 8:39 am    Post subject: question about map Reply with quote

generally, a room has other information than name, like npc,
How do I store these information with the room.
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Tue Jan 24, 2017 4:22 pm    Post subject: Reply with quote

You could use as you want the "roomnote" or "roomdata" attributes

Code:

#map set {roomdata} {some mobs}
#map set {roomnote} {some other descriptions}

#map get {roomdata} {myvar}

#echo {$myvar}
some mobs


using "#map info" you can see all the attributes of a room
Back to top
View user's profile Send private message
dawang10



Joined: 14 Feb 2015
Posts: 66

PostPosted: Tue Jan 24, 2017 4:36 pm    Post subject: Reply with quote

Thanks,

But there are a number of mobs, and I'd like to store all their names
How can I store all of them in one roomdata?
e.g.

#ac { %1(%2)} {#map set roomdata %1; #map set roomdata2 %2};

rooma -

there is the only one exit south.
aa(AA)
bb(BB)

Can I do #map add roomdata afterwards if I'd like to store aa and bb in roomdata?
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Tue Jan 24, 2017 5:09 pm    Post subject: Reply with quote

Those attributes works as normal vars, so you can use them as arrays or lists

Code:

#map set roomdata {{mob1}{pretty ugly}{mob2}{really strong}{mob3}{super easy}}

#map get {roomdata} {myvar}

#show $myvar
{mob1}{pretty ugly}{mob2}{really strong}{mob3}{super easy}

#echo {$myvar[mob1]}
pretty ugly


and to add things you just do something like this
Code:

#map set roomdata {$myvar{mob4}{another one}}
#MAP SET: roomdata set to: {mob1}{pretty ugly}{mob2}{really strong}{mob3}{super easy}{mob4}{another one}


Last edited by PowerGod on Tue Jan 24, 2017 5:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
dawang10



Joined: 14 Feb 2015
Posts: 66

PostPosted: Tue Jan 24, 2017 5:11 pm    Post subject: Reply with quote

nice. this makes mapping much easier

Thanks a lot.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion All times are GMT - 5 Hours
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
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group