Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 04-28-2011, 09:13 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Valuable note from a developer here

Quote:
Originally Posted by MuxaHuk View Post
With new engine you can create your own game inside our game, for example: you connect to server, and server sends to you completly new user interface (no restriction, but protected by sandbox, no one can read, write or modify your data that out border of game).
New GUI, new rules of game, new score system with ranks and etc.
It can do right now, anyone for their game server.
Of course you need some knowledge of scripting and design. We will assist wherever possible to all comers.
We are working to create examples.

Imagine in the future, each server will be unique, different battles on land, in air or under water, or global war
Anyone wants to write an interface for an online war?

ATM we have some knowledge on the following:
- triggers to check if mission objectives are complete
- scripts to load new mission objectives into a current mission based on triggers
- simple interface to give players new objectives GamePlay.gpHUDLogCenter

Say if enemy tanks are destroyed in a mission, we can move frontline, change one airfield spawnpoint from blue to red and load next mission objectives. But a good interface mod would be extremely useful to show different briefings based on airfields selected, to allow relocating airgroups from airfield to airfield, manage fuel resources, routes of supply convoys, voting for a commander, etc.
There is a great game-mode mod called "Warfare" in ArmA2. I hope we can create something similar and better.
Reply With Quote
  #2  
Old 04-28-2011, 09:34 AM
MuxaHuk MuxaHuk is offline
Approved Member
 
Join Date: Nov 2009
Posts: 19
Default

This sample to use Time.current()
count in seconds from started battle.
Code:
 private double nextMsgTime = 0;
 public override void OnTickGame() {
    base.OnTickGame();
    // Time. current() in seconds from Battle Start
    if ( Time.current() > nextMsgTime ) {
      nextMsgTime = Time.current() + 10.0; // 10 seconds to next message
      GamePlay.gpHUDLogCenter( "Time elapsed (in seconds) = " + Time.current() + ", next message will be at "+nextMsgTime);
    }
  }
Reply With Quote
  #3  
Old 04-28-2011, 04:09 PM
Flashman Flashman is offline
Approved Member
 
Join Date: May 2010
Posts: 109
Default

These all are very useful posts, in fact I have borrowed a bit of the script for my own mission that I hope will appear on the Syndicate Server soon.

I have a few questions as I know nothing about these scripts

1) If I want the text that comes up with the 'GamePlay.gpHUDLogCenter' command to show to only one team, can this be done and if so how?

2) I have noriced that using these scripts with the spawn removal stops the in game action and trigger events working where it spawns an aircraft. Is there a way of using both?

Keep up the good work, and thanks for your help in advance.
Reply With Quote
  #4  
Old 04-28-2011, 05:24 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by Flashman View Post
These all are very useful posts, in fact I have borrowed a bit of the script for my own mission that I hope will appear on the Syndicate Server soon.

I have a few questions as I know nothing about these scripts

1) If I want the text that comes up with the 'GamePlay.gpHUDLogCenter' command to show to only one team, can this be done and if so how?

2) I have noriced that using these scripts with the spawn removal stops the in game action and trigger events working where it spawns an aircraft. Is there a way of using both?

Keep up the good work, and thanks for your help in advance.
1) I asked devs the same question at Sukhoi.ru.

2) Did not quite get what you mean by "spawn removal" and "trigger events working where it spawns an aircraft". Could you clarify please.
Reply With Quote
  #5  
Old 04-28-2011, 06:00 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

New bits of code from devs.

Shows mission objectives to players depending on side and aircraft type (fighter/bomber).

"hitler caput" lol

