|
原函数CostOfAbility:
fixed libNtve_gf_CostOfAbility (string lp_ability, string lp_costType) {
    // Variable Declarations
    string lv_value;
    string lv_field;
    // Variable Initialization
    lv_value = "";
    lv_field = "";
// Implementation
   if (((lp_costType == "Minerals") || (lp_costType == "Gas"))) {
        lv_field = ("Cost." + lp_costType);
    }
    else if (((lp_costType == "Energy") || (lp_costType == "Life") || (lp_costType == "Shields"))) {
        lv_field = ("Cost.Vital[" + lp_costType + "]");
    }
    lv_value = CatalogFieldValueGet(c_gameCatalogAbil, lp_ability, lv_field, 1);
    return StringToFixed(lv_value);
}
其中Cost子域格式错误,应加上脚标,否则无法读取Catalog数据;
修正后
if (((lp_costType == "Minerals") || (lp_costType == "Gas"))) {
        lv_field = ("Cost[0]." + lp_costType);
    }
    else if (((lp_costType == "Energy") || (lp_costType == "Life") || (lp_costType == "Shields"))) {
        lv_field = ("Cost[0].Vital[" + lp_costType + "]");
    }
Cost array似乎只有[0]起作用,添加额外的cost数据没有效果
难道这是BLZ的坑?这个错误花了我3个小时找原因。。。。
不过data里的数据都可以通过此类函数在trigger中调用了 |
|