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 03-20-2012, 02:56 AM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default Make vehicles attack nearest Nutral marker

I am looking to alter some coding and do a battle on a small scale.

The idea is have a Front line marker set in Red and a frontline marker set in Blue (all over land). But also a 3rd set of markers inbetween the two battle lines that are Nutral. So the marker is not 1 or 2.

The idea is then the tanks would first attack Nearest Nutral markers as they advance Else attack nearest Enemy marker.

Code below tackles the issue of nearestEnemyMarker, but anyone have an idea of how to set them to attack and then take over a Nutral Frontmarker?

there is a lot more to the below coding but this points out the "attack nearest enemy.

Do I need to set up a int or bool at the begining stating Frontmarker 0 = Frontmarker nutral or something?


Code:
            Point3d counterPoint = new Point3d(nearestEnemyMarker.x,nearestEnemyMarker.y,0);
	        if(25000 > counterPoint.distance(ref startPoint))
	        {
		      Timeout(60, () =>
		        {
			        if(army == MissionMarkers[mmIndex].army)
			        {	// if still under control launch new combat
				        if(!FrontMissions.Exists(_x => _x.x == counterPoint.x && _x.y == counterPoint.y))
				        {
					        CreateTankMission(startPoint, army);
			        		CreateTankMission(counterPoint, enemy);
		        		};
	        		};
        		});
    		};
    	}
__________________
__________________
Win7, 64bit Ultra
Asus P8P67Pro MB
Intel i7-2600K
Coursair 16GB (4x 4GB), DDR3-1600MHz
Gainward Nvidia 580GTX 3GB DDR5
850-Watt Modular Power Supply
WIN7 and COD on Gskill SSD 240GB
40" Panasonic LCD
TrackIR5 +
Thrustmaster Warthog stick, throttle & pedals
Reply With Quote
  #2  
Old 03-20-2012, 04:55 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

if you use the Missionmarkerclass from narvy
Code:
internal class MissionMarker
    {
        internal double x;
        internal double y;
        internal int army;
        internal MissionMarker(double x, double y, int army) { this.x = x; this.y = y; this.army = army; }
    }
then you should use 0 for neutral, 1 for red and 2 for blue. In mis-file a neutral frontmarker has also the value 0
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 10:39 AM.


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