XSDebugger


XS地图触发程序

rmCreateTrigger("Tech"); rmSwitchToTrigger(rmTriggerID("Tech")); rmSetTriggerPriority(2); rmSetTriggerActive(true); rmSetTriggerRunImmediately(true); rmSetTriggerLoop(false); rmAddTriggerCondition("Always"); rmAddTriggerEffect("Set Tech Status"); rmSetTriggerEffectParamInt("PlayerID", 0, false); rmSetTriggerEffectParamInt("TechID", 446, false);//这个446是科技Spies(间谍) rmSetTriggerEffectParamInt("Status", 2, false);

typetest.xml

<Effect name="Set Tech Status"> <Param name="PlayerID" dispName="$$22301$$Player" varType="player">1</Param> <Param name="TechID" dispName="$$22311$$Tech" varType="tech">0</Param> <Param name="Status" dispName="$$22340$$Status" varType="techstatus">2</Param> <Command>trTechSetStatus(%PlayerID%, %TechID%, %Status%);</Command> </Effect>

有人发现类似上面的启用禁用科技的触发程序的TechID是Int数值,而且该数值估算也有几百,那么有办法得到这个ID吗?

答案是有办法,慢慢数,你的目标是在4个小时内数出来,使用XSdebugger,我估计这东西应该是神话时代遗留下来的。

这是我修改改过的XSdebugger UI下载:
百度云:https://pan.baidu.com/s/1cf-LY88sbaqSXNbLxD33fg

注意:必须正确安装这个UI才能完整使用与截图一样的功能,不要问我安装在哪。不安装的话就算你调出了XSdebugger也没有任何作用。
不想安装的,可以在startup文件夹自行创建文件修改:
  user.cgf - 记事本 ____ X
文件(F)  编辑(E)  格式(O)  查看(V)  帮助(H)

//专家模式非专业人员,请勿尝试

//此句开启AI Debug(XS Debugger)的功能 aiDebug//没错,就只有aiDebug这7个字母。

  user.con - 记事本 ____ X
文件(F)  编辑(E)  格式(O)  查看(V)  帮助(H)

//专家模式非专业人员,请勿尝试

//此句在游戏中设定Ctrl+alt+d开启XSDebugger。 map("control-alt-d","game","gadgetToggle(\"XSDebugger\")")


安装好我修改过的XSDebugger后,先在剧情编辑器编好触发程序,然后测试:
例如我们选择查找XPRevolutionWashington的TechID,先在剧情编辑器把这个触发程序写好

测试剧情:
按我设定的control-alt-d快捷键调出XSDebugger


如果安装了我修改过的UI,这个XSDebugger是半屏的,并且按f7暂停后,顶部的标题会变成红色(这是user.cgf的aidebug语句生效)
如果是自己修改的,你的XSDebugger是全屏的。如果按了截图中的XS Runtime[XX]: Triggers[BASE DATA].底部没有显示触发程序的,我只能说这个是智商问题。




1532就是XPRevolutionWashington的TechID


XSdebugger还可以用来查看触发程序是否已经启用


还能用来判断是不是某个触发写错了





问:有没有其他已经整理好的Int值?
答:没有,自己用XS Debugger查。

2018.05.27
现在亚洲王朝所有的科技ID已经整理好了,具体见科技调用名,就不用按照这个方法寻找TechID了,另外自己添加的科技任然需要用XS Debugger(这明显就是废话)
另外自己新添加的科技一定要放在Tcehtreey.xml最后一个科技的后面,不然会改变整体TechID(我整理的TechID是官方版本从0开始计算的,然而你却在中间插入一个科技,原有的TechID不改变的话太阳都从西边出来了)。(在这里给某些人送一句话:想要说别人,先检查自己有没有做对。)若因你自己在techtreey添加了新科技,然后按照本教程整理的科技调用名的TechID添加进地图,发现实际与教程的描述不相符,这个只能怪你自己修改Techtreey.xml时不将科技添加在底部。






另外,你要不要尝试打开我的文档/My Game/Age of Empires 3/Trigger3/trigtemp.xs这个文件?

































最后附上本人修改过的半屏uixsdebugger.xml。
  uixsdebugger.xml - 记事本 ____ X
文件(F)  编辑(E)  格式(O)  查看(V)  帮助(H)
<?xml version="1.0" encoding="utf-8"?>

