Have a question please, in ERM it says if/en are limited to 10 levels, means in same trigger I can use only 10 if/en structures? Just to be sure.
No. It means attachments.
Does anyone know how to store the absolute data of a square? Because if we add an object on that square then remove the object, the square will not return to initial state (ie it displayed first "dirt", now it displays nothing)
I would need to store initial data then restore it after manipulations, so there is nothing corrupted on that square. I assume the square is empty, no yellow trigger on.
There is no simple way. Only manually save every data structure related to that square. What kind of manipulation do you want to do?
For example, if you place an object near water then remove it later, trying to land on that spot will crash the game. I had a lot of annoying problems in one of my map where the player can manually place teleporters and remove them later. So I suspect this problem to create corrupted squares later, which corrupts DO loops and so on.
Wondering is there is a way to get ALL infos about one square so we can restore later, regardless how we modded the square in between.
There is an object "Anchor Point" (type 3). It is automatically placed by the game near water, but apparently not when you remove objects via ERM. UN:O is really quite buggy, it doesn't even reset type/subtype.
As for getting all info. Let's say you do it, but then that tile may change in a way that you would want to keep (for example, some other objects getting into it from adjacent tiles). Then your saved state is useless, since it would revert all "good" changes.
I can write you some code that would simply save and restore raw tile data, but most likely it would make the game unstable or just crash it outright. Also saved data may remain valid just until game restart. Or until next game load.
Ok thanks, if it makes the game unstable then better keep only as minor issue. I was hoping there is a way to get a square value before changing it then restore later, like flags for monsters or such.
If you say what exactly you want to accomplish, there is likely a better way to do it.
For instance, I get a few reports about TEW4 map where people overuse a lot the feature place/remove teleporter and then month 3-4 a lot of loops give errors, creature banks (they show 0 monsters inside), monsters (they start to have artifact names), so this look as game data corruption. However my script restores the type and subtype of the square and even the UN:C (control word) value, so there may be missing another core detail.
Or when playing that map with another faction, where the manipulation of squares is not possible, such errors do not occur. Still, is an indirect guess of the suspected error, I am not sure, as players can do millions of other individual manipulations I didn't expect.
Sounds like some object lists are overflowing. I don't know, is there a limit to the number of teleporters on a map? UN:I doesn't check limits (like how it's possible to place over 48 towns using ERM) and WoG code tends to not work properly with lists. What objects do you place with ERM? Also if you manually change type/subtype of a tile, then from and to what?
Restoring control word, you can do this no later than next !?GM1, otherwise it may cause problems for objects with limits.
The player can place teleporters, but only 1/per month (2 on second month and so on), so is not the number of teleporters which overflows. However he can place/remove that teleporter as much as he wants so he can do that 1000 times a turn, changing 1000 squares if he wants.
When he places a teleporter I store that square OB:C in PO998:B0/$, check if other object or yellow square then place if check negative. When I remove teleporter I restore OB:C and set type/subtype to -1/-1. Personally I never had any error in all my tests, but I got twice reports and saves of corrupted loops when using this feature, as early as month 3.
May I see the save? Do I need anything additional to play it?
Also you don't need to restore control word if you are clearing type/subtype anyway.
SAVE, click end turn and watch the error cascade on day 1 of the week. Then all creature banks are corrupted.
You need only
TEW 4 mod because of graphics. Ignore erm messages when loading save, is probably because he uses interface mods you don't have.
Thanks.
(28.07.2016 12:43)Valery Wrote: [ -> ]When he places a teleporter I store that square OB:C in PO998:B0/$
I noticed you also store some value for creature banks there. Is it possible that they corrupt each other?