找回密码
 点一下
查看: 959|回复: 3

(谢谢kook大哥,已解决)请问各位前辈,怎么判断一个区域是否能造建筑呢?

[复制链接]
发表于 2008-3-27 12:22:39 | 显示全部楼层 |阅读模式
小菜初学,遇到大问题了,请问前辈,怎么判断一个区域是否能造建筑?
(像对战中用农民造建筑时,不能造建筑的区域就是红的)
如果用Japi,会是哪一个呀?
谢谢呀!
发表于 2008-3-27 12:27:05 | 显示全部楼层
对于一个点判断它的路径属性
[codes=jass]native IsTerrainPathable takes real x, real y, pathingtype t returns boolean


    constant pathingtype        PATHING_TYPE_ANY                = ConvertPathingType(0)
    constant pathingtype        PATHING_TYPE_WALKABILITY        = ConvertPathingType(1)
    constant pathingtype        PATHING_TYPE_FLYABILITY         = ConvertPathingType(2)
    constant pathingtype        PATHING_TYPE_BUILDABILITY       = ConvertPathingType(3)
    constant pathingtype        PATHING_TYPE_PEONHARVESTPATHING = ConvertPathingType(4)
    constant pathingtype        PATHING_TYPE_BLIGHTPATHING      = ConvertPathingType(5)
    constant pathingtype        PATHING_TYPE_FLOATABILITY       = ConvertPathingType(6)
    constant pathingtype        PATHING_TYPE_AMPHIBIOUSPATHING  = ConvertPathingType(7)
[/codes]

需注意返回true的话是不可建造,false的才是可建造。。

对于具体建筑需要一定空间的,可以通过一个辅助单位来发布建造命令,判断其返回值
[codes=jass]native IssueBuildOrder takes unit whichPeon, string unitToBuild, real x, real y returns boolean[/codes]
回复

使用道具 举报

发表于 2008-3-27 12:31:41 | 显示全部楼层
谢谢kook大哥!
我一直记着您这篇文章
http://www.ourga.com/bbs/read.php?tid=8623&fpage=2
5楼,从那以后我特别佩服您!
回复

使用道具 举报

发表于 2008-3-27 12:34:46 | 显示全部楼层
哦,我和LZ是一个人
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-7-9 06:52 , Processed in 0.046192 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表