FOnline Development > Questions and Answers
compile_scripts
Ethanhoff:
FOnline.log has 2MB of error and it seems to be repeated, here is a piece:
--- Code: ---Game>, state<Exception>, call stack<1>:
0) client_interface : void render_iface(uint) : 1910, 4.
Script exception: Index out of bounds : client_interface : void render_iface(uint) : 1910, 4 : FOClient::DrawIfaceLayer : Game.
Execution of script stopped due to exception.
Context<FOClient::DrawIfaceLayer : Game>, state<Exception>, call stack<1>:
--- End code ---
And as for that code from cvet, do I put it into fonline.h around line 1400 or so, where it say
struct CritterCL
?
Wipe:
Hehe yeah, render_iface() is fun to debug. And it looks like w/e you added, it have a problem with some array - trying to access element with index bigger than array length.
As for snippet, yeah, you add it to the end of CritterCl.
Ethanhoff:
So, I debugged render_iface(), that's no problem anymore.
Though, I tried adding cvet's snippet into fonline.h, at the end of struct CritterCL, but it doesn't change how the HP over head locks to the hex you step on, not the critter itself.
Here's what I pieced together and put in the end of CritterCL:
--- Code: --- UShortPairVec MoveSteps;
int CurMoveStep;
bool needReSet;
uint reSetTick;
void* Layers3d;
uint curSpr, lastEndSpr;
uint animStartTick;
typedef vector< CritterAnim > CritterAnimVec;
CritterAnimVec animSequence;
CritterAnim stayAnim;
Animation3d* Anim3d;
Animation3d* Anim3dStay;
bool Visible;
uchar Alpha;
Rect DRect;
bool SprDrawValid;
Sprite* SprDraw;
uint SprId;
short SprOx, SprOy;
bool SprDrawValid;
Sprite* SprDraw;
uint SprId;
short SprOx, SprOy;
short OxExtI, OyExtI;
float OxExtF, OyExtF;
float OxExtSpeed, OyExtSpeed;
uint OffsExtNextTick;
int staySprDir;
uint staySprTick;
uint finishingTime;
bool fadingEnable;
bool fadeUp;
uint FadingTick;
Rect textRect;
uint tickFidget;
string strTextOnHead;
uint tickStartText;
uint tickTextDelay;
uint textOnHeadColor;
short RefCounter;
bool IsNotValid;
char RawData[112];
struct { L, T, R, B } DRect;
bool SprDrawValid;
Sprite* SprDraw;
uint SprId;
short SprOx, SprOy;
char RawData[112];
struct { L, T, R, B } DRect;
bool SprDrawValid;
Sprite* SprDraw;
uint SprId;
short SprOx, SprOy;
char RawData[112];
struct { L, T, R, B } SpriteRect;
bool SprDrawValid;
Sprite* SprDraw;
uint SprId;
short SprOx, SprOy;
char RawData2[44];
struct { L, T, R, B } TextRect;
char RawData[112];
struct { L, T, R, B } SpriteRect;
bool SprDrawValid;
Sprite* SprDraw;
uint SprId;
short SprOx, SprOy;
char RawData2[44];
struct { L, T, R, B } TextRect;
struct { L, T, R, B } - struct { int L, T, R, B; }
--- End code ---
What did I do wrong? Maybe I need to edit something in the HP display code? I've noticed it has GetHexPos on critters, maybe it's the module itself doing this and needs to be changed. The link to the mod is on one of my posts above.
Wipe:
Adding is one thing, now you need something what get coords [basing on data from expanded CrittterCl] and you're ready to draw them pixels.
Ethanhoff:
Can I have hint on how to grab coords, and add to DrawText function? ;D
Do I use TextRect somewhere in here?
Navigation
[0] Message Index
[*] Previous page
Go to full version