Public memory segments
-
There are currently talks that it’s hard to communicate with eachoter using scripts.
We do have the following means of “talking” to one another:- terminal messages
- public creep.say
These methods are quite limiting and require a lot of boilerplate code to get working, or cpu-heavy methods in general.
With the introduction of RawMemory segments there could be an easy add-on to make communication even more easy between scripts.
My proposal is to let each player make 1 segment of them public. This could be done using RawMemory.setPublicSegment.
The method will take 1 ID as the segment to set to public, each player can only enable 1 public segment at a time.Other player can “enable” other players segments the same way they do now with RawMemory.setActiveSegments. The only difference is that they can pass the playername of the player they want to subscribe to.
The memory will be available in RawMemory.segmentsobject the next tick. This memory will readonly.
** It will also count towards the 10 segment limit. This way it can not be abused to “get” extra available memory.
If the player does not exist or doesn’t have memory the segment should still count towards the limit. The memory will just be empty.