I want to push a button in game: #MAIN scene
create object(1)
push button;
create object(2) #just for example it may be other objects... they are added with button in game
click object(1)
load object DATA into "Menu" #Controller scene
change object(1) DATA via buttons/sliders in "Menu"
close the "Menu" saving the DATA(new) ....or... close the "Menu" keeping DATA(old)
switch scenes back to "MAIN" where the object(1) property has been updated to DATA(new) #MAIN scene again

I want to load data from object(1) into "controller scene".
Change the data in the "controller scene". SAVE or NOT
Switch to Main scene and keep the data.

I think i am not referencing the created node or its properties correctly in my code.

  • xyz replied to this.

    i can do all of this if i have the scenes in the scene tree and access them by their path. All that works for me, but when trying to do so "dynamically" in game (scene added to tree in game), i can't get the nodes reference to work in my global scene.

    REVBENT No, not like that. Forget data, controllers and scenes. Just describe what the player sees and how they're supposed to interact with it. In simple non technical language.

    i will try to refine what i have thus far and hopefully... have something working (ish) to help show what i want to do. i KNOW everything i do will be able to be seriously improved.
    you will totally understand what i'm going for when you see it. Its more than i should have done to learn UI, but its been a fun uphill lesson.

    Game wise, you are the "player" and the data IS what they interact with 😛

    click button.
    make object.
    click object.
    change several different types of data attributed to that object, color/size/labels/etc
    have main screen show the related changes and save the changes/load the changes
    sort the data based off the objects attributes when pressing button.

    • xyz replied to this.

      REVBENT So when "click object" happens, you want a global script to get this object and alter its data. You just don't know how to tell to the global script which object has been clicked?

      yes!
      and i would like to change that data/save changes to data.
      i've tried so many different ways now i'm so turned around.

      • xyz replied to this.

        REVBENT A reference to the object should be sent to the global script by a signal. Declare a custom signal in your instantiated scene. Upon instantiation connect this signal to a signal handler in the global script using connect(). When scene's button is clicked it should emit that custom signal. The reference to self can be sent as a signal argument.

          xyz Thank you. I was trying to do this the correct way i suppose. that is the reference i was passing. Accessing the "references" properties isn't working for me.
          do i declare a:

          @export var scene = singnalPATH #singalPATH is self reference

          scene.property = new_property

          if so i am doing something wrong bc it always is telling me i don't have that property on a null instance, no matter how i reference self in the signal.
          Seriously thanks for the time you always take to help me.... i feel like i owe you some cookies or beer etc.

          • xyz replied to this.

            yes i will try to do so this evening. Got doctor appointments and such with the wife today.
            As always... Hope you are having a good day, and genuinely appreciate the help!