Code:
public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceEnter(player, actor, placeIndex);
        AiAircraft aircraft = actor as AiAircraft; 
        
        if (aircraft != null)
        switch (aircraft.Army())
        {                
            case 1:
                if (aircraft.Type() == AircraftType.Bomber)
                { GamePlay.gpHUDLogCenter(new Player[] {player},"Red Bomber, Bomb it all, hitler caput"); }
                else { GamePlay.gpHUDLogCenter(new Player[] { player }, "Red Fighter, fight them all"); }
                break;
            case 2:
                if (aircraft.Type() == AircraftType.Bomber)
                { GamePlay.gpHUDLogCenter(new Player[] { player }, "Das bomber!"); }
                else { GamePlay.gpHUDLogCenter(new Player[] { player }, "Das jager!"); }
                break;

        }
    }

    public override void OnAircraftTookOff(int missionNumber, string shortName, AiAircraft aircraft)
    {
        base.OnAircraftTookOff(missionNumber, shortName, aircraft);

        if (GamePlay.gpPlayer().Place() != aircraft)
            return;
        
        switch (aircraft.Army())
        {
            case 1:
                if (aircraft.Type() == AircraftType.Bomber)
                { GamePlay.gpHUDLogCenter(new Player[] { GamePlay.gpPlayer() }, "Red Bomber, Bomb it all, hitler caput"); }
                else { GamePlay.gpHUDLogCenter(new Player[] { GamePlay.gpPlayer() }, "Red Fighter, fight them all"); }
              break;
            case 2:
                if (aircraft.Type() == AircraftType.Bomber)
                { GamePlay.gpHUDLogCenter(new Player[] { GamePlay.gpPlayer() }, "Das bomber!"); }
                else { GamePlay.gpHUDLogCenter(new Player[] { GamePlay.gpPlayer() }, "Das jager!"); }
              break;

        }
    }

Last edited by Ataros; 04-28-2011 at 06:03 PM.
Reply With Quote
  #6  
Old 04-28-2011, 06:18 PM
Flashman Flashman is offline
Approved Member
 
Join Date: May 2010
Posts: 109
Default

Hi Ataros,

Hopefully I will be a little more clear this time!

I used the in-game script system using a Trigger to cause an Action to happen. Eg in my missions if a plane I select is shot down, it triggers the spawn of another plane.

EDIT>Script

Trigger: Walrus 1= Target Group destroyed (Walrus flying boat selected)
Action: Walrus 1= Air spawn group (second walrus selected)

This system works in single player, so that when the first walrus is shot down a second spawns at a preselected place. However, when I include the scripts you guys have been developing to despawn empty aircraft (for use online) the ingame script above does not work in either single or multiplayer.

Any ideas what i am doing wrong?
Reply With Quote
  #7  
Old 04-28-2011, 06:31 PM
mcler002 mcler002 is offline
Approved Member
 
Join Date: Mar 2011
Location: UK
Posts: 277
Lightbulb

I was just looking at the .mis files in notepad...


Example
Code:
[PARTS]
  core.100
  bob.100
[MAIN]
  MAP Land$English_Channel_1940
  BattleArea 200000 160000 120000 100000 9000
  TIME 5
  WeatherIndex 0
  CloudsHeight 1000
  BreezeActivity 1
  ThermalActivity 1
[GlobalWind_0]
  Power 3.000 0.000 0.000
  BottomBound 0.00
  TopBound 1500.00
  GustPower 5
  GustAngle 45
[splines]
[AirGroups]
  gb02.0F
[gb02.0F]
  Flight0  1 2 3
  Flight1  11 12 13
  Flight2  21 22 23
  Flight3  31 32 33
  Class Aircraft.BlenheimMkIV
  Formation VIC
  CallSign 31
  Fuel 86
  Weapons 1 1 2 1 1
  Detonator Bomb.Bomb_GP_250lb_MkIV 2 130 11
  Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
