Creating Console Functions
My latest test is creating console functions that call code in the engine
My test was wrapping "GuiTSCtrl::project" into a script function, so you can call it like: playgui.project("0 0 100");. which will return to you where the point "0 0 100" will appear on your screen.
That was largely successful, and I used it to make this thing that puts a 2d box around every player in your view
Edit: another screenshot
My test was wrapping "GuiTSCtrl::project" into a script function, so you can call it like: playgui.project("0 0 100");. which will return to you where the point "0 0 100" will appear on your screen.
That was largely successful, and I used it to make this thing that puts a 2d box around every player in your view
Edit: another screenshot
screen2.JPG
199.3K
screen2.JPG
199.3K

Comments
Here's the code to implement the console function, written for nasm assmbler
The compiled binary is loaded into a new segment that is loaded to a3a000h, and during intialization of other console functions i have t2 call the init function
here's the code to the box player thing, which is largly useless unless you have a modified executable that can do "project" (or a in-script version), and a way of getting the worldbox of the objects of interest
$BP::boxCount=0; function BP_Loop() { cancel($bploopsch); BP_ResetPool(); %screenX = getword(playgui.getExtent(),0); %screenY = getword(playgui.getExtent(),1); for(%i=0;%i<ServerConnection.getCount();%i++) { %obj = ServerConnection.getObject(%i); if(%obj.getClassName() $= "Player") { //display the player if he faces the screen //is his center onscreen? %res = PlayGui.project(%obj.getWorldBoxCenter()); if ( getWord(%res,0) > 0.8 && getWord(%res,2) > 0 && getWord(%res,1) > 0 && getWord(%res,2) < %screenX && getWord(%res,1) < %screenY) { //yes, he is, draw box BP_boxPlayer(%obj); } } } BP_HideRemainingBoxes(); $bploopsch=schedule(16,0,"bp_loop"); } function BP_boxPlayer(%obj) { %ctrl = BP_GetNextBox(); //create a box that will encompass all the points of his worldbox %worldBox = %obj.getWorldBox(); %minx = getword(%worldBox,0); %miny = getword(%worldBox,1); %minz = getword(%worldBox,2); %maxx = getword(%worldBox,3); %maxy = getword(%worldBox,4); %maxz = getWord(%worldBox,5); %pt0 = %minx SPC %miny SPC %minz; %pt1 = %maxx SPC %miny SPC %minz; %pt2 = %maxx SPC %maxy SPC %minz; %pt3 = %minx SPC %maxy SPC %minz; %pt4 = %minx SPC %miny SPC %maxz; %pt5 = %maxx SPC %miny SPC %maxz; %pt6 = %maxx SPC %maxy SPC %maxz; %pt7 = %minx SPC %maxy SPC %maxz; %screenX = getword(playgui.getExtent(),0); %screenY = getword(playgui.getExtent(),1); %minx=%screenX; %maxx=0; %miny=%screenY; %maxy=0; for(%i=0;%i<8;%i++) { %pt[%i]=getWords(PlayGui.project(%pt[%i]),1,2); %x = getWord(%pt[%i],1); %y = getWord(%pt[%i],0); if (%x < %minx && %x > 0) %minx=%x; if (%x > %maxx && %x < %screenX) %maxx=%x; if (%y < %miny && %y > 0) %miny=%y; if (%y > %maxy && %y < %screenY) %maxy=%y; } %ctrl.resize(%minx,%miny,%maxx-%minx,%maxy-%miny); %ctrl.setVisible(true); } //box pools function BP_ResetPool() { $BP::nextBox=0; } function BP_GetNextBox() { if ($BP::nextBox == $BP::boxCount) { //create new box $BP::box[$BP::boxCount] = new HudZoom() { profile = "ZoomHudProfile"; position = "0 0"; extent = "8 8"; visible = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; bp = true; }; playgui.add($BP::box[$BP::boxCount]); $BP::boxCount++; } %ret = $BP::box[$BP::nextBox]; $BP::nextBox++; return %ret; } function BP_HideRemainingBoxes() { for(%i=0;$BP::nextBox < $BP::boxCount;$BP::nextBox++) $BP::box[$BP::nextBox].setVisible(false); } function BP_cleanupErrantBoxes() { $BP::boxCount=0; for (%i=0;%i<playgui.getCount();%i++) { %obj = playgui.getObject(%i); if (%obj.getClassName() $= "HudZoom" && %obj.bp) { %obj.delete(); %i--; } } }I'm talking about the general population of ConMod.
ServerConnection.GetCount() already works in TGE
so does every group for that matter. in server tree
called by Tree(); (i found that function by accident too
I just haven't had the time to stab at the game in IDA.
...eh alv *shove* eh, eh....*shove*
As for patching
437462 - listobjects
4376BC - getobject
42E93B - %obj.blah()
getCount already returns the right count.