Global variable logic block

    Kraengis

    stuff builder
    Joined
    Jun 12, 2017
    Messages
    30
    Reaction score
    140
    The concept is pretty simple, it's a new logic block on which you set a name like for inner remotes and it takes the state of all others globals blocks with that name.

    It's general behavior will be similar to wireless blocks but when it's state change, it changes the state off all others globals blocks in loaded chunks with it's name. And upon loading a chunk with them, their state is set from the others blocks.

    That way it would be possible to send data to several entities without having the trouble of connecting them manually or having several wireless blocks doing the same thing (since a wireless block can be connected to only one other wireless block, at least on different entities).

    It could also allow to setup general broadcast points on which ships can connect (it would especially go well with the radio kit I'm making, I should be done with it in a day or two) and share data.
     
    Last edited:

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4
    I think the functionality could be added to wireless blocks, but in any case, thumbs up from me.
     

    Lone_Puppy

    Me, myself and I.
    Joined
    Mar 12, 2015
    Messages
    1,274
    Reaction score
    529
    • Purchased!
    • Community Content - Bronze 2
    • Legacy Citizen 8
    This sounds familiar. I suspect a similar idea has been suggested before.
    I remember asking for this with Display modules. And to also add the ability to transfer variable contents instead of just the contents of the display module. That way you can use Display modules for comms and remote control.
     
    Joined
    Jan 31, 2015
    Messages
    1,696
    Reaction score
    1,199
    • Thinking Positive
    • Likeable
    This could be particularly helpful for managing fleets... How would the master for the variable be determined?

    E.G. if I have 10 ships each referring to a global variable called "Withdraw_Threshold," and I want to change the value of that variable, would changing the value of any one variable with that name change all of them?

    What happens when I have a global variable of "Var_X" with a value of 7, and I rename that block to "Withdraw_Threshold"? Does this alter the value of all of my "Withdraw_Threshold" variables or is the value 7 erased and set to default every time the block is renamed? Or does it immediately adopt the global value currently assigned to my other "Withdraw_Threshold" blocks?

    Just trying to imagine how this would perform in complex, multi-entity logic scenarios.
     

    Kraengis

    stuff builder
    Joined
    Jun 12, 2017
    Messages
    30
    Reaction score
    140
    I think the functionality could be added to wireless blocks, but in any case, thumbs up from me.
    Yeah, or why not make wireless blocks only with that with that functionnality but with a range of let's say one sector, while global blocks will have infinite range?

    This could be particularly helpful for managing fleets... How would the master for the variable be determined?

    E.G. if I have 10 ships each referring to a global variable called "Withdraw_Threshold," and I want to change the value of that variable, would changing the value of any one variable with that name change all of them?

    What happens when I have a global variable of "Var_X" with a value of 7, and I rename that block to "Withdraw_Threshold"? Does this alter the value of all of my "Withdraw_Threshold" variables or is the value 7 erased and set to default every time the block is renamed? Or does it immediately adopt the global value currently assigned to my other "Withdraw_Threshold" blocks?

    Just trying to imagine how this would perform in complex, multi-entity logic scenarios.
    I was thinking that each global block can change the value of the named variable, and it's updated to all others blocks with the name at the next universe tick. Also I was just thinking of binary states on/off like other logic blocks, but having the possibility to assign numbers to a logic block is interesting too, there were something alike suggested a bit ago (https://starmadedock.net/threads/pseudo-analog-logic-pid.30837/).
    About renaming, id say if the new name already exist the block take it's value but all other blocks with the previous name don't change, it would just be like if you disconnected a regular block with c-v. If it's a new name, the new variable would take the current block value/state.
     
    • Like
    Reactions: MacThule

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4
    This sounds familiar. I suspect a similar idea has been suggested before.
    I remember asking for this with Display modules. And to also add the ability to transfer variable contents instead of just the contents of the display module. That way you can use Display modules for comms and remote control.
    Yes, there was also a popular suggestion of having two blocks of the same type on two different entities that were touching to be auto-linked by proximity. Great for auto-controlling docked entities.
     
    Joined
    Jan 31, 2015
    Messages
    1,696
    Reaction score
    1,199
    • Thinking Positive
    • Likeable
    Yes, there was also a popular suggestion of having two blocks of the same type on two different entities that were touching to be auto-linked by proximity. Great for auto-controlling docked entities.
    This would be very cool.
    I am also hoping that they eventually allow conduits to acknowledge adjacency of reactor/chamber blocks on docked entities so we can rig up one-button, automated chamber hot-swaps using rail-docked entities.