Hmmm would it be possible if I could get an extract or the map with this problem in it? It is important to find why the gate is not being saved/restored and cannot be created with triggers.
You did remember to "BankSave" after adding the unit to the bank and before the session ends (or bank "BankReload" is used). It is recommended to call BankSave after adding a number of elements to the bank since any changes made to the bank between BankSave calls will be lost if the user exits the session.
On top of that you need to make sure to preload the bank (this is not a galaxy native, it adds the bank to the preload file list). You then have to open the bank before you write anything to it and preferably assign it to a global variable at this stage. If you call the "BankRemove" native then you will not be able to modify the bank anymore and cannot open it again for the rest of the session.
The whole process should be something like this...
Preload bank
Open bank
Set bankvar equal to last opened bank
Then after that every time you want to save something.
modify bank (add gate)
save bank
You do not need to remove the bank, clean-up is done automatically when the session ends.
Do not bother saving the unit. Save the gate state (open or closed). When your next session comes you load the gate state from the bank (open or closed) and apply it to the gate on the map.
If you are dynamically trying to save entire dynamic base placements (hundreds of units and their locations) then be aware that such a thing is not really viable as it will quickly reach bank size limits which will cause players to disconnect during map initialization in multiplayer sessions when the banks are being synchronized.
The error you are getting seems to be because no unit type link information was saved in the bank. As such it is restoring a unit of type empty string so will error.
You need to explain what you mean by a "gate" and what you are trying to do with said "gate".
If you want to save said "gate" state between sessions then consider storing in your bank the state of the gate only instead of the entire unit. You might want to push this through some sort of save/load system for extra security and compression.
If you are simply trying to make this "gate" using triggers then use the create units action with valid arguments.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hmmm would it be possible if I could get an extract or the map with this problem in it? It is important to find why the gate is not being saved/restored and cannot be created with triggers.
You did remember to "BankSave" after adding the unit to the bank and before the session ends (or bank "BankReload" is used). It is recommended to call BankSave after adding a number of elements to the bank since any changes made to the bank between BankSave calls will be lost if the user exits the session.
On top of that you need to make sure to preload the bank (this is not a galaxy native, it adds the bank to the preload file list). You then have to open the bank before you write anything to it and preferably assign it to a global variable at this stage. If you call the "BankRemove" native then you will not be able to modify the bank anymore and cannot open it again for the rest of the session.
The whole process should be something like this...
Then after that every time you want to save something.
You do not need to remove the bank, clean-up is done automatically when the session ends.
Do not bother saving the unit. Save the gate state (open or closed). When your next session comes you load the gate state from the bank (open or closed) and apply it to the gate on the map.
If you are dynamically trying to save entire dynamic base placements (hundreds of units and their locations) then be aware that such a thing is not really viable as it will quickly reach bank size limits which will cause players to disconnect during map initialization in multiplayer sessions when the banks are being synchronized.
The error you are getting seems to be because no unit type link information was saved in the bank. As such it is restoring a unit of type empty string so will error.
You need to explain what you mean by a "gate" and what you are trying to do with said "gate".
If you want to save said "gate" state between sessions then consider storing in your bank the state of the gate only instead of the entire unit. You might want to push this through some sort of save/load system for extra security and compression.
If you are simply trying to make this "gate" using triggers then use the create units action with valid arguments.