Jump to content
  • 0

getfreecell problem? or my fault?


depomguss

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  01/29/14
  • Last Seen:  

---------------------------------------
   
  *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.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

you probably didnt attach the script to a player, change the flag to 1 if that is intended behavior

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  01/29/14
  • Last Seen:  

@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)

 

 

 

Capture.PNG

Edited by depomguss
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...