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 06-21-2012, 08:12 AM
David198502's Avatar
David198502 David198502 is offline
Approved Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,536
Default

hey Kodiak, i tried your script, and it seems to work...
i put it into my mission, and adjusted the names of the spawnareas in the script, as well as the messages which pop up.everything works like a treat, even with more waypoints on one side!
thank you very much, i think for now, this is perfect for my use....although if you have spare time and if you are in the mood, then i would really appreciate, if you could inlcude all my wishes from my above post,.....one day.


Edit: now that i have my big yellow messages, i wonder how it is possible, to change the server messages....
i saw on some servers, that the normal messages like "AI SpitfireIa has been destroyed by...."(the small white ones, which appear if you killed someone or get killed) were adjusted..i dont know anymore on which server i saw this, but there the server was stating something like "...JG26_DavidRed kicked Ki SpitfireIa in the ass...."
i will probably not use this phrase, but i think something more funny could be added than the default phrase...
__________________

Last edited by David198502; 06-21-2012 at 08:52 AM.
Reply With Quote
  #2  
Old 06-21-2012, 10:51 AM
David198502's Avatar
David198502 David198502 is offline
Approved Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,536
Default

thx Kodiak again for your limitbirthplace script...works great even with more spawnpoints on one side...
the only thing now is, that if i have more than one spawnpoint on one side, then the message, warining that only 5planes are left on the one side, is dependent on each spawnpoint, and not on the total number of planes available on one side....
i would like to keep the messages, warning that one spawnpoint has only x planes left, but would like to have the message included, warning the team, if the total number of available planes is left to 5....
__________________
Reply With Quote
  #3  
Old 06-21-2012, 11:30 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Change OnPlaceEnter to:
Code:
 public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceEnter(player, actor, placeIndex);

        AiBirthPlace birthPlace = GetBirthplace(actor);


        AiCart cart = actor as AiCart;

        if(cart != null)
        AvailablePlanes.ForEach(place =>
                                    {
                                        if (place.BirthPlace == birthPlace.Name())
                                        {
                                            
                                            place.NumberOfPlanes--;

                                            int numberOfAllAvailablePlanes = CountAvailablePlanes(actor.Army());

                                            if (numberOfAllAvailablePlanes == 5)
                                            {
                                                if(actor.Army() == 1)
                                                    GamePlay.gpHUDLogCenter(null, "Attention Reds only {0} Planes are left", new object[] { numberOfAllAvailablePlanes });
                                                if(actor.Army() == 2)
                                                    GamePlay.gpHUDLogCenter(null, "Attention Blues only {0} Planes are left", new object[] { numberOfAllAvailablePlanes });
                                            }

                                            if (place.NumberOfPlanes == 0)
                                            {
                                                GamePlay.gpHUDLogCenter(null, "Attention {0} is no longer available", new object[]{place.BirthPlace});
                                                birthPlace.destroy();
                                            }
                                        }
                                    });
    }
Edith: Hatte die Seite bei der Meldung nicht berücksichtig.

Last edited by FG28_Kodiak; 06-21-2012 at 12:06 PM.
Reply With Quote
  #4  
Old 06-21-2012, 12:10 PM
David198502's Avatar
David198502 David198502 is offline
Approved Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,536
Default

ah ok....werds gleich ausprobieren!
__________________
Reply With Quote
  #5  
Old 06-21-2012, 12:19 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Hm forgotten i am on an english speaking forum
Reply With Quote
  #6  
Old 06-21-2012, 12:28 PM
David198502's Avatar
David198502 David198502 is offline
Approved Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,536
Default

mhh me as well

ok this works, but then the message, warning that only x planes are left for a certain spawnpoint is gone....so i added this, assuming that i can get both messages to pop up, the one warning that a spawnpoint is short on planes, and the one warning the team that it has only 5planes left in total...but this seems to not work...the message warning the team that only 5planes in total are left, is not popping up...unfortunately...i almost thought, that at least once i could sort a problem out for myself


HTML Code:
     public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceEnter(player, actor, placeIndex);

        AiBirthPlace birthPlace = GetBirthplace(actor);


        AiCart cart = actor as AiCart;

        if(cart != null)
        AvailablePlanes.ForEach(place =>
                                    {
                                        if (place.BirthPlace == birthPlace.Name())
                                        {
                                            
                                            place.NumberOfPlanes--;

                                            int numberOfAllAvailablePlanes = CountAvailablePlanes(actor.Army());

                                            if (numberOfAllAvailablePlanes == 5)
                                            {
                                                if(actor.Army() == 1)
                                                    GamePlay.gpHUDLogCenter(null, "Attention Reds only {0} Planes are left", new object[] { numberOfAllAvailablePlanes });
                                                if(actor.Army() == 2)
                                                    GamePlay.gpHUDLogCenter(null, "Attention Blues only {0} Planes are left", new object[] { numberOfAllAvailablePlanes });
                                            }

                                            if (place.NumberOfPlanes == 3 )
                                            {
                                                GamePlay.gpHUDLogCenter(null, "Attention only {0} Planes are left on {1}", new object[] { place.NumberOfPlanes, place.BirthPlace });
                                            }

                                            if (place.NumberOfPlanes == 0)
                                            {
                                                GamePlay.gpHUDLogCenter(null, "Attention {0} is no longer available", new object[]{place.BirthPlace});
                                                birthPlace.destroy();
                                            }
                                        }
                                    });
    }
__________________
Reply With Quote
  #7  
Old 06-21-2012, 12:33 PM
David198502's Avatar
David198502 David198502 is offline
Approved Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,536
Default

oh and one more thing....is it possible, that if a plane lands safely on a homebase that this plane will "get back" into the list(pool) of available planes?so that the the number of available planes for that spawnpoint(where the plane startet from) will not decrease in numbers, when the plane manage to make it back to a friendly airfield...?
or in other words, if a plane manages to make it back home safely, that "this" plane can be used again
__________________

Last edited by David198502; 06-21-2012 at 12:35 PM.
Reply With Quote
  #8  
Old 06-21-2012, 12:43 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Quote:
Originally Posted by David198502 View Post
the message warning the team that only 5planes in total are left, is not popping up...unfortunately...i almost thought, that at least once i could sort a problem out for myself
its 'popping up' but its overridden by the next message so you only see the last, to avoid this you can use Timeout
Example:
Code:
GamePlay.gpHUDLogCenter(null, "First", null);

Timeout(5, () => {
                           GamePlay.gpHUDLogCenter(null, "Second", null);
                       });
Quote:
oh and one more thing....is it possible, that if a plane lands safely on a homebase that this plane will "get back" into the list(pool) of available planes?so that the the number of available planes for that spawnpoint(where the plane startet from) will not decrease in numbers, when the plane manage to make it back to a friendly airfield...?
or in other words, if a plane manages to make it back home safely, that "this" plane can be used again
Yes its possible but the code then needs some rework.
Reply With Quote
  #9  
Old 06-21-2012, 12:55 PM
David198502's Avatar
David198502 David198502 is offline
Approved Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,536
Default

Quote:
Originally Posted by FG28_Kodiak View Post
its 'popping up' but its overridden by the next message so you only see the last, to avoid this you can use Timeout
Example:
Code:
GamePlay.gpHUDLogCenter(null, "First", null);

Timeout(5, () => {
                           GamePlay.gpHUDLogCenter(null, "Second", null);
                       });

Yes its possible but the code then needs some rework.
i would really appreciate, if you could do that, if its not too much rework....
__________________
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 04:48 PM.


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