#What does your addon do?

1 messages ยท Page 1 of 1 (latest)

high prism
#

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.

grave carbon
#

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 ๐Ÿ˜…

high prism
#

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

grave carbon
#

Do you know the correct format for passing the mods? Don't think it's documented anywhere

high prism
grave carbon
#

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...

high prism
#

Like, you can also change mods without fully restarting your game

grave carbon
#

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 ๐Ÿ˜„

high prism
#

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.

grave carbon
#

It's funny they have some really interesting methods like this implemented in Enfusion, but aren't used anywhere ๐Ÿ˜…

warped tinsel
#

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

grave carbon
#

I pressume the ID's separeted with ,

warped tinsel
#

yes

#

i use array<string> addonsGUIDs = {}; GameProject.GetLoadedAddons(addonsGUIDs); and remove vanilla addon in there

high prism
#

Ah, thanks!

warped tinsel
#
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;
    }```
grave carbon
#

See, telling what you actally want to do is sometimes better than asking an abstract question ๐Ÿ˜…

warped tinsel
#

and then just

GameStateTransitions.RequestScenarioChangeTransition(m_nextScenario, GetAddonsGUIDs());```
grave carbon
#

How does it actually behave? Do players stay connected?

warped tinsel
#

yes, instant take back to loading screen

high prism
#

They reconnect seamlessly

warped tinsel
#

no reconnect just world loading as i understand

high prism
#

Possible, I don't know what's behind it

#

But it only works on dedicated servers apparently

grave carbon
#

Even if you change the mod set?

high prism
#

At least when I tried in PeerTool, it got stuck

grave carbon
#

Ye PeerTools get stuck for some reason.

warped tinsel
#

hum i think it worked with peertool ๐Ÿค”

grave carbon
#

Same issue with loading GM sessions

warped tinsel
#

didnt try changing mod set

grave carbon
#

I'll do some test runs

grave carbon
#

Which I find a bit concerning on hindsight. That could indicate that the addons parameter is actally not functional...

warped tinsel
grave carbon
#

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 ๐Ÿคฃ

warped tinsel
#

hum why would i have taken time to remove the vanilla addon then ๐Ÿค”

#

cant remember maybe its useless

grave carbon
#

What did happen if you didn't?

#

I more and mor believe it doesn't matter what you pass on dedicated

warped tinsel
#

i kinda remember an error pointing me to it but my memory is shit

fierce orchid
#

@high prism @warped tinsel You should be using ```cpp
GetGame().PlayGameConfig();

fierce orchid
grave carbon
#

Oh, my servers were occupied, so I wasn't doing it yet.

#

I'll let you know

fierce orchid
#

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

grave carbon
#

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.

fierce orchid
#

I do know if you switch scenarios at runtime the server browser shows the changes

grave carbon
#

Whut? That never worked for me

fierce orchid
#

it totally does

grave carbon
#

I'll have to do another check

fierce orchid
#

I tested and hosted a server and watched a friend join after i loaded a different mission

grave carbon
#

maybe I was too impatient

fierce orchid
#

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

grave carbon
fierce orchid
#

and when he joined it showed the correct scenario

grave carbon
#

during joining or already in the server browser itself?

grave carbon
#

interesting

fierce orchid
#

the scenario name displayed correctly

grave carbon
#

great, I have another reason to do the tests ๐Ÿ˜„

fierce orchid
#

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

grave carbon
#

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

fierce orchid
#

I do know for a fact it worked at some point

#

Have you written a UI for scenario switching?

grave carbon
#

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 ๐Ÿ˜…

fierce orchid
#

I'm gonna write a UI

#

I just don't feel like it rn lol

#

I'll show you my current testing setup

grave carbon
#

Sure

fierce orchid
#

The second action cycles through a list of missionheader configs

#

The top one starts whichever the second one has selected

grave carbon
#

How do you keep track of the cycle across reloads?

fierce orchid
#

at the end of every scenario it reloads the lobby

grave carbon
#

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

fierce orchid
#

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

grave carbon
#

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

fierce orchid
#

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?

grave carbon
#

What am I looking for?

fierce orchid
#

just search my name and tell me what it says

fierce orchid
#

Thats so odd

#

I know i've had it work before!

#

i've seen it

grave carbon
#

So you did it as host, not on dedi?

fierce orchid
#

yeah and it didn't update

grave carbon
#

hmm

fierce orchid
#

That's incredibly odd

#

Maybe it worked on the dedi and not hosting.

#

could be port related or something

#

who knows

grave carbon
#

As I said, my servers are dedi and you can check that it doesn't work either

fierce orchid
#

Its one of the first things i checked lol

#

omg, am I losing my mind or something? lol

grave carbon
#

Why?

#

What did you do? ๐Ÿ˜…

fierce orchid
#

I just swear i watched it work correctly

#

it was one of the first things i was concerned about when switching scenarios at runtime

grave carbon
#

Mine was that it would just kick off the players, since the peer clients got stuck in WB

#

glad I was wrong

fierce orchid
#

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

grave carbon
#

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 ๐Ÿ˜…

grave carbon
#

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

fierce orchid
#

@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;
}
fierce orchid
#

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

grave carbon
#

Alright, alright, I'll give it another try ๐Ÿ˜…

high prism
#

It's mostly functional, but there's still a couple of small issues.

#

I can post a screenshot later.

high prism
#

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

high prism
grave carbon
#

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.

high prism
#

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

grave carbon
#

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.

high prism
#

Mod set changes work in Singleplayer, haven't tried MP yet

#

I would assume they do, but who knows

grave carbon
#

Can you push it to the workshop as a test project?

high prism
#

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

grave carbon
#

How do you actually open Bacon's admin menu? ๐Ÿ˜…

#

Never used it before

#

nvm

high prism
#

Yeah I think loading additional addons might not work in MP

#

Either that, or I did something wrong

#

It did work in SP though

grave carbon
#

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

high prism
#

xbox or in general?

grave carbon
#

Need to do some more tests

#

I'm on PC, but I got a mate that is on xbox and tried as well

high prism
#

For me, changing mods just doesn't work on dedicated servers. It just doesn't enable them.

grave carbon
#

Ye, that's my guess that dedicated can't do that

high prism
#

It gets the correct addon string, so it can't be an UI issue.

grave carbon
#

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

high prism
grave carbon
#

I'm running it on my dedicated server right now

high prism
grave carbon
#

Maybe you have to compile the list on the server. I guess you are doing it locally atm.

high prism
#

The scenario list is being created on the server, then replicated to the client

grave carbon
#

Oh, it already is... hmm weird

high prism
#

There's probably some issue with the scenario getting method not working on dedicated

#

I mean, technically I could do it the other way around and get the scenarios locally instead

#

Because that would probably work