|
AzahDSL Newbie
Joined: 15 Jul 2019 Posts: 9
|
Posted: Thu Jul 18, 2019 1:49 pm
Help a poor non-coder figure out... turning zones on and off in the automapper |
Hello again! I received such a quick reply last time I posted here and the issue was solved perfectly, I thought I would give it another shot.
Basically, what I have done is to map a good chunk of my MUD's zones. This includes hopping on various alts of mine to map out kingdom and clan specific halls and strongholds.
What I WANT to do is to be able to turn those zones on and off when I hop to a specific character, so that my elf doesn't try to jump into the dwarf kingdom's portals because he is closer to them than he is to his own portals. It SEEMS like the way to do this is to go to the room properties tab of the room and check "do not enter".
However, I am having trouble making CMUD do this with my login trigger. Basically, it's a trigger that sees when I log on a certain character, and sets up his spells and things for me.
My first thought was to use the %roomcost command- but using that for every single room in every single kingdom-specific hall seems like a lot of code to chunk through on startup.
My second thought was to somehow use the %mapfilter command. Being fairly computer illiterate, all I could manage to do is hack through the example given on the page and twist it to my own evil purposes. Warning for coders, this will probably make you cry and/or vomit with rage:
Code: |
#CALL %mapfilter(%concat("ZoneID = ",%zonenum(47)))
#LOOP %numrooms {%roomcost(%roomvnum(%i),0)}
#CALL %mapfilter(%concat("ZoneID = ",%zonenum(58)))
#LOOP %numrooms {%roomcost(%roomvnum(%i),999)}
#CALL %mapfilter(%concat("ZoneID = ",%zonenum(90)))
#LOOP %numrooms {%roomcost(%roomvnum(%i),999)}
#CALL %mapfilter(%concat("ZoneID = ",%zonenum(101)))
#LOOP %numrooms {%roomcost(%roomvnum(%i),999)}
#CALL %mapfilter(%concat("ZoneID = ",%zonenum(157)))
#LOOP %numrooms {%roomcost(%roomvnum(%i),999)}
#CALL %mapfilter(%concat("ZoneID = ",%zonenum(191)))
#LOOP %numrooms {%roomcost(%roomvnum(%i),999)}
#CALL %mapfilter(%concat("ZoneID = ",%zonenum(234)))
#LOOP %numrooms {%roomcost(%roomvnum(%i),999)}
#CALL %mapfilter(%concat("ZoneID = ",%zonenum(236)))
#LOOP %numrooms {%roomcost(%roomvnum(%i),999)}
#CALL %mapfilter(%concat("ZoneID = ",%zonenum(263)))
#LOOP %numrooms {%roomcost(%roomvnum(%i),999)}
#CALL %mapfilter(%concat("ZoneID = ",%zonenum(277)))
#LOOP %numrooms {%roomcost(%roomvnum(%i),999)}
#CALL %mapfilter("") |
...Where 47, 58, 90, 101, etc are the zones of the kingdom-specific halls, and 999 is the room cost to move through them.
It... kind of works, in the sense that it DOES turn all of those room costs to 999. However, CMUD has a minor seizure and I'm afraid my computer will set off the smoke alarm eventually. Also, it sends a huge string of:
...etc, into the mud right on login. So, not ideal.
Surely someone has had this question before, but I've searched here and there and can't find anyone else who has tried to do this. Suggestions? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Thu Jul 18, 2019 4:42 pm |
yea, %mapfilter and %mapquerry both cause a lot of internal lag, this can sometimes be allieviated by throwing a
#WAIT 0
in there, supposedly in shunts the code off into its own thread, where it hangs itself without hanging the rest of the system. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
AzahDSL Newbie
Joined: 15 Jul 2019 Posts: 9
|
Posted: Thu Jul 18, 2019 4:53 pm |
Any idea on a better way to go about disabling zones?
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Fri Jul 19, 2019 1:06 pm |
Well, you dont need to set the value of every room in the zone to be high, just those rooms that act as entrances to the area.
Syntax: %roomkind(vNum,value)
Return or set the type of the room to value. Add 128 to set Do Not Enter flag. If vNum is omitted, the current room is used. Custom room types can be defined using zMapper. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|
|
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
|
|