export offset too high?

Started by abstauber, Mon 10/02/2014 13:41:03

Previous topic - Next topic

abstauber

I'm currently trying to get back to some AGS scripting, but obviously I got quite rusty.

Could anyone please help me with this error?
Code: ags

//AGS 3.3 RC1
Tiles.asc(484): Error (line 484): export offset too high; script data size too large?


In tiles.ash, I have a struct:
Code: ags

struct ctile_sprites {
  DynamicSprite *spr;
  int code;
  short frm_speed[MAX_FRAME_TILE];
  short frames_in_use;
  short frame_counter;
  short ani_delay;
  short ani_delay_counter;
};


In tiles.asc I create the struct like this and try to export it (at the bottom of the script). The error occurs.
Code: ags

ctile_sprites tile_sprites[NUM_MAX_SPRITES];
// a few lines later ...
export tile_sprites;


Now the interesting part is: when I overwrite those two lines to something stupid, the error remains
Code: ags

int blargh;
export blargh;


When I now copy and paste those two lines a few lines above, it works fine. Like those script lines were haunted.
Am I missing something?

--EDIT: Sorry already found it myself:
A few lines earlier is a pretty huge struct (tiles[100000]) which I also export. It seems like I can't export anything else after that. I moved the needed lines above this mega struct and it works fine now.

Crimson Wizard

#1
The solution is simple (sort of): don't use large static arrays, use dynamic ones and init them on game_start().

I remember Scavenger had a problem because of this: his compiled game became very large because of static script data saved in memory.
(He was using your PlatENG)

E: Right, the solution is not so simple, because AGS does not support dynamic arrays of custom structs (keep forgetting) :-/. This would require big rewrite. Nevermind.

abstauber

Hehe, I even posted in that thread and totally forgot about it.
Thanks for info - I simply keep in mind that my monster struct comes last. :)

Btw. the undo-bug struck again... argh, which lines did I change...

SMF spam blocked by CleanTalk