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-24-2011, 08:41 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by TheEnlightenedFlorist View Post

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!");
        }
I'm having fun.
Getting back to moving frontline.
Does GamePlay.gpFrontArmy(bp.Pos().x, bp.Pos().y) work at any point of map or only at frontline/border?

Where can I see the complete list of such commands/functions like GamePlay.gpFrontArmy(bp.Pos().x, bp.Pos().y)? Should I add some game files to my project in Visual Studio? Till now I only opened separate .cs files with it.
Reply With Quote
  #2  
Old 05-25-2011, 12:18 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
Getting back to moving frontline.
Does GamePlay.gpFrontArmy(bp.Pos().x, bp.Pos().y) work at any point of map or only at frontline/border?

Where can I see the complete list of such commands/functions like GamePlay.gpFrontArmy(bp.Pos().x, bp.Pos().y)? Should I add some game files to my project in Visual Studio? Till now I only opened separate .cs files with it.
Yes, it should work for any point on the map.

Visual Studio will let you see all of the methods in roundabout way. Try this:

1. File >> New >> Project Type in a name and solution name at the bottom. Don't worry about what kind of project you create.

2. On the right side under "Solution Explorer", right click on "References", "Add Reference..."

3. Click on the "Browse" tab, navigate to "Steam/steamapps/common/il-2 sturmovik cliffs of dover/parts/core"

4. Go through each .dll file in that list and try to add it. Some will give you an error, just skip those.

After you've added all the .dll files, right click on the name of your project and do "Add Existing Item". Find one of your script files and add it. Now Visual Studio will show you all the possible methods as you're typing your code. You can also go to View >> Object Browser and have a look in there.

Important: When you import an existing item, Visual Studio makes a copy of the file so any changes you make won't be reflected in the original file, you'll have to copy the new one over it. If anybody knows how to change this, I'd be quite grateful.
Reply With Quote
  #3  
Old 05-25-2011, 08:34 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Thanks a lot for detailed explanation.

BTW did you see the scripting in this mission from the devs http://forum.1cpublishing.eu/showpos...&postcount=133

I was reading it yesterday and it just blows my mind away. There are some great pieces everyone should use:

- airfield capture with removal of old arty
- generating triggers names with variables (string str = "changeArmy" + i.ToString() + "_" + (j).ToString()
- generating waypoints for bombers to attack the most close ground target
- scoring system
etc.

I'll try to convert this mission to the Channel map when I have time. Probably will need a lot of help on C# ))

Devs confirmed that there is a bug not allowing to use captured airfields before switching sides. They are working on it.
Reply With Quote
  #4  
Old 05-25-2011, 08:51 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
Devs confirmed that there is a bug not allowing to use captured airfields before switching sides. They are working on it.
Cool. All of this would be in vain otherwise.

I've only glanced at that mission, but I've already learned a few things that will make things easier.
Reply With Quote
  #5  
Old 05-25-2011, 08:57 AM
klem's Avatar
klem klem is offline
Approved Member
 
Join Date: Nov 2007
Posts: 1,653
Default

I'm having trouble giving messages to a particular side under OnTickGame because I don't know how to find out which side I am on (" 'aircraft' is not valid in this context"). Any ideas please?

Code:
public override void OnTickGame()

       {

	   if (Time.tickCounter() % 115200 == 1980) // Testing, reduced to 1 min. 1980 = 60secs delay.
	   {
		GamePlay.gpHUDLogCenter("1 minute Timetick message.");
               //issue message after further 30 seconds (test)
		double initTime = 0.0;
		Timeout(initTime += 30, () =>
		     if (aircraft != null)     //error the name aircraft does not exist in the current context
		           {
		           switch (aircraft.Army())		           {                
		    	    case 1:
			      { GamePlay.gpHUDLogCenter("Red side message."); }
             	            break;
	            	    case 2:
			      { GamePlay.gpHUDLogCenter("Blue side message"); }               
			    break;
	    	          }
                     });
           }

      }
__________________
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
  #6  
Old 06-18-2011, 05:23 AM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default I converted the Dynamic campaign onto the Channel map. Works great.

I am trying to build a Falcon 4 type game where Germans advance towards cahnnel and English must drive them back.
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 06:51 PM.


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