SCRMaps
/
Sign in

dat writes do not stay written

You do not write it once. You write it every cycle.

4 min read

Change a units.dat or weapons.dat value with EUD and it appears to work, then at some point it is back to the stock value. Before you go hunting for the bug: this is normal. The game re-reads and refills these tables from several paths, so a single write is not guaranteed to survive.

The fix is simple and boring: write it again every cycle. With hyper triggers running that is more than twenty rewrites a second, so whatever puts the stock value back is overwritten on the next pass.

function applyWeapon(w, dmg, cd) {
    // 매 사이클 다시 쏀니다 / rewritten every cycle
    Weapon(w).damage   = dmg;
    Weapon(w).cooldown = cd;
}
Do not expect the value to persist - restate it every time.

This is not a performance concern. A dat write is a single memory write, and dozens of them every cycle do not add measurable load. What the saving does buy you is a bug that is hard to reproduce.

The converse also holds: some things only need writing once. Data you put in memory the game does not refill - button records, for instance - is written once, and only the pointer to it is restated every cycle. Rewriting the records every cycle is what tears the display, because the content changes under the cursor.

Sign in to track your progress