Jump to content

Anyway for Mission Editor to send a message to the chat console in a multiplayer mission?


Recommended Posts

Posted

Am I correct in that that there is absolutely no Mission Editor MCU command  to send a message to the chat console or otherwise communicate with the outside world?  I have a script which parses the chat log files and a command like the Subtitle Translator does not write to them, unfortunately.  I need a simple way to signal to my custom script that certain events have happened due to mission specific logic.  

 

The only possible hackish workaround I can think of is to possibly spawn an object and hopefully have IL-2 update the mission log files (*. immediately with that spawn (i.e., parsing Atype log events in MissionReport*.txt files).   Any better or more obviously ways to accomplish this?

Posted (edited)

I'm not sure if this helps but see "Allow a Multiplayer Server Administrator to Send a Chat Message" on pg. 175 of the editor manual.

UPDATE: Ah, I think I understand what you are looking for now. Perhaps one of the server admins may know as I believe some of their setups scan for mission events to implement sophisticated logic.

Edited by JimTM
Posted (edited)

Yes, I'm trying to figure out a way for the mission events inside the editor to write to the chat window so I can process them in the chat log files using the cutchatlog remote console command.  Players and the remote console can do this since they can write directly to the chat window and the Il-2 client often writes to the chat log like when a pilot kills an object, shoots on a friendly, dies, etc.  Seems like a bit of an oversight to me not to have an MCU that can do this too

 

Edited by SCG_Limboski
Posted

The only way I know and I'm currently working on is:

 

Write a script (or program)

 

You'ld have to parse the mission logs for specific lines (the harder part)

that must be generated from inside the mission (the easy part)

to activate your desired chat output

 - Mission Objectives

 - Destroying objects with specific names

 - ...

 

 

Next is to feed the RemoteConsole from your external script/program (the hardest part)

after you connected it to the RemoteConsole

with the desired commands

 - authentificate (login)

 - send chat message...

 - ...

 

Deci

Posted (edited)
1 hour ago, JG4_Deciman said:

You'll have to parse the mission logs for specific lines (the harder part)

that must be generated from inside the mission (the easy part)

to activate your desired chat output

 - Mission Objectives

 - Destroying objects with specific names

 

I put in a vehicle in the mission editor (ME) that would (1) spawn in a vehicle via Trigger:Spawn, (2) receive some damage with Command:Damage , and then (3) get deleted with Trigger:delete .  However, none of these activities actually got recorded to the mission log files.  Can you provide a specific example?  Of course, the damage to the vehicle gets written if a player applies the damage.

 

I'll look into the mission objectives.

 

EDIT:  Okay, so completely destroying the vehicle with the command:damage MCU does report the event to the mission logs. The ME also writes the name of the vehicle destroyed (e.g. FLAG_00) which will make parsing the log files easier.  So, I now have away to signal to the outside world!  Setting a mission objective also works but is maybe less useful since the log file does not report the  name assigned to the objective.  I'm also now getting an object spawned message (ATYPE: 12) for the vehicle  which I did not see before for some strange reason.

 

Thanks!

 

 

 

 

Edited by SCG_Limboski
Posted

MissionObjectives also have a big number of information to separate...

And no need to spawn&destroy units...

 

16 Objectives * 5 Coalitions (Allies, Axis, Neutral, Entente, CentralPowers) * 2 States (Success, Failure)

 

Deci

Posted (edited)

I'll play with this more down the road but one problem I initially saw with the mission objectives is that they do not write their name you assign them (e.g., "flag_01") to the mission log file.

 

Edit: The mission objective's automatically assigned (and immutable) MCU ID is written to the log so it is ultimately identifiable via that.

 

Edited by SCG_Limboski
Posted
20 hours ago, SCG_Limboski said:

I'll play with this more down the road but one problem I initially saw with the mission objectives is that they do not write their name you assign them (e.g., "flag_01") to the mission log file.

 

Edit: The mission objective's automatically assigned (and immutable) MCU ID is written to the log so it is ultimately identifiable via that.

 

 

But to use this ID you'ld have to

- parse the mission logs (must be parsed in any case)

- parse the .Mission file

- extract the connected data

 

    MCU_TR_MissionObjective
    {
      Index = 28;
      Targets = [];
      Objects = [];
      XPos = 258146.424;
      YPos = 0.000;
      ZPos = 240274.056;
      XOri = 0.00;
      YOri = 0.00;
      ZOri = 0.00;
      Enabled = 1;
      LCName = 137;
      LCDesc = 138;
      TaskType = 15;
      Coalition = 1;
      Success = 1;
      IconType = -1;
    }

- parse the language file

- extract the LCName and/or LCDescription for the connected values inside mission file

 

I guess that is too much to parse...

 

Deci

 

 

 

Posted (edited)

You're one step ahead of me, Deci!  ;)  You're absolutely right--you could extract the Mission Objective's assigned name by  parsing both the mission text file and localization file in addition.  Yes, that is a lot of parsing.  Another possible solution, which I have not tested, is to reassign the mission objective's MCU ID  with a text editor to specific numbers ranges (which could not possibly conflict with other IDs in the mission) which have specific meaning for the daemon script.  Thanks for helping me solve this issue.

Edited by SCG_Limboski
Posted

How many different 'triggers' do you need?

 

16 * 5 * 2 possible MissionObjective variations

will give you 160 independent triggers shown in the logfiles...

 

If you need more (or more detailed information) you can also use the position of these Objectives...

It's a bit more complicated but working...

 

Deci

  • Upvote 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...