<layout>
	<gadget name="xsDebugger" type="xsdebugger" z="1000" size1024="0 0 512 768" closebutton="" titlebar="XS Debugger" backgroundcolor="128 128 128" hidden="" context="xsdebugger">
		<gadget type="textBox" name="xsDebugger-outputLabel" sizerel1024="5 19 507 34" textcolor="255 255 255" backgroundcolor="128 128 128">AI Output:</gadget>
		<gadget type="simpleTextBox" name="xsDebugger-output" sizerel1024="6 34 507 152" textcolor="255 255 0" backgroundcolor="0 0 128" textfont="Courier" textfontsize="11" textwrapon="" scrollvert="" scrollhoriz="" cursoralwayson="" textsimpleaddmaintainsposition=""/>
		<gadget type="textBox" name="xsDebugger-callStackLabel" sizerel1024="6 84 480 91" textcolor="255 255 255" backgroundcolor="128 128 128">Call Stack:</gadget>
		<gadget type="simpleTextBox" name="xsDebugger-callStack" sizerel1024="5 160 212 294" textcolor="255 255 0" backgroundcolor="0 0 128" textfont="Courier" textfontsize="11" scrollvert="" scrollhoriz=""/>
		<gadget type="textBox" name="xsDebugger-heapLabel" sizerel1024="212 153 247 170" textcolor="255 255 255" background="">Heap:</gadget>
		<gadget type="simpleTextBox" name="xsDebugger-heap" sizerel1024="232 160 427 293" textcolor="255 255 0" backgroundcolor="0 0 128" textfont="Courier" textfontsize="11" scrollvert="" scrollhoriz="" textsimpleaddmaintainsposition=""/>
		<gadget type="button" name="xsDebugger-heapDisplay" sizerel1024="215 186 227 211" textcolor="0 0 0" backgroundcolor="0 0 128" bevelbutton="" tooltiptext="Heap display mode (only active when in a breakpoint).">H</gadget>
		<gadget type="button" name="xsDebugger-variableDisplay" sizerel1024="215 215 227 240" textcolor="0 0 0" backgroundcolor="0 0 128" bevelbutton="" tooltiptext="Variable display mode (only active when in a breakpoint).">V</gadget>
		<gadget type="button" name="xsDebugger-breakpointAdd" sizerel1024="431 160 507 181" backgroundcolor="76 12 0" bevelbutton="" tooltiptext="Add a breakpoint at the current source line.">Add Breakpoint</gadget>
		<gadget type="button" name="xsDebugger-breakpointRemove" sizerel1024="431 187 508 207" backgroundcolor="76 12 0" bevelbutton="" tooltiptext="Remove any breakpoint at the current source line.">RemoveBreakpoint</gadget>
		<gadget type="button" name="xsDebugger-breakpointGo" sizerel1024="431 214 507 235" backgroundcolor="76 12 0" bevelbutton="" tooltiptext="Restart XS execution (if in a breakpoint).">Run</gadget>
		<gadget type="button" name="xsDebugger-breakpointSingleStep" sizerel1024="431 241 508 264" backgroundcolor="76 12 0" bevelbutton="" tooltiptext="Execute one line of XS code (if in a breakpoint).">Single Step</gadget>
		<gadget type="button" name="xsDebugger-breakpointSingleStepOver" sizerel1024="432 268 508 290" backgroundcolor="76 12 0" bevelbutton="" tooltiptext="Execute one line of XS code, stepping over function (if in a breakpoint).">Single Step Over</gadget>
		<gadget type="textBox" name="xsDebugger-sourceLabel" sizerel1024="5 300 508 321" textcolor="255 255 255" backgroundcolor="128 128 128">Current Source:</gadget>
		<gadget type="textField" name="xsDebugger-sourceFilter" columnorder="" showselect="" selectedcolor="255 0 0" allowdoubleclick="" textcolor="0 0 0" buttonsizerel1024="400 30" sizerel1024="6 325 508 344" backgroundcolor="0 0 128" scrollvert="" fieldreadonly="">
			Source Filter
			<dropdown>None</dropdown>
		</gadget>
		<gadget type="simpleTextBox" name="xsDebugger-source" sizerel1024="5 349 508 738" textcolor="255 255 0" backgroundcolor="0 0 128" textfont="Courier" textfontsize="11" scrollvert="" scrollhoriz="" normalcursoralwayson=""/>
	</gadget>
</layout>