[gb02.0F_Way]
  NORMFLY 224480.60 255230.91 500.00 230.00
  NORMFLY 254029.14 255139.99 1000.00 230.00
  NORMFLY 274678.41 250003.49 1500.00 230.00
  NORMFLY 290803.61 240345.28 1500.00 230.00
  GATTACK_POINT 290788.83 215917.45 1500.00 230.00
  NORMFLY 290883.76 208132.47 1500.00 230.00
  NORMFLY 265387.72 208373.88 1500.00 230.00
  NORMFLY 246038.12 228039.38 1500.00 230.00
  NORMFLY 224003.28 252601.51 1500.00 230.00
[CustomChiefs]
[Stationary]
[Buildings]
[BuildingsLinks]
[Trigger]
  trigger TTime 1200
Is there any way of adding a line to prompt "end mission" at time #### ???

Also looks like we can edit aircraft here much "easier"... if you know what your doing!

NOTE - not at home to test it myself lol

Ross
Reply With Quote
  #8  
Old 04-28-2011, 09:08 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by Flashman View Post
Any ideas what i am doing wrong?
I did not learn how to use triggers yet but if you paste here a complete script I am sure someone would help.
Reply With Quote
  #9  
Old 04-30-2011, 02:09 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by Flashman View Post
Hi Ataros,

Hopefully I will be a little more clear this time!

I used the in-game script system using a Trigger to cause an Action to happen. Eg in my missions if a plane I select is shot down, it triggers the spawn of another plane.

EDIT>Script

Trigger: Walrus 1= Target Group destroyed (Walrus flying boat selected)
Action: Walrus 1= Air spawn group (second walrus selected)

This system works in single player, so that when the first walrus is shot down a second spawns at a preselected place. However, when I include the scripts you guys have been developing to despawn empty aircraft (for use online) the ingame script above does not work in either single or multiplayer.

Any ideas what i am doing wrong?
Checked ingame trigger system. Did not work with external scrips but it is by itself just fantastic! I think it is possible to achieve what I tried to do loading sub-missions into a mission with this trigger system only. I'll switch to it for a while from scripting as I do not know C#. Very helpful thread on this http://forum.1cpublishing.eu/showthr...builder&page=2

However we should try:

