Your save engine is confusing. It says First create him a savecode:
local location savecode = Savecode_new()
Now store the data in it. The way to store data is to pack it in an integer, taking a value from 0 to n, including n. Then call
Why dont u just include the trigger required for it? I dont know jass and this is not clear please clarify.