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
  #121  
Old 05-18-2011, 09:11 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by TheEnlightenedFlorist View Post
Well, I've been messing around with changing spawn points for a while and I've got it mostly working except for one huge problem.
Do you mean this code does not destroy a birthplace for players who already use it?

Code:
            foreach (AiBirthPlace bp in GamePlay.gpBirthPlaces())
            {
                if (bp != null)
                    bp.destroy();
            }
Probably there is a variable in code that stores player's recent bp. Can we access and change it with a script? Or onActorDead | placeExit (or what it is called) force a player to a default bp making him to select a desired bp again?


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.
Reply With Quote
  #122  
Old 05-18-2011, 09:30 AM
klem's Avatar
klem klem is offline
Approved Member
 
Join Date: Nov 2007
Posts: 1,653
Default

Quote:
Originally Posted by Ataros View Post
Sample shows moving frontline and changing spawnpoints from red to blue and vice versa based on trigger (flyby above an airfield).

Can someone program a small 3 airfields battle based on it? Say a middle airfield becomes red or blue based on which tanks remain alive after taking the airfield. Then spawn new groups of tanks in say 20 minutes for a new round.

Code:
......................................
Hi Ataros

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
Reply With Quote
  #123  
Old 05-18-2011, 09:44 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by klem View Post
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 load delayed groups only with this submission loading script and do not know a better solution yet. http://forum.1cpublishing.eu/showpos...6&postcount=95

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();
It was a revelation for me that triggers (and probably actions) are stored in a mission file but not in a script. My bad

Last edited by Ataros; 05-18-2011 at 09:47 AM.
Reply With Quote
  #124  
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
  #125  
Old 05-18-2011, 10:12 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by TheEnlightenedFlorist View Post
Code:
        //not sure what this does either. Do some action. From where?
        AiAction action = GamePlay.gpGetAction(ActorName.Full(missionNumber, shortName));
        if (action != null)
            action.Do();
Attached is original mission. It is supposed to do as follows: on a flyby above an airfield a new enemy aircraft is spawn there and the af changes color to friendly.
Actions are listed in the mission file not the script. A surprise of the month for me! lol
Attached Files
File Type: zip airfield color change.zip (2.4 KB, 9 views)
Reply With Quote
  #126  
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
  #127  
Old 05-18-2011, 10:27 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
Attached is original mission. It is supposed to do as follows: on a flyby above an airfield a new enemy aircraft is spawn there and the af changes color to friendly.
Actions are listed in the mission file not the script. A surprise of the month for me! lol
Thanks. I'll look at that tomorrow. It's 4:30 in the morning here!
Reply With Quote
  #128  
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
  #129  
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
  #130  
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

Thread Tools
Display Modes

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 08:31 PM.


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