1) make a mission with internal triggers without script
2) make a mission with script that loads the first mission in.
3) load more missions when needed.
I will not have time to try this for a couple of days however ((

Alternatively you can program all the triggers in a script by hand. Check links in the 1st message of this thread for examples.

e.g.
Code:
  / / $ Reference Campaign.dll
 / / - $ Debug
 using System;
 using maddox.game;
 using maddox.game.world;

 public class Mission: maddox.game.campaign.Mission {

	 public override void OnTrigger (int missionNumber, string shortName, bool active)
         {
             if ("trigger". Equals (shortName) & & active)
            {
                 GamePlay.gpHUDLogCenter ("Triggers trigger");
             }   
         }
 
 }
Code:
  using System;
 using maddox.game;
 using maddox.game.world;


 class Mission: maddox.game.AMission
 {
	 public override void OnActorDead (int missionNumber, string shortName, AiActor actor, System.Collections.Generic.List <DamagerScore> damages)
	 {
		 base.OnActorDead (missionNumber, shortName, actor, damages);
		 AiAction action = GamePlay.gpGetAction ("TestAction");
		 if (action! = null)
		 {
			 action.Do ();
		 }
	 }
 }
Code:
using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;

    public class Mission : maddox.game.AMission
    {
        private List<AiAction> actions = new List<AiAction>();
        private int round = 1;
        private bool completed = false;
        
        public override void OnBattleStarted()
        {
            AiAction action = GamePlay.gpGetAction("startGroup2");
            if (action != null) actions.Add(action);
            action = GamePlay.gpGetAction("startGroup3");
            if (action != null) actions.Add(action);
            GamePlay.gpHUDLogCenter(String.Format("Раунд {0}", round));
        }

        public override void OnActorDead(int missionNumber, string shortName, AiActor actor, System.Collections.Generic.List<DamagerScore> damages)
        {
            base.OnActorDead(missionNumber, shortName, actor, damages);
            if (!(actor is AiAircraft))
                return; // Не самолет

            int army = (actor as AiAircraft).Group().Army();
            if (army == 1)
            {
                if (!completed)
                {
                    bool fail = (actor as AiAircraft).AirGroup().DiedAircrafts >= (actor as AiAircraft).AirGroup().InitNOfAirc;
                    if (fail)
                    {
                        GamePlay.gpHUDLogCenter("Миссия провалена.");
                    }
                }
            }
            else
            {
                bool next = (actor as AiAircraft).AirGroup().DiedAircrafts >= (actor as AiAircraft).AirGroup().InitNOfAirc;
                if (next)
                {
                    if (round == 3)
                    {
                        completed = true;
                        GamePlay.gpHUDLogCenter("Поздравляем, миссия пройдена!");
                    }
                    else
                    {
                        round++;
                        startNewRound();
                    }
                }
            }
        }

        private void startNewRound()
        {
            GamePlay.gpHUDLogCenter(String.Format("Раунд {0}", round));
            if (actions.Count > 0)
            {
                actions[0].Do();
                actions.RemoveAt(0);
            }
        }
    }

http://translate.google.com/translat...hp%3Ft%3D68369

Quote:
Originally Posted by mcler002 View Post
Ive tested and tested... its not working :S

Help !

Would you tell us what exactly you are trying to do and what does not work. Run my script it loads missions on timing more or less. Does not always destroy planes on the server however.

Last edited by Ataros; 04-30-2011 at 02:23 AM.
Reply With Quote
  #10  
Old 04-28-2011, 06:31 PM
Flashman Flashman is offline
Approved Member
 
Join Date: May 2010
Posts: 109
Default

Quote:
Originally Posted by Ataros View Post
New bits of code from devs.

Shows mission objectives to players depending on side and aircraft type (fighter/bomber).

"hitler caput" lol

Code:
public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceEnter(player, actor, placeIndex);
        AiAircraft aircraft = actor as AiAircraft; 
        
        if (aircraft != null)
        switch (aircraft.Army())
        {                
            case 1:
                if (aircraft.Type() == AircraftType.Bomber)
                { GamePlay.gpHUDLogCenter(new Player[] {player},"Red Bomber, Bomb it all, hitler caput"); }
                else { GamePlay.gpHUDLogCenter(new Player[] { player }, "Red Fighter, fight them all"); }
                break;
            case 2:
                if (aircraft.Type() == AircraftType.Bomber)
                { GamePlay.gpHUDLogCenter(new Player[] { player }, "Das bomber!"); }
                else { GamePlay.gpHUDLogCenter(new Player[] { player }, "Das jager!"); }
                break;

        }
    }

    public override void OnAircraftTookOff(int missionNumber, string shortName, AiAircraft aircraft)
    {
        base.OnAircraftTookOff(missionNumber, shortName, aircraft);

        if (GamePlay.gpPlayer().Place() != aircraft)
            return;
        
        switch (aircraft.Army())
        {
            case 1:
                if (aircraft.Type() == AircraftType.Bomber)
                { GamePlay.gpHUDLogCenter(new Player[] { GamePlay.gpPlayer() }, "Red Bomber, Bomb it all, hitler caput"); }
                else { GamePlay.gpHUDLogCenter(new Player[] { GamePlay.gpPlayer() }, "Red Fighter, fight them all"); }
              break;
            case 2:
                if (aircraft.Type() == AircraftType.Bomber)
                { GamePlay.gpHUDLogCenter(new Player[] { GamePlay.gpPlayer() }, "Das bomber!"); }
                else { GamePlay.gpHUDLogCenter(new Player[] { GamePlay.gpPlayer() }, "Das jager!"); }
              break;

        }
    }
THis is an interesting one, just tried it! The only thing is that for me the german one says 'Das jager' even when I am in a bomber such as the Ju87 or Ju88. Is there any setting I need to apply?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:31 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.