depomguss Posted December 15, 2019 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 7 Reputation: 0 Joined: 01/29/14 Last Seen: June 3, 2020 Share Posted December 15, 2019 --------------------------------------- *getfreecell "<map name>",<rX>,<rY>{,<x>,<y>,<rangeX>,<rangeY>,<flag>}; Finds a free cell on the given map and stores the reference to the found cell in <rX> and <rY>. Passing <x> and <y> with <rangeX> and <rangeY> allows for searching within a specified area on the given map. The <flag> is a bitmask and has the following possible values: - 1 = Random cell on the map or from <x>,<y> range. (default) - 2 = The target should be able to walk to the target tile. - 4 = There shouldn't be any players around the target tile (use the no_spawn_on_player setting). --------------------------- My Script: getfreecell(.@m$,.@x2,.@y2,.@x,.@y,10,10,2); Got Error: map_search_freecell: Incorrect usage! When src is NULL, flag has to be &1 and can't have &2 Thanks in advance. Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted December 15, 2019 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted December 15, 2019 you probably didnt attach the script to a player, change the flag to 1 if that is intended behavior Quote Link to comment Share on other sites More sharing options...
0 depomguss Posted December 15, 2019 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 7 Reputation: 0 Joined: 01/29/14 Last Seen: June 3, 2020 Author Share Posted December 15, 2019 (edited) @Emistry Thanks for your answer . I already attached player to script. paramk,112,84,0 script set 2_BULLETIN_BOARD,{ mes "playerattached - " + playerattached(); mes "getattachedrid - " + getattachedrid(); getmapxy(.@m$,.@x,.@y,BL_PC); getfreecell(.@m$,.@x2,.@y2,.@x,.@y,10,10,2); mes "Return value not random - "+.@x2; end; } Got Error: [Debug]: map_search_freecell: Incorrect usage! When src is NULL, flag has to be &1 and can't have &2 I want to find a cell that charactor able to walk to the target. (*checkcell won't work in my case) Edited December 15, 2019 by depomguss Quote Link to comment Share on other sites More sharing options...
Question
depomguss
---------------------------
My Script:
getfreecell(.@m$,.@x2,.@y2,.@x,.@y,10,10,2);
Got Error:
map_search_freecell: Incorrect usage! When src is NULL, flag has to be &1 and can't have &2
Thanks in advance.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.