|
发表于 2011-3-10 12:19:22
|
显示全部楼层
引用第3楼chilled于2011-03-10 11:20发表的 :
追加个问题~
Upgrade能用脚本重置吗?数据可能吗?
即:升级过的Upgrade如何重置呢?
编辑器中有两个关于科技树等级的动作,一个是为科技树增加等级,另外一个是设置科技树的等级
[codes=galaxy]
const int c_techCountQueuedOnly = 0;
const int c_techCountQueuedOrBetter = 1; // Queued + In Progress + Complete
const int c_techCountInProgressOnly = 2;
const int c_techCountInProgressOrBetter = 3; // In Progress + Complete
const int c_techCountCompleteOnly = 4;
const int c_techCountIncompleteOnly = 5; // Queued + In Progress
native void TechTreeUpgradeAddLevel (int player, string upgradeType, int levels);
void libNtve_gf_SetUpgradeLevelForPlayer (int lp_p, string lp_upgrade, int lp_levels) {
// Variable Declarations
int lv_levelCurrent;
// Variable Initialization
lv_levelCurrent = 0;
// Implementation
lv_levelCurrent = TechTreeUpgradeCount(lp_p, lp_upgrade, c_techCountCompleteOnly);
TechTreeUpgradeAddLevel(lp_p, lp_upgrade, (lp_levels - lv_levelCurrent));
[/codes]
从函数libNtve_gf_SetUpgradeLevelForPlayer()可以知道,TechTreeUpgradeAddLevel()中的等级是可以填负数的。
具体效果怎样没有试验过,应该没问题的,貌似在编辑器出现之前BLZ就许愿会有这个功能了。 |
|