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 05-18-2011, 10:12 AM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

Quote:
Originally Posted by Ataros View Post
Do you mean this code does not destroy a birthplace for players who already use it?
Not exactly. It doesn't matter if I've ever spawned from that particular base or not. If I was on red team before the switch, I can still spawn that base after the switch. On the contrary, if I was on blue team before the switch, I can't spawn at the new base after the switch. Of course, this all only applies to me as the host of the server. I can't confirm that the same is true of a client connected to a server.

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:
Originally Posted by Ataros View Post
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.
We can't load a new frontline by loading a new submission because as far as I know, there is no way to delete front markers that were created in a mission file. Basically, because we create the front markers ourselves in code, it's easier to keep track of them and change them. If you open my mission in the FMB, you'll see that there are no mission markers in the .mis file. I add these in code as soon as the mission is loaded.

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.
Reply With Quote
  #2  
Old 05-18-2011, 10:22 AM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

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();

        }
"triggerName" and "actionName" are the names that you gave the trigger and action in the FMB.
Reply With Quote
  #3  
Old 05-18-2011, 10:34 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by TheEnlightenedFlorist View Post
We can't load a new frontline by loading a new submission because as far as I know, there is no way to delete front markers that were created in a mission file. Basically, because we create the front markers ourselves in code, it's easier to keep track of them and change them.
IIRC the devs mentioned that frontline is replaced automatically. I experimented with it 2 weeks ago and it moved, again IIRC. Try it. I thought I mentioned this in my previous posts. I can be mistaken of cause, will try to find my test missions later.

Quote:
Originally Posted by TheEnlightenedFlorist View Post
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.
Great idea! I thought that we have to delete only one bp and that gave me headache ))
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:
Originally Posted by TheEnlightenedFlorist View Post
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.
I think placing everything in code gives more flexibility for a larger war/campaign where everything has to be automated (many battles for many cities and airfields). But adds complexity to coding. For a small mission with 5-8 submissions it would be easier to use FMB imho both for frontline and spawnpoints if possible.

Quote:
Originally Posted by TheEnlightenedFlorist View Post
It's 4:30 in the morning here!


Where are you located?

Last edited by Ataros; 05-18-2011 at 10:40 AM.
Reply With Quote
  #4  
Old 05-18-2011, 11:14 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

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.
Attached Files
File Type: zip BoF2.zip (16.7 KB, 12 views)
Reply With Quote
  #5  
Old 05-18-2011, 11:02 PM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

Quote:
Originally Posted by Ataros View Post
IIRC the devs mentioned that frontline is replaced automatically. I experimented with it 2 weeks ago and it moved, again IIRC. Try it. I thought I mentioned this in my previous posts. I can be mistaken of cause, will try to find my test missions later.
Just tried it. You are correct. That makes things a little bit simpler.

Quote:
Originally Posted by Ataros View Post
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
I saw a method that looks like it could tell me which side of the front a particular point is on so this is probably very possible. Just one more thing I need to experiment with.

Quote:
Originally Posted by Ataros View Post
Where are you located?
Salt Lake City, Utah, USA. Opposite side of the planet.
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 12:47 AM.


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