Page 1 of 1

Can't remove MMOItem variable

Posted: 11 Sep 2024, 16:16
by AiryKai
Hello!

I'm trying to completely remove a variable from an MMOItem on the server side.

In the documentation, I see this:

Removing Variables: in order to remove one or more existing variables you will need to set those variables to NULL, using the SFSUserVariable.setNull() method;


When I try to do this, the variable becomes null, but the key is not completely removed from the MMOItem.

What should I do to completely remove the variable key from MMOItem?

Re: Can't remove MMOItem variable

Posted: 11 Sep 2024, 18:36
by Lapo
Hello,
this is not supported, neither for BuddyVars or ItemVars (it is in UserVars and RoomVars).
Typically these vars are not dynamic (or, at least this is how they were conceived), in the sense that Items on map have a fixed number of properties that are updated during gameplay but they normally don't get removed. Like a database record, where fields get updated but not removed.

Isn't setting the ItemVar to an empty/null value not enough for your use case?

Cheers

Re: Can't remove MMOItem variable

Posted: 11 Sep 2024, 19:38
by AiryKai
Lapo wrote:Isn't setting the ItemVar to an empty/null value not enough for your use case?


That's what I'm doing now to solve this issue.

It's a bit odd that I can add a new variable at any time, but can't delete it.

Thank you. Now I understand how it works.