Jump to content
Leopard20

[SOLVED] Prevent function initialization in main menu

Recommended Posts

Hello guys.

 

Does anyone know a way to prevent functions from launching in the main menu? When I set up my functions as pre-init or post-init, they also execute in the main menu but I don't want this to happen.

Share this post


Link to post
Share on other sites
5 hours ago, pierremgi said:

Your mods? (you are the author?)

Of course! My AIO AI Menu mod!

Share this post


Link to post
Share on other sites

@Leopard20 This thread belongs more in the mod-making section but it's an interesting problem. 

 

Found this, unfortunately solution not included:

Your problem stems from that the menu is considered a mission from the engines point of view. Remember the good old menu with fighting in the background? Ye technical setup hasn't really changed much with A3. 

 

The solution seems to me would be to write your functions to detect when the functions run in menu and abort in those cases. I don't know what the condition could be but a good place to start is maybe looking at these: 

https://community.bistudio.com/wiki/missionName

https://community.bistudio.com/wiki/worldName

 

Run some tests and see if you can figure out what could work.

If you figure it out please post back. 

If not qoute or @ me and I'll take look next time I'm on my PC. 

 

5 hours ago, pierremgi said:

Your mods? (you are the author?)

The way he phrased it the obvious answer seems yes. Besides, let's not begin replies by assuming a malign intent. 

  • Thanks 1

Share this post


Link to post
Share on other sites
13 minutes ago, mrcurry said:

@Leopard20 This thread belongs more in the mod-making section but it's an interesting problem. 

 

Found this, unfortunately solution not included:

Your problem stems from that the menu is considered a mission from the engines point of view. Remember the good old menu with fighting in the background? Ye technical setup hasn't really changed much with A3. 

 

The solution seems to me would be to write your functions to detect when the functions run in menu and abort in those cases. I don't know what the condition could be but a good place to start is maybe looking at these: 

https://community.bistudio.com/wiki/missionName

https://community.bistudio.com/wiki/worldName

 

Run some tests and see if you can figure out what could work.

If you figure it out please post back. 

If not qoute or @ me and I'll take look next time I'm on my PC. 

 

The way he phrased it the obvious answer seems yes. Besides, let's not begin replies by assuming a malign intent. 

I always assumed the two sections can be used interchangeably. Sorry.

 

There are also "custom" cut scenes and worlds to account for (e.g ALiVE and Firewill's AWS). So that may not be possible.

 

If the startup screen's displayName or ID is different, that could be useful right? I'll run a hint or something at startup to see what I can find.

Share this post


Link to post
Share on other sites
22 minutes ago, Leopard20 said:

There are also "custom" cut scenes and worlds to account for (e.g ALiVE and Firewill's AWS). So that may not be possible.

It might be that missionName is always the same for the menu and that would then be quite useful. At this point rule nothing out, try everything. 

 

22 minutes ago, Leopard20 said:

If the startup screen's displayName or ID is different, that could be useful right? 

Checking the displays out is also a good idea, keep in mind it's pre-init/post-init we're talking. Some stuff might not be loaded. Definitely worth investigating though. 

Share this post


Link to post
Share on other sites
13 minutes ago, mrcurry said:

It might be that missionName is always the same for the menu and that would then be quite useful. At this point rule nothing out, try everything. 

 

Checking the displays out is also a good idea, keep in mind it's pre-init/post-init we're talking. Some stuff might not be loaded. Definitely worth investigating though. 

OK, found a solution. Not sure if it's perfect!

 if (allDisplays isEqualTo [findDisplay 0]) exitWith {};

This code prevented function initialization at startup! Yay!

 

I still have to test it during mission briefings and stuff like that. But so far looks good!

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×