int isWatchLink = 0; int line0, line1, line2, line3, line4, line5, line6, line6_1, start, end; void OnActivate(int a) { if (a == 1) { Show(); Enable(); Begin("Info"); PlayAnimation(); End(); var_showDebugLine = 4; } else { Show(0); Enable(0); var_showDebugLine = 0; } } void TextField(int tid, int x, int y, string text) { Begin(tid); Position(x, y); TextColor(1,1,1); TextSize(16); Text(text); End(); } void Info_OnAnimate(int frame) { if (frame == 0) { float x, y, z; GetCameraPos(x, y, z); Begin("CamX"); FNumber(x); End(); Begin("CamY"); FNumber(y); End(); Begin("CamZ"); FNumber(z); End(); GetCameraRot(x, y, z); Begin("CamRX"); FNumber(x); End(); Begin("CamRY"); FNumber(y); End(); Begin("CamRZ"); FNumber(z); End(); GetCursorPos(x, y, z); Begin("CurX"); FNumber(x); End(); Begin("CurY"); FNumber(y); End(); Begin("CurZ"); FNumber(z); End(); if(isWatchLink) { int s, e, t; int x1, y1; x1 = 580; y1 = 280; GetLinkStartp(s); GetLinkEndp(e); t = GetLinkType(); Begin("startp"); Number(s); End(); Begin("endp"); Number(e); End(); if(t == -1) { TextField(line6_1, x1+100, y1+100, ""); } else if(t == 0) { TextField(line6_1, x1+100, y1+100, "WALK"); } else if(t == 1) { TextField(line6_1, x1+100, y1+100, "JUMP"); } else if(t == 2) { TextField(line6_1, x1+100, y1+100, "SUPERJUMP"); } else if(t == 4) { TextField(line6_1, x1+100, y1+100, "DOUBLEJUMP"); } else if(t == 8) { TextField(line6_1, x1+100, y1+100, "DASH"); } else if(t == 32) { TextField(line6_1, x1+100, y1+100, "FARJUMP"); } } NextFrame(0.1, 0); // update again after 0.1 sec } } int NewNumberField(int x, int y, string name) { int id = NewUI(name); Begin(id); Position(x, y); TextColor(1,1,1); TextSize(16); ShowNumber(0); End(); return id; } int NewFNumberField(int x, int y, string name) { int id = NewUI(name); Begin(id); Position(x, y); TextColor(1,1,1); TextSize(16); ShowNumber(1); End(); return id; } int NewTextField(int x, int y, string text) { int id = NewUI(); Begin(id); Position(x, y); TextColor(1,1,1); TextSize(16); Text(text); End(); return id; } int AIEditor_OnInput(int key) { float x, y, z; int id; GetCursorPos(x, y, z); if(isWatchLink == 0) { if (key == '1') { AddWaypoint(x, y, z); } else if (key == '2') { DeleteWaypoint(x, y, z); } else if (key == '3') { LoadSceneWaypoints(); } else if (key == '4') { SaveSceneWaypoints(); } else if (key == '5') { id = FindChara("ce01"); AIMoveToPoint(id, x, y, z); } else if (key == '6') { LinkMode(); isWatchLink = 1; } else if(key == '7') { ChangeCurSize(); } else if(key == '8') { ChangePointSize(x, y, z); } else if(key == '9') { SetStopPoint(x, y, z); } } else { if (key == '1') { DelLink(x, y, z); // delete this link } else if (key == '2') { SetLinkType(1); // set link type to jump } else if (key == '3') { SetLinkType(0); // set link type to walk } else if (key == '4') { SetLinkType(2); // // set link type to super jump } else if (key == '5') { SetSpecialLink(); } else if (key == '6') { PointMode(); isWatchLink = 0; } else if (key == '7') { SetLinkType(4); // set link type to double jump } else if (key == '8') { SetLinkType(8); // set link type to dash } else if (key == '9') { SetLinkType(32); // set link type to far jump(double + dash) } } int x1 = 580; int y1 = 280; if(isWatchLink == 0) { TextField(line0, x1, y1, "Point Functions:"); TextField(line1, x1, y1+20, "1:add,2:del,3:load"); TextField(line2, x1, y1+40, "4:save,5:move,6:link"); TextField(line3, x1, y1+60, "7:CurSize,8:PointSize"); TextField(line4, x1, y1+80, "9:StopPoint"); TextField(line5, x1+90, y1+80, ""); TextField(line6, x1, y1+100, ""); TextField(line6_1, x1+100, y1+100, ""); } else { TextField(line0, x1, y1, "Link Functions:"); TextField(line1, x1, y1+20, "1:del,2:jump,3:walk"); TextField(line2, x1, y1+40, "4:Sjump,5:special,6:back"); TextField(line3, x1, y1+60, "7:DJump,8:dash,9:FJump"); TextField(line4, x1, y1+80, "Start:"); TextField(line5, x1+90, y1+80, ",End:"); TextField(line6, x1, y1+100, "LinkType:"); } return 0; } void OnDefineUI() { Begin(NewUI()); Color(0,0,0,0.5); Position(580, 100); Size(250, 300); End(); Begin(NewUI("Info")); float x, y; x = 600; y = 100; NewTextField(x, y, "Camera Position"); NewFNumberField(x, y+20, "CamX"); NewFNumberField(x+60, y+20, "CamY"); NewFNumberField(x+120, y+20, "CamZ"); x = 600; y = 150; NewTextField(x, y, "Camera Rotation"); NewFNumberField(x, y+20, "CamRX"); NewFNumberField(x+60, y+20, "CamRY"); NewFNumberField(x+120, y+20, "CamRZ"); x = 600; y = 200; NewTextField(x, y, "Cursor"); NewFNumberField(x, y+20, "CurX"); NewFNumberField(x+60, y+20, "CurY"); NewFNumberField(x+120, y+20, "CurZ"); End(); x = 580; y = 280; Begin(NewUI("AIEditor")); line0 = NewTextField(x, y, "Point Functions:"); line1 = NewTextField(x, y+20, "1:add,2:del,3:load"); line2 = NewTextField(x, y+40, "4:save,5:move,6:link"); line3 = NewTextField(x, y+60, "7:CurSize,8:PointSize"); line4 = NewTextField(x, y+80, "9:StopPoint"); start = NewNumberField(x+60, y+80, "startp"); line5 = NewTextField(x+90, y+80, ""); end = NewNumberField(x+140, y+80, "endp"); line6 = NewTextField(x, y+100, ""); line6_1 = NewTextField(x+90, y+100, ""); End(); }