![]() |
Quote:
Code:
foreach (AiBirthPlace bp in GamePlay.gpBirthPlaces()) If we can change the frontline just by loading a new submission with moved frontline, why would we need the first part of the script defining the markers? I am a bit lost. I came to a simple practical idea to prevent spawning after AF is lost: 1) set trigger starting final an attack on the airfield only when all ground units on it are killed 2) load tanks attacking the af 3) load submission containing new forntline and new bp based on trigger (tanks reached af) 4) spawn arty and tanks to patrol the af. 5) anyone from the side that lost the af spawning on it is killed by arty or tanks and learns a lesson to check the frontline position before spawning. Not elegant but brutally practical. Did not have time to test it yet. Anyway we have to find out how to solve the issue in a more user-friendly way ...or ...isn't it a brutal military sim? |
Quote:
I'm slowly getting to grips with this :D I have a script for generating sub-missions, messages etc., and want to start a later flight in the same mission to make a second later attack on a convoy in the same mission but I can't seem to set a later start time in FMB Object Viewer. There's no way to change it from the main mission start time of 12:00 (which seems a bit daft). Can I script a start time for a planned mission or perhaps a spawn, aircraft. waypoints etc? I tried to follow your moving front line and army changes but I can't see how to make it work for a new flight. |
Quote:
You can try setting both a timedelay trigger and action (with the same name as trigger) in FMB in script menu but it did not work for me if I used other scripts with this mission. Maybe you can set only an "action" in FMB in script menu and then run it with a script with action.Do as in this example but delayed in time. Just guessing here. Code:
AiAction action = GamePlay.gpGetAction(ActorName.Full(missionNumber, shortName)); |
Quote:
Now that I think about it, I don't know what happens if I choose my army after the switch. It probably appears correctly then. Quote:
The reason that we can change spawn points by loading a new mission is because we can get all of the birthplaces and destroy them one by one, then let the ones in the new mission replace them. We can also create spawn points in code too, but I wanted to do that with a new mission because it was simpler. I'll try doing this tomorrow and see if it fixes my problem. |
1 Attachment(s)
Quote:
Actions are listed in the mission file not the script. A surprise of the month for me! lol |
The method I used to delay the start of a flight is as follows. There could very well (and probably is) be a better way.
1. Create a trigger that fires after the desired amount of time in the FMB. 2. Create an action that spawns the aircraft you want in the FMB. 3. Put code like this in the script file. Specifically in the OnTrigger() method. Code:
public override void OnTrigger(int missionNumber, string shortName, bool active) |
Quote:
|
Quote:
Quote:
Later I think it will be possible to script removal of 1-2 af only. BTW the greatest solution would be to have bp side changed automatically if a submission loads new frontline leaving the bp to enemy! That would be an excellent piece of code! C# geniuses are called for help :) Quote:
Quote:
Where are you located? |
1 Attachment(s)
Attached my test mission.
Frontline moves in 1800 ticks then tanks clear the captured AF from remaining enemy arty. 2 spawnpoints are placed at the same spot. Do not work as intended yet iirc. |
Quote:
Quote:
Quote:
|
All times are GMT. The time now is 05:37 AM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.