PDA

View Full Version : Custom ingame menus introduced


Ataros
09-07-2011, 12:37 PM
Now you can include any custom menu into your mission for players to use. See code example from naryv below.

The menu is called by pressing <Tab> +<4>

I am thinking about some usage examples. I assume it allows for instance:
- assign new waypoints to AI
- request fighter support
- request bomber missions
- report recon mission results over recon target
- spot enemy units, sending their pos to MP chat
- vote for commander and officers in MP missions
- allow officers to select next target, mission type, etc. for a side in MP
- get any other feedback from players that a mission script may need

Post your ideas below please :)

using System;
using System.Collections;
using maddox.game;
using maddox.game.world;

public class Mission : AMission {

private void setMainMenu( Player player ) {
GamePlay.gpSetOrderMissionMenu( player, false, 0, new string[] { "1", "2", "3" }, new bool[] { true, false, false } );
}
private void setSubMenu( Player player ) {
GamePlay.gpSetOrderMissionMenu( player, true, 1, new string[] { "1-1", "1-2", "1-3" }, new bool[] { false, false, false } );
}

public override void OnOrderMissionMenuSelected( Player player, int ID, int menuItemIndex ) {
if( ID == 0 ) { // main menu
if( menuItemIndex == 1 ) {
GamePlay.gpHUDLogCenter("Menu selected Loading mission aaa2.mis");
GamePlay.gpPostMissionLoad("missions\\aaa2.mis");
setSubMenu( player );
}
} else if( ID == 1 ) { // sub menu
setMainMenu( player );
}
}

public override void OnPlayerConnected( Player player ) {
if( MissionNumber == 0 ) {
setMainMenu( player );
}
}

public override void Inited() {
if( MissionNumber == 0 ) {
setMainMenu(GamePlay.gpPlayer());
}
}
}

Phazon
09-07-2011, 02:07 PM
This opens up alot of possibilities. It would be nice if MG provided us with some examples to learn from. :)

ATAG_Doc
09-07-2011, 02:20 PM
Very interesting! +1

Strike
09-07-2011, 03:06 PM
maybe this is the secret new feature?

Battlefield commanding?

Would be awesome! Have 1 comm on each side launch waves of attackers etc :)

Blackdog_kt
09-07-2011, 11:55 PM
Absolutely fantastic. That's exactly the "under the hood" features i was referring to.

Up till now the map had to populated via the FMB and depending on MP mode (coop or DF), the missions were either completely free form ad hoc sorties to some predefined targets in DF mode or completely predetermined sorties also made in the FMB in the case of coop mode.

Currently we see that it's possible for the map to be populated by scripts that spawn AI ground units in a dynamic sandbox environment.

Within a year of this game's release (and it's not that far away, we're 6 months in already) we might very well be able to plan our own sorties from within the server lobby to fly in such an environment.

You return from a fighter sweep sortie and spot enemy movement on the ground? Mark the location on your map and upload it to your team. Another player sees that and throws down some waypoints to fly a photo reccon sortie. Assuming he returns home safely, a script with a time delay function produces a black and white screenshot that can be annotated via a custom menu. The player marks targets and compass points on the photo, attaches it as a slide to a map marked with the last known location of the enemy ground units and uploads it to his team again.

Another player decides to fly an attack on that target, he draws up his waypoints, selects a loadout and spawns an aircraft group inviting other players to fly with him, if nobody does then the AI will fly with him. Of course aircraft are not unlimited, each base has a supply of total aircraft, usable aircraft, aircraft in the maintenance hangar, as well as ammo stores and fuel supplies, all replenished via AI ground columns, trains, transport planes, etc...if the supplies get attacked and destroyed on the way to the airfield you might not be able to use everything.

But let's assume there is enough aircraft and supplies and enough players. So, they get invited to fly that raid, they spawn inside the previously AI aircraft and go fly. Then, the results of the sortie are tracked server side and this also influences supplies or frontline movement for the defending team. And so on...

Fantasy? It was and still is, but i'm not sure it will be for much longer ;-)

That's exactly the kind of stuff that can make this sim great in the long run and why it was worth it weathering through the initial storm of a rocky release and bugs.

fearlessfrog
09-08-2011, 03:50 AM
Thanks Ataros, I'll have a play around.

One initial idea is that it would be great to be able to land in MP and then request a re-fuel and re-arm.

I might try something simple in a SP mission first though.

Edit: Here's one I did very quickly - all seems to work. Good job devs!

http://simhq.com/forum/ubbthreads.php/topics/3385237.html

Ataros
09-08-2011, 10:38 AM
Thanks Ataros, I'll have a play around.

One initial idea is that it would be great to be able to land in MP and then request a re-fuel and re-arm.

I might try something simple in a SP mission first though.

Edit: Here's one I did very quickly - all seems to work. Good job devs!

http://simhq.com/forum/ubbthreads.php/topics/3385237.html

Thanks! Great example!

Could you please make a menu for MP to spot targets and request help which will just print messages in chat for the player's side?

E.g.

Menu
1. Request
1.1. Fighter support
1.2. Bomber strike

2. Spot
2.1. Fighters
2.2. Bombers
2.3. Armor
2.4. Vehicles
2.5. Shipping

3. Squad/wingman
3.1. Fighters, regroup at pos.
3.2. Bombers, regroup at pos.

The script is to check in which map grid a player is located and print a message in side chat, e.g. "Enemy fighters are spotted at map grid ...", etc.

This script will be useful in any online mission.

ps. I do not know C# myself good enough to write scripts, I can only read them and understand something sometimes :)

adonys
09-08-2011, 11:54 AM
Just have a look in here (http://code.google.com/p/il2dce/wiki/Proposals)

Ataros
09-23-2011, 09:44 PM
Just have seen the menus working on III./JG27 Server http://forum.1cpublishing.eu/showthread.php?t=25064
Well done!

I have an idea to motivate teamwork on an online server using these menus (similar to what PR mod makes to ArmA2):
- players are allowed to create a temporary squad via the menu
- other players can join existing squads
A squad can generate AI missions as follows:
- squad pilots spawn at an airfield
- then a squad leader selects e.g. "Spawn bombers" from menu
- number of AI bombers is spawn equal to number of squad members present at the airfield (the more players in a squad, the more AI is spawned)
- the leader selects a target for bombers from a list of available ones
- the opposing side receives intel about the incoming raid with probability of say 60% and only if they have 2+ recon missions up in the area
- other incentives can be added, e.g. 2 players can generate only a recon mission, 4 players - ground attack mission, 6+ players - strategic bombing mission, etc.

This would not replace existing squads of cause but would motivate to get on teamspeak and fly in wings and more important would motivate existing players talk their old squad members into upgrading PCs and getting into CloD to kick some arse :)

SNAFU
09-24-2011, 10:01 AM
I think these menus open a room for a lot of ideas. Unfortunatly my scripting abilities are really limited, but I am slowly figuring out the basics. I more or less grab everything I can find, try to understand it, put pieces together and look what happens... ;)

But someone familar with C# can do wonders with these scripts. I am personally not looking to introduce some "Commanding" on our server like ArmAII Warfare for example, due to the fact that we are orientating on the simple pilots point of view, but to a small extend the next step, I want to take, is rather simple, like exchanging scores for new planes and transfers of certain planes to certain airfields, so the player can make a transfer flight, and then use the planes from that airfield. That would be feasable with my limited scripting skills and would not abandon our focus on the one-of-many-simple-pilot approach.