|
Araadan Wanderer
Joined: 07 Jun 2009 Posts: 65
|
Posted: Thu Mar 04, 2010 3:50 am
%roomlink and non-standard exit name |
how properly fire %roomlink for other-dir/non standard exit name"(x)"? I need check %roomvnum to %roomcost to @walkcost.
add example:
#say @walkcost(@replacedir(s|s),8622) or #say @walkcost(s|s)
return 2
#say @walkcost(@replacedir(s|s),8607)
return 11
but if %roomexit(8622) == n|non-standard exit(other) and @walkcost(@replacedir(s|enter),8607) -> $vnum = %roomlink($vnum,%item($sciezka,%i)) is null
Code: |
map:
8607
|
8622(roomcost 10)
|
8624(roomcost 1)
|
17 (roomcost 1) |
@walkcost
Code: |
#LOCAL sciezka walkc vnum
$sciezka = %1
$vnum = %if(%null(%2),%roomvnum,%2)
#LOOP %numitems($sciezka) {
#if (%item($sciezka,%i)=="rr") {
$walkc = $walkc+10
$vnum = %portal(rr)} {
#if (%roomlink($vnum,%item($sciezka,%i))=-1 OR %null(%roomlink($vnum,%item($sciezka,%i)))) {#say %i - vnum: $vnum to: %item($sciezka,%i) roomlink: %roomlink($vnum,%item($sciezka,%i));#exit all}
$vnum = %roomlink($vnum,%item($sciezka,%i))
#if %null($vnum) {#say bug}
$walkc = $walkc+%roomcost($vnum)}}
#return $walkc
|
@replacedir
Code: |
#LOCAL ret
$ret = %1
#LOOP %numitems($ret) {
#IF (%item($ret,%i)=="k") {$ret = %replaceitem("sw",%i,$ret);#CONTINUE}
#IF (%item($ret,%i)=="l") {$ret = %replaceitem("se",%i,$ret);#CONTINUE}
#IF (%item($ret,%i)=="j") {$ret = %replaceitem("ne",%i,$ret);#CONTINUE}
#IF (%item($ret,%i)=="h") {$ret = %replaceitem("nw",%i,$ret);#CONTINUE}
}
#return $ret |
|
|
|
|
Araadan Wanderer
Joined: 07 Jun 2009 Posts: 65
|
Posted: Thu Mar 04, 2010 12:52 pm |
Nevermind, i use %roomportal for non-standard exit name.
|
|
|
|
|
|
|
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
|
|