![]() |
#131
|
|||
|
|||
![]() Quote:
![]() Edit: This code will loop through all BirthPlaces and print a message to the screen if a BirthPlace is on the opposite side of the front line. Code:
foreach (AiBirthPlace bp in GamePlay.gpBirthPlaces()) { if (GamePlay.gpFrontArmy(bp.Pos().x, bp.Pos().y) != bp.Army()) GamePlay.gpHUDLogCenter("Front and BirthPlace do not match!"); } ![]() Last edited by TheEnlightenedFlorist; 05-18-2011 at 11:47 PM. |
#132
|
|||
|
|||
![]() Quote:
Moscow, Russia here. Quote:
Another idea I have: If we can track a ground group position we can simplify ground mission creation to the following: - submission loads group of tanks with waypoints - script reads current frontmarker positions from the mission - every minute the game tracks tanks position and moves a frontmarker to this pos with say 3 minutes delay. if all tanks are killed within this 3 minutes the marker is not moved. - thus several groups of tanks will move the frontline in real time - enemy tanks will do the same pushing it backward - if tanks are dead a new group is spawn on trigger in some distance behind frontlines - tank battle will go on forever if players do not kill tanks themselves - after a frontline moves further than an enemy airfield the airfield turns to friendly in say 10 minutes (to allow recapture within this period) and then AAA and new tanks spawn near it to patrol it killing enemy players if spawned there (new submission loaded) If the above is possible a mission maker would have to manually create say only 10-20 tank spawning missions to have a huge battle for 10-20 cities/airfields. I think we have to place tanks waypoints manually at this point because there are no bridges at some rivers and tanks may get stuck in some villages/cities making it impossible for tanks to get from one waypoint to another if the waypoints are generated 100% automatically. But I am sure a solution to this problem can be found in the future. Have you heard of mission generator for original IL-2 by Starshoy? It automatically created online missions for IL-2 and was used in the majority of online war projects. I do not know if it is possible to convert it to C# to be used with CloD. At least some ideas can be borrowed for now I think. And another one for offline I think http://www.lowengrin.com/news.php?90 Last edited by Ataros; 05-19-2011 at 07:27 AM. |
#133
|
|||
|
|||
![]()
Some help from the devs.
File here http://www.sukhoi.ru/forum/attachmen...2&d=1305794840 Link http://www.sukhoi.ru/forum/showthrea...=1#post1622955 Quote:
Last edited by Ataros; 05-25-2011 at 07:34 AM. |
#134
|
|||
|
|||
![]()
Great thread.. very helpful. Personally not really interested in any capture the flag kind of gameplay, just not my thing, but i am playing with the random mission selection.
To this i have a question. How do i alter ths code to add a case? I could guesses and i'm sure i would get there through trial & error, but i'm sure someone here can show me ![]() Can someone add a case to the below script so i can see how it is done? Thanks! Code:
// randomly selects 1 of several submissions excluding the recent one Random RandomIncident = new Random(); int CurrentMissionSelected; do { CurrentMissionSelected = RandomIncident.Next(1, 4); } while (LastMissionLoaded == CurrentMissionSelected); LastMissionLoaded = CurrentMissionSelected; switch (CurrentMissionSelected) { case 1: GamePlay.gpPostMissionLoad("missions/Multi/15Sept1940/15Sept1940_R1.mis"); /* GamePlay.gpHUDLogCenter("mission objectives updated."); //600 initTime = 0.0; Timeout(initTime += 600, () => { GamePlay.gpHUDLogCenter("Attention! Enemy activity is expected at E3!"); }); Timeout(initTime += 600, () => { GamePlay.gpHUDLogCenter("Attention! Help is needed at E3/D4!"); })*/ ; break; case 2: GamePlay.gpPostMissionLoad("missions/Multi/15Sept1940/15Sept1940_R2.mis"); /* GamePlay.gpHUDLogCenter("mission objectives updated.."); //500 initTime = 0.0; Timeout(initTime += 500, () => { GamePlay.gpHUDLogCenter("Attention! Cover your shipping at C4!"); }); Timeout(initTime += 300, () => { GamePlay.gpHUDLogCenter("Attention! Ships are under attack at C4!"); })*/ ; break; case 3: GamePlay.gpPostMissionLoad("missions/Multi/15Sept1940/15Sept1940_R3.mis"); /* GamePlay.gpHUDLogCenter("mission objectives updated..."); //600 initTime = 0.0; Timeout(initTime += 600, () => { GamePlay.gpHUDLogCenter("Attention! Enemy activity is expected at E2!"); }); Timeout(initTime += 300, () => { GamePlay.gpHUDLogCenter("Attention! All airgroups please proceed to E2/D3!"); })*/ ; break; } Last edited by MadTommy; 05-19-2011 at 09:32 AM. |
#135
|
|||
|
|||
![]()
it is easy
Code:
switch (CurrentMissionSelected) { case 1: GamePlay.gpPostMissionLoad("missions/Multi/15Sept1940/15Sept1940_R1.mis"); /* GamePlay.gpHUDLogCenter("mission objectives updated."); //600 initTime = 0.0; Timeout(initTime += 600, () => { GamePlay.gpHUDLogCenter("Attention! Enemy activity is expected at E3!"); }); Timeout(initTime += 600, () => { GamePlay.gpHUDLogCenter("Attention! Help is needed at E3/D4!"); })*/ ; break; case 2: GamePlay.gpPostMissionLoad("missions/Multi/15Sept1940/15Sept1940_R2.mis"); /* GamePlay.gpHUDLogCenter("mission objectives updated.."); //500 initTime = 0.0; Timeout(initTime += 500, () => { GamePlay.gpHUDLogCenter("Attention! Cover your shipping at C4!"); }); Timeout(initTime += 300, () => { GamePlay.gpHUDLogCenter("Attention! Ships are under attack at C4!"); })*/ ; break; case 3: GamePlay.gpPostMissionLoad("missions/Multi/15Sept1940/15Sept1940_R3.mis"); /* GamePlay.gpHUDLogCenter("mission objectives updated..."); //600 initTime = 0.0; Timeout(initTime += 600, () => { GamePlay.gpHUDLogCenter("Attention! Enemy activity is expected at E2!"); }); Timeout(initTime += 300, () => { GamePlay.gpHUDLogCenter("Attention! All airgroups please proceed to E2/D3!"); })*/ ; break; case 4: //your code break; case 5: //your code break; } |
#136
|
|||
|
|||
![]()
And in this line you put number of your cases+1
Code:
do { CurrentMissionSelected = RandomIncident.Next(1, 4); } 5 for 4 cases etc |
#137
|
|||
|
|||
![]() Quote:
|
#138
|
|||
|
|||
![]()
Im having a bit of trouble with the command to load a new submission, and for it to load repeatedly. Here is the particular bit of script (pinched from an earlier Ataros script):
PHP Code:
its this part that doesn't seem to work: if (Time.tickCounter() % 216000 == 27000) As i understand it this means that every 216000 tick (120 mins) the action should happen (spawns bombers and shows a message), but it is postponed for 27000 ticks (15 mins). However when I run the mission what happens is after 15 minutes the bombers spawn and the message shows, but it never happens again. I have checked through the logs of various runs of this mission and it is always the same, it only runs once. Am i doing something wrong, or am I mistunderstanding the settings? What I want to happen is this: Server starts>at 15 mins-mission and message loads>2hrs after first mission loads (i.e. 2-15 server time)-mission reloads>2 hours later mission loads again... and so on as long as the main mission runs. ANy help appreciated! |
#139
|
||||
|
||||
![]() Quote:
I'm pretty new to this but I see in your code you are playing with Spawn points. I see you creating new Mission markers (front line markers) but only destroying BirthPlaces, not creating them. I want to create a new BirthPlace, a Stuka Unit and waypoints including a shipping attack to an existing mission. All this stems from the fact that I can't seem to set a delayed start time for a second sortie in FMB, I can't even see a start time for it in the .mis file, just the overall mission start time. Ataros has suggested loading a second FMB mission at the appropriate time but I don't see how I can tie that to an existing mission i.e. an existing Convoy route that receives a second attack later on. It seems I would have to show the convoy route in the new mission to include the Attack and that would duplicate the one in the first misson. Do you know the code for creating a new BirthpPlace and a Sortie in an existing mission? Thanks
__________________
klem 56 Squadron RAF "Firebirds" http://firebirds.2ndtaf.org.uk/ ASUS Sabertooth X58 /i7 950 @ 4GHz / 6Gb DDR3 1600 CAS8 / EVGA GTX570 GPU 1.28Gb superclocked / Crucial 128Gb SSD SATA III 6Gb/s, 355Mb-215Mb Read-Write / 850W PSU Windows 7 64 bit Home Premium / Samsung 22" 226BW @ 1680 x 1050 / TrackIR4 with TrackIR5 software / Saitek X52 Pro & Rudders |
#140
|
|||
|
|||
![]() Quote:
After that, create an action that will spawn the airgroup you just created. You could even make the action spawn the original airgroup if you want the second attack force to be exactly the same as the first. Just remember to uncheck "script spawn only" so that the airgroup spawns at the start of the mission like normal. The script will look like this: Code:
using System; using maddox.game; using maddox.game.world; using System.Collections.Generic; public class Mission : AMission { public override void OnTrigger(int missionNumber, string shortName, bool active) { //call base classes OnTrigger method. base.OnTrigger(missionNumber, shortName, active); //if the trigger that was called is the trigger that we're looking for if (shortName.Equals("attackConvoyDelay") && active) { AiAction action = GamePlay.gpGetAction("attackConvoy")); if (action != null) action.Do(); } } Note that I've named the trigger "attackConvoyDelay" and the action "attackConvoy". You can change them to whatever you want, just make sure they are the same in both the mission and the script. I hope this helps. ![]() |
![]() |
|
|