![]() |
#121
|
|||
|
|||
![]() Quote:
Code:
foreach (AiBirthPlace bp in GamePlay.gpBirthPlaces()) { if (bp != null) bp.destroy(); } 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? Last edited by Ataros; 05-18-2011 at 09:30 AM. |
#122
|
||||
|
||||
![]() Quote:
I'm slowly getting to grips with this ![]() 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.
__________________
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 |
#123
|
|||
|
|||
![]() 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)); if (action != null) action.Do(); ![]() Last edited by Ataros; 05-18-2011 at 09:47 AM. |
#124
|
|||
|
|||
![]() 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. |
#125
|
|||
|
|||
![]() Quote:
Actions are listed in the mission file not the script. A surprise of the month for me! lol |
#126
|
|||
|
|||
![]()
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) { //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("triggerName") && active) { AiAction action = GamePlay.gpGetAction("actionName")); if (action != null) action.Do(); } |
#127
|
|||
|
|||
![]() Quote:
![]() |
#128
|
|||
|
|||
![]() 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:
![]() ![]() ![]() Where are you located? Last edited by Ataros; 05-18-2011 at 10:40 AM. |
#129
|
|||
|
|||
![]()
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. |
#130
|
|||
|
|||
![]() Quote:
Quote:
![]() Salt Lake City, Utah, USA. Opposite side of the planet. ![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|