Announcement

Collapse
No announcement yet.

Issue with arrays of widget references

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Issue with arrays of widget references

    Hello,

    I'm trying to save and recreate between 1-100 custom text widgets into a chat log which displays an image corresponding to the speaking player, the character's name, and the chat text. Here is the Blueprint I am using both to add the messages to begin with (which works fine) and to reconstitute it after recreating the HUD (which doesn't).

    Click image for larger version

Name:	jHJBTcc.jpg
Views:	1
Size:	433.7 KB
ID:	1208767

    Instead of displaying each widget in the array in turn, it prints the most recent widget once for every widget I've added to the array.

    Here is the controller code that deletes and remakes the HUD (including saving the chats array while the HUD is off).

    Click image for larger version

Name:	RtnSxoO.jpg
Views:	1
Size:	468.0 KB
ID:	1208768

    Any help as to why that would happen would be much appreciated.

    #2
    Originally posted by gideoncrawle View Post
    Hello,

    I'm trying to save and recreate between 1-100 custom text widgets into a chat log which displays an image corresponding to the speaking player, the character's name, and the chat text. Here is the Blueprint I am using both to add the messages to begin with (which works fine) and to reconstitute it after recreating the HUD (which doesn't).

    [ATTACH=CONFIG]127763[/ATTACH

    Instead of displaying each widget in the array in turn, it prints the most recent widget once for every widget I've added to the array.

    Here is the controller code that deletes and remakes the HUD (including saving the chats array while the HUD is off).

    [ATTACH=CONFIG]127764[/ATTACH

    Any help as to why that would happen would be much appreciated.
    Hi, i not checked that all, but if you dont travel through levels, you dont need to save chat...

    Create master widger window and when someone send message, create simple widget box with sender name and text and add this box widget to master widget scrollbox.
    Then just show/hide master widget depending on chat traffic...
    I think there is in widget something like "child index", if some chilx have index 100 then just remove it i saw one tutorial doing this and it was simple and effective

    I think guy who have YT channel "unreal tek" have this tutorial

    Comment


      #3
      Hi! Thanks for your reply.

      My game will move between levels, so being able to store and recall the chat log is important. Thanks for the tip on removing the 100th widget, though, to keep it from becoming too cumbersome. I'll probably do it the opposite way, though, removing earlier chat messages over time (while printing all chat messages to an external log).

      Can you suggest what I might be doing wrong with the array?

      Comment


        #4
        EDIT: Nevermind, need another look
        SuperGrid: Marketplace Page | Feedback Thread | Demo | Website
        Level design and prototyping for newbies

        Comment


          #5
          Originally posted by gideoncrawle View Post
          Hi! Thanks for your reply.

          My game will move between levels, so being able to store and recall the chat log is important. Thanks for the tip on removing the 100th widget, though, to keep it from becoming too cumbersome. I'll probably do it the opposite way, though, removing earlier chat messages over time (while printing all chat messages to an external log).

          Can you suggest what I might be doing wrong with the array?
          i think that code is bad... i tried to read it but i really cant...
          i recommend you to make logic where is 100th widget automatically removed so when it comes to save/load, you dont need to play with indexes. just forloop save and forloop load.

          Comment


            #6
            I realized that there was no need to loop to remove the excessive message, because this script fires each time a chat log message is created and thus the array would never have more than one additional element over the permitted total. This is what it currently looks like. It is still producing the same error:

            Click image for larger version

Name:	chat handling.png
Views:	1
Size:	260.1 KB
ID:	1122501
            Last edited by gideoncrawle; 02-03-2017, 12:41 PM.

            Comment


              #7
              Perhaps for some reason it is simply copying the last widget in the array over and over?

              Comment

              Working...
              X