[Added] Way to disable "netevent cannot be used outside of a map"

Moderator: GZDoom Developers

Way to disable "netevent cannot be used outside of a map"

Postby m8f » Sun Dec 30, 2018 7:48 am

Situation:
1. Have a mod that has a key for calling a netevent, for example:
Code: Select allExpand view
alias test_netevent "echo test; netevent test"
AddKeySection "Test" "TestKeys"
AddMenuKey "Netevent Key" "test_netevent"

2. On the intermission screen, press the key that should case netevent;
3. Receive a message:
Code: Select allExpand view
netevent cannot be used outside of a map.


Example mod:
test_netevent.wad
(149 Bytes) Downloaded 10 times


This message doesn't break anything, it just looks out of place and may confuse the end user.
It is the one of rare cases when ACS-based script does better job than ZScript-based one: "pukename something" doesn't cause a message to appear in intermission screen.

Maybe this message should be only shown if "developer" CVar is set to some non-zero value.
Or there could be a way to check if the any map is currently loaded in the console, so it can be checked in keyconf with "test" command.

It is possible to make a script that will set a CVar each time the map is loaded and unloaded, and that CVar could be tested in keyconf. But it feels hacky, and I'm not sure it will reliably work in all use cases.
It is also possible to wrap netevent call in ACS script that does a ScriptCall, but it's not a nice way either.
User avatar
m8f
 
 
 
Joined: 29 Dec 2017
Discord: m8f#0629
Github ID: mmaulwurff

Re: Way to disable "netevent cannot be used outside of a map

Postby m8f » Sat May 18, 2019 3:39 am

Made a PR: made this message a warning.
User avatar
m8f
 
 
 
Joined: 29 Dec 2017
Discord: m8f#0629
Github ID: mmaulwurff


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest