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
  #71  
Old 04-29-2011, 08:49 AM
mcler002 mcler002 is offline
Approved Member
 
Join Date: Mar 2011
Location: UK
Posts: 277
Default

1st number = repeat i.e if it was 108000 - the map/ mission should load every 1hour...

2nd number = start time i.e. if it was 18000 = the map/mission should start within 10 minutes of the game start, or repeat interval...

But i dont think it works 100%... but as i have been told 1800 ticks "roughly" equals a minute...
Reply With Quote
  #72  
Old 04-29-2011, 09:24 AM
Flashman Flashman is offline
Approved Member
 
Join Date: May 2010
Posts: 109
Default

Quote:
Originally Posted by mcler002 View Post
1st number = repeat i.e if it was 108000 - the map/ mission should load every 1hour...

2nd number = start time i.e. if it was 18000 = the map/mission should start within 10 minutes of the game start, or repeat interval...

But i dont think it works 100%... but as i have been told 1800 ticks "roughly" equals a minute...
Cool, thanks.

I actually did some offline testing and set the timings to minutes adn sped things up! It appears to work roughly as you say... it will do for now!
Reply With Quote
  #73  
Old 04-29-2011, 09:30 AM
mcler002 mcler002 is offline
Approved Member
 
Join Date: Mar 2011
Location: UK
Posts: 277
Smile

Quote:
Originally Posted by Flashman View Post
Cool, thanks.

I actually did some offline testing and set the timings to minutes adn sped things up! It appears to work roughly as you say... it will do for now!
Yea i did offline testin as well... but x16 is just not fast enough lol! only went a couple of hours in...
Reply With Quote
  #74  
Old 04-29-2011, 11:15 AM
mcler002 mcler002 is offline
Approved Member
 
Join Date: Mar 2011
Location: UK
Posts: 277
Default AI damage & destory

Ive tested and tested... its not working :S

Help !
Reply With Quote
  #75  
Old 04-30-2011, 12:58 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Just to have it all in one thread

Quote:
Originally Posted by MuxaHuk View Post
Code:
public override void OnPlaceLeave(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceLeave(player, actor, placeIndex);
        Timeout(1, () =>
        {
            AiAircraft CurAircraft = player.Place() as AiAircraft;
            AiAircraft PrevAircraft = actor as AiAircraft;
            if (CurAircraft != PrevAircraft)   
                { (actor as AiAircraft).Destroy(); }
        });
    }
Reply With Quote
  #76  
Old 04-30-2011, 01: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 01:23 AM.
Reply With Quote
  #77  
Old 04-30-2011, 05:17 AM
mcler002 mcler002 is offline
Approved Member
 
Join Date: Mar 2011
Location: UK
Posts: 277
Default

I have pretty much copied and pasted your scripting ...

I always right click and compile to see if the script is OK, which it is ... So when ever I try and test it ... My ai bots are still flying

At the current time I am in the middle of making a new online map with less 'repeat mission' loading, and more internal triggers

But as you have posted above, I will need script for 'triggers' to flash messages on the screen about incoming planes etc ...

I shall give the above a try when I'm on my pc later!
Reply With Quote
  #78  
Old 04-30-2011, 02:25 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by mcler002 View Post
So when ever I try and test it ... My ai bots are still flying
Ahh, if you mean bot removal script, it works on my PC when I create a server, but does not work on a dedi server somehow ((
The issue reported to the devs already.

Try the second script I copied from sukhoi.ru.

Just uploaded a new mission into missions thread. http://forum.1cpublishing.eu/showpos...3&postcount=31

Last edited by Ataros; 04-30-2011 at 02:53 PM.
Reply With Quote
  #79  
Old 04-30-2011, 03:10 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Do you try ABattle and not AMission?
Reply With Quote
  #80  
Old 04-30-2011, 04:19 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by FG28_Kodiak View Post
Do you try ABattle and not AMission?
This is the latest script I used. Do you mean I should change
public class Mission : AMission
to
public class Mission : ABattle
Should I?
Every script I have seen uses AMission I think.

Code:
// v.1.6.14

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

public class Mission : AMission
{

    // loads my sub-missions
    public override void OnTickGame()
    {

            if (Time.tickCounter() % 72000 == 18000) // 40-10
            {
            GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/128BoF/128BoFv1_6Ground1.mis");
            GamePlay.gpHUDLogCenter("Protect friendly shipping in the channel near France!");
            }

            if (Time.tickCounter() % 72000 == 71999) // 40-40 
            {
                GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/128BoF/128BoFv1_6Bombers1.mis");
				GamePlay.gpHUDLogCenter("Intel: Enemy bombers are heading to blue airfields!"); 
			}
        
            if (Time.tickCounter() % 72000 == 45000) // 40-25
			{
                GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/128BoF/128BoFv1_6Bombers2.mis");
                GamePlay.gpHUDLogCenter("Intel: Enemy bombers are heading to red airfields in France!"); 
			}

         
    }

    // destroys aircraft abandoned by a player
    public void _DespawnEmptyPlane(AiActor actor)
    {
        if (actor == null)
        { return; }

        Player[] Players = GamePlay.gpRemotePlayers();

        bool PlaneIsEmpty = true;

        foreach (Player i in Players)
        {
            if ((i.Place() as AiAircraft) == (actor as AiAircraft))
            {
                PlaneIsEmpty = false;
                break;
            }
        }

        if ((PlaneIsEmpty) && (actor as AiAircraft).IsAirborne())
        {

            (actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsElevatorDisabled);
            (actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsAileronsDisabled);
            (actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsRudderDisabled);
            (actor as AiAircraft).hitNamed(part.NamedDamageTypes.Eng0TotalFailure);
            //for 2mots
            (actor as AiAircraft).hitNamed(part.NamedDamageTypes.Eng1TotalFailure);

            //then wait 10min
            Timeout(600.0, () =>
            {
                if (actor is AiAircraft)
                {
                    (actor as AiAircraft).Destroy();
                }
            });

        }
        else if (PlaneIsEmpty)
         {
                if (actor is AiAircraft)
                {
                  (actor as AiAircraft).Destroy();
                }
         }; 
    }

    public override void OnPlaceLeave(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceLeave(player, actor, placeIndex);
        _DespawnEmptyPlane(actor);
    }
    // destroys crushlanded aircraft in 10 minutes
    public override void OnAircraftCrashLanded(int missionNumber, string shortName, AiAircraft aircraft)
    {
        base.OnAircraftCrashLanded(missionNumber, shortName, aircraft);
        Timeout(600, () =>

        {
            if (aircraft != null) 
            { 
            aircraft.Destroy();
            }
        });
    } 
}
Reply With Quote
Reply


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 11:46 AM.


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