bWolfie 138 Posted January 19, 2017 I am trying to use getmapflag to detect a zone, but cannot get it to work. Is it possible. Any advice? Thank you. if (getmapflag("" + strcharinfo(PC_MAP) + "", mf_zone) == "Memorial Dungeon") script here; else other script here; end; Quote Share this post Link to post Share on other sites
0 Ragno 57 Posted January 20, 2017 (edited) Since normal instance maps has all of them an "@" in their name, you can use that for identify the instance maps using compare() script command. In example, give this script to the Giggling Box: Script: <" if (compare(strcharinfo(PC_MAP), "@")) announce "You are on an Instance Map.", bc_self; else announce "You aren't on an Instance Map.", bc_self; "> That script will compare if the string "@" is contained inside the string generated by strcharinfo(PC_MAP), so, if player is in an instance map (let's say 1@tower) it will return true (1) otherwise it will return false (0) when name doesn't have the "@" string. Edited January 20, 2017 by Ragno Quote Share this post Link to post Share on other sites
0 Ragno 57 Posted January 19, 2017 I'm not sure if can be possible of that, but an alternative that I can suggest is, if you are setting mf_zone by npc, use a temporary global variable to save the fact that you already setted that mapflag according to your needs, and then do the check over that variable. Quote Share this post Link to post Share on other sites
0 bWolfie 138 Posted January 19, 2017 I'm not sure if can be possible of that, but an alternative that I can suggest is, if you are setting mf_zone by npc, use a temporary global variable to save the fact that you already setted that mapflag according to your needs, and then do the check over that variable. Hm well, I want to edit an item script, Giggling Box to be precise, so it will have a different effect in Memorial Dungeon than in general game play. Any advice for that one? Quote Share this post Link to post Share on other sites
0 bWolfie 138 Posted January 23, 2017 Since normal instance maps has all of them an "@" in their name, you can use that for identify the instance maps using compare() script command. In example, give this script to the Giggling Box: Script: <" if (compare(strcharinfo(PC_MAP), "@")) announce "You are on an Instance Map.", bc_self; else announce "You aren't on an Instance Map.", bc_self; "> That script will compare if the string "@" is contained inside the string generated by strcharinfo(PC_MAP), so, if player is in an instance map (let's say 1@tower) it will return true (1) otherwise it will return false (0) when name doesn't have the "@" string. Thank you, sir. I think this is the best that can be done. Quote Share this post Link to post Share on other sites
I am trying to use getmapflag to detect a zone, but cannot get it to work.
Is it possible. Any advice?
Thank you.
Share this post
Link to post
Share on other sites