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
  #11  
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
  #12  
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
  #13  
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
  #14  
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
  #15  
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
  #16  
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
  #17  
Old 06-21-2012, 01:20 PM
David198502's Avatar
David198502 David198502 is offline
Approved Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,536
Default

ok tested again, with different numbers of available planes for each spawnpoint, and you are correct, its indeed showing the message that only 5planes are available....so this is good enough for me for now, as i have no glue again how and where to implement the Timeout section, without messing up the whole script....

but thinking again about the possibility, that if planes come back to base, are included again in the pool of the spawnpoint, is really attracting me...again, if you could write that for me, i would be REALLY REALLY HAPPY(maybe with the timeout section included already)

one thing that came to my mind, is that one has to be careful with the messages then, as now, the script gives out a message, as one spawns in a plane...if the feature of returning planes is included, the messages should pop up, when a plane gets destroyed, as otherwise, the warnings/messages could be wrong.......but who i am telling this....if you really decide to write such a script for me, you are certainly aware of that...
again and again and again Kodiak, during the last months, i had sooo much fun, because of your scripts you wrote for me....a BIG THANK YOU


PS:if that all is possible, i really wonder, why this havent been included on servers such like atag already???...in my view, this is a great way of having a dynamic war....besides, with the script i already have, one could for example get rid of the "self destroying" E4s on atag, which suddenly after a few seconds lose their ailerons and elevators on ground, while you are still able to spawn in them....???
__________________

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

in your code change:
Code:
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 == 5 )
                                            {
                                                Timeout(5, () => {
                                                    GamePlay.gpHUDLogCenter(null, "Attention only {0} Planes are left on {1}", new object[] { place.NumberOfPlanes, place.BirthPlace });
                                                });
                                            }
Reply With Quote
  #19  
Old 06-21-2012, 02:24 PM
David198502's Avatar
David198502 David198502 is offline
Approved Member
 
Join Date: Dec 2009
Location: Austria
Posts: 1,536
Default

doesnt seem to work for me....all the messages are gone(also available/in use -messages)
and i seem to be able to respawn infinitely...
__________________
Reply With Quote
  #20  
Old 06-21-2012, 02:31 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

then there must be a error in code can you show me your changes, may be there is a missing ";" or something else.
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:25 PM.


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