Hi! So my server travel is not working with my level randomizer, does anyone know a way to fix this? Thanks for any help!
I think you might have a couple logic issues in the image. I’ll list them out in order of the attached picture:
(4). I don’t see a random node so I assume its handled somewhere else and your calling this event and sending it the result. If that’s the case then your not actually utilizing that value, thus in this image there is no randomness.
(3). your storing a value (I assume an incremented one) and then only utilizing it in the branch later in the execution line. assuming it starts at 0 or 1, by the time you get there you may have removed all levels from the name array, thus throwing an error? on a second look your loading levels until it hit 6, so this will attempt sever travels until then.
(2). your level load always loads/store/then removes the first index in the array, regardless of anything else, so even if everything else works you will always load the levels in the same order.
(1). the branch is specifically attached the level number from earlier and would likely be better handled with testing that the length of the level names array is >0, in case you add or remove levels, rather than being compared vs a hardcoded value.
Hi thank you so much, and sorry that I didn’t add how I randomized the levels, it was just above.
How would I fix 2? Basically, when I run this code it opens one level, and then when the timer runs out (there’s a timer set to five minutes, and after it runs out this code will be played again) it just goes straight to the end game widget. I guess that it’s probably caused by 2.
To start with you can simply connect the event int to control which level is stored and cleared. then you just need to worry about randomizing that when you call the event.
The second I add in the remove index it only wants to load 2 maps and then stops working. I took away the if statement and the remove index and it worked but then when I added in the remove index it only loaded two maps and didn’t load anymore, I plugged in the number thing as well and it still didn’t want to work. I think it might be a problem with the servertravel because it works when using an open level.
Gotcha, I’m not too familiar with servertravel so not sure then. likely your issue with it not working after a bit has to do with the branch your controlling. run it off a >0 node that is comparing the length of the level names array.
will do thanks!