#What does your addon do?
1 messages ยท Page 1 of 1 (latest)
Mainly getting all the mods using the AddonManager
Or did you mean the grand scheme?
In any case, it's not super important anyway, since testing in Reforger does work.
Just wanted to make sure there isn't a better way.
Ye, it would be good to know what you try to accomplish, so it's hopefully easier to find workarounds/solutions
I don't see the bigger picture yet ๐
I fear there isn't really a workaround, I believe I have to use the AddonManager
But if you're just curious, I can of course tell you
Essentially, I'm looking into implementing UI for the new RequestScenarioTransition() function
Switching scenarios + mods on a live server
Do you know the correct format for passing the mods? Don't think it's documented anywhere
No, that's my main issue currently
It seems if you pass an empty string, the current mods are kept at least
It's how I implemented mission rotations with it
I'm not even sure whether the server could change its mod set on the fly without a restart...
I mean, it does reload everything, no?
Like, you can also change mods without fully restarting your game
Ye, but there is no guarantee that the server can do that as well. Anyway, just speculations we first need to figure out the correct format for the string.
Using the method with an empty string even works in the WB
ofc we don't know if that's also the case if you do change mods, so it would be safer to test in Reforger, but that's exactly the problem of it being tedious ๐
We could alternatively ask MarioE if he can tell us the format ๐
Good point
/*!
Request change of scenario.
\param resourceStr Uses string instead of ResourceName. ResourceName would be invalidated on addon reload
\param addonList List of addons to load. Leave empty for vanilla.
*/
static proto bool RequestScenarioChangeTransition(string resourceStr, string addonList);
@flat vault What format does GameStateTransitions::RequestScenarioChangeTransition() expect for the addonList string?
Edit: Nevermind, Sen told us. Sorry for the ping.
It's funny they have some really interesting methods like this implemented in Enfusion, but aren't used anywhere ๐
i use it in KOTH, addons is a list of string separated with , i can give you my method to retrieve the currently loaded addons
I pressume the ID's separeted with ,
The GUIDs?
yes
i use array<string> addonsGUIDs = {}; GameProject.GetLoadedAddons(addonsGUIDs); and remove vanilla addon in there
Ah, thanks!
private string GetAddonsGUIDs()
{
string addonIDs;
array<string> addonsGUIDs = {};
GameProject.GetLoadedAddons(addonsGUIDs);
foreach (string GUID: addonsGUIDs)
{
if (!GameProject.IsVanillaAddon(GUID))
{
if (!addonIDs.IsEmpty())
addonIDs += ",";
addonIDs += GUID;
}
}
return addonIDs;
}```
See, telling what you actally want to do is sometimes better than asking an abstract question ๐
and then just
GameStateTransitions.RequestScenarioChangeTransition(m_nextScenario, GetAddonsGUIDs());```
How does it actually behave? Do players stay connected?
yes, instant take back to loading screen
They reconnect seamlessly
no reconnect just world loading as i understand
Possible, I don't know what's behind it
But it only works on dedicated servers apparently
Even if you change the mod set?
At least when I tried in PeerTool, it got stuck
Ye PeerTools get stuck for some reason.
hum i think it worked with peertool ๐ค
Same issue with loading GM sessions
didnt try changing mod set
I'll do some test runs
you know that in your case it's not necessary to get the mods. Passing an empty string will also retain the mod set.
Which I find a bit concerning on hindsight. That could indicate that the addons parameter is actally not functional...
comment says that empty -> vanilla so didnt try
My mission rotations just work fine when passing an empty string and I have a dozend mods on
So we are not even sure whether your syntax is correct to begin with ๐คฃ
hum why would i have taken time to remove the vanilla addon then ๐ค
cant remember maybe its useless
What did happen if you didn't?
I more and mor believe it doesn't matter what you pass on dedicated
i kinda remember an error pointing me to it but my memory is shit
@high prism @warped tinsel You should be using ```cpp
GetGame().PlayGameConfig();
How did it go?
I'm curious,
Say you boot a server with X, Y, and Z mod.
But also have mod A,B and C on the server
can you then transition to a mission on A, B or C
Im betting no
I'm mostly curious if (1) the mod set can be changed in the first place and (2) how does the server browser react to it
I know that the server browser does not update the info of the scenario at least.
I do know if you switch scenarios at runtime the server browser shows the changes
Whut? That never worked for me
it totally does
I'll have to do another check
I tested and hosted a server and watched a friend join after i loaded a different mission
maybe I was too impatient
Not sure if he manually refreshed
But i do know when i joined it was the "looby" and server browser displayed such
and then i switched to Deathmatch
That's not the issue. You can join, but the server browser still shows the older scenario
and when he joined it showed the correct scenario
during joining or already in the server browser itself?
already in the browser
interesting
the scenario name displayed correctly
great, I have another reason to do the tests ๐
I think he may have hit refresh after i switched scenarios, i'd have to ask him and he probably doesn't remember
He also booted the game after I had switched the scenario iirc
Not sure if that really matters
Oh actually
That may have only happend when i was hosting
i don't actually remember if it did or not when running a dedi
Actually, you can check that it doesn't work for my servers. Have a look at Kex's Public Coop Server #1. It displays Combat Ops Enhanced (RHS), which is the name of the initial lobby and not the actual name of the Everon or Kunar scenario that are actually running
Ah, maybe it's limited to hosted servers
that would make a lot of sense
I do know for a fact it worked at some point
Have you written a UI for scenario switching?
Nah, it's a config file where you add the scenario IDs. I documented it here: #1181917381187080272 message
Not really the best solution, but it works good enough for me. Curious what TIl will come up with.
I don't really like making GUIs myself ๐
I'm gonna write a UI
I just don't feel like it rn lol
I'll show you my current testing setup
Sure
The second action cycles through a list of missionheader configs
The top one starts whichever the second one has selected
How do you keep track of the cycle across reloads?
at the end of every scenario it reloads the lobby
I do it by looking up the name of the current scenario in the cycle, but that prevents me from having the same scenario twice
ah, you have different requirements to begin with
I'm making "mini" games
currently just deathmatch because i can't figure out the end game screen stuff
Gonna do "gun game" and probably some sort of prop hunt type game modes as well
capture the flag and such
all just depend on the end game screen stuff lol
Keep in mind that ppl will most likely not see the current scenario if you run it on dedi, so you have to come up with a good generic name
Oh I don't care if it displays correctly
Generally just announce to a community and people join and we kill each other for an hour or 2
I'd prefer communities to use it as an alternative to always playing "serious" missions
I'll host a match
@grave carbon can you check the server browser in a minute?
Ye, what's up?
What am I looking for?
just search my name and tell me what it says
So you did it as host, not on dedi?
yeah and it didn't update
hmm
That's incredibly odd
Maybe it worked on the dedi and not hosting.
could be port related or something
who knows
As I said, my servers are dedi and you can check that it doesn't work either
Its one of the first things i checked lol
omg, am I losing my mind or something? lol
I just swear i watched it work correctly
it was one of the first things i was concerned about when switching scenarios at runtime
Mine was that it would just kick off the players, since the peer clients got stuck in WB
glad I was wrong
I never tested in peertool
i immediately hosted and had a friend join to see what would happen if i switched scenarios while he was connected lol
Well, it's far from perfect, but at least we have a way to change scenarios on the fly
They don't add methods for no reason, so there's hope they will eventually provide a vanilla implementation and at least by then they have to think about updating the backend ๐
Nvm, I get InvalidSessionTicket, but it seems unrelated to whether I change the mod set. Seems something wrong with the set-up I'm using for the test. If anyone else wants to test, feel free.
The results would certainly be interesting
@grave carbon It seems that the GUID and ID of addons are different
//! Return array of GUIDs of loaded addons
GameProject::GetAvailableAddons();
//! Return array of GUIDs of loaded addons
GameProject::GetLoadedAddons();
//! Return ID of addon with given GUID (only for available addons)
GameProject::GetAddonID();
so maybe
string GetAddonsList()
{
string addonsList;
array<string> availableAddons = {};
GameProject.GetAvailableAddons(availableAddons);
foreach (string GUID: availableAddons)
{
if (!addonsList.IsEmpty())
addonsList += ",";
addonsList += GameProject.GetAddonID(GUID);
}
return addonsList;
}
So from workbench that gets all the mods that are currently added to it
using GetLoadedAddons gets core,ArmaReforger and the currently opened addon. Obviously because they are currently loaded.
The question is. If i was testing this from the actual game would it get the same results
I.E. If i have 150 mods installed would it get all of them
then the question would be, If you can or cannot actually switch scenarios on the server and load more mods in the process
Alright, alright, I'll give it another try ๐
I'm making UI for it, yes.
It's mostly functional, but there's still a couple of small issues.
I can post a screenshot later.
I decided to add new tabs to bacons Server Admin Tools instead of making another UI from scratch
Currently my main issue is that getting mod scenarios doesn't work
I was using WorkshopApi::GetPageScenarios() as it's done in e. g. SCR_GameLogHelper, but apparently it doesn't work when ingame, it just returns an empty array
Theoretically I could spawn an AddonManager, use it to get the SCR_WorkshopItems and get the scenarios from there, but that's quite the ugly solution
Fixed it.
So does that mean you can't change the mod set?
But looks already great. Maybe it could be directly integrated in the admin tool if Bacon is interested.
No, I just had an issue in my code that resulted in mod scenarios not being displayed. I fixed it since.
And I did ask bacon, but he isn't interested
Oh well then
If you need some tests on dedicated, let me know ๐
The really remaining question is whether the mod set can be changed or not.
Mod set changes work in Singleplayer, haven't tried MP yet
I would assume they do, but who knows
Can you push it to the workshop as a test project?
Still heavily WIP though
The actual addon changing UI isn't actually fully replicated yet, so I don't think it will work on servers
Yeah I think loading additional addons might not work in MP
Either that, or I did something wrong
It did work in SP though
The menu works in MP as well,
Loading scenarios already works, even on xbox.
I tried to change the mods as well, but it crashed the game
xbox or in general?
Need to do some more tests
I'm on PC, but I got a mate that is on xbox and tried as well
For me, changing mods just doesn't work on dedicated servers. It just doesn't enable them.
Ye, that's my guess that dedicated can't do that
It gets the correct addon string, so it can't be an UI issue.
Alright, the crash was probably something else, but yeah, no changes in the mod set when I try to apply them
I would just disable the tab when you are not the host and call it a day ๐
It's already a nice feature
Actually, it only shows me all vanilla scenarios. None of the modded ones
even though I have Kunar and such loaded
Did you test it using the Workbench dedicated server tool, or in a standalone environment?
I'm running it on my dedicated server right now
Interesting. They do show up in Singleplayer.
Maybe you have to compile the list on the server. I guess you are doing it locally atm.
I don't think that's the issue
The scenario list is being created on the server, then replicated to the client
Oh, it already is... hmm weird