1C Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official 1C Company forum > 1C Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

Reply
 
Thread Tools Display Modes
  #21  
Old 09-14-2011, 02:37 AM
Sokol1's Avatar
Sokol1 Sokol1 is offline
Approved Member
 
Join Date: Oct 2007
Posts: 727
Default

Quote:
Originally Posted by Lookaloft View Post
Unfortunately I can’t get the Naryv script to work. I copied the script in Notepad and saved it under ANSI as an cs mission.
I copy the script direct in FMB window, so when save the mission the script is save too.



After a ''perfect'' wheels up landing they send me winch, fuel, ammo and bombs (spend previous load before landing)!
Ambulance is not need.

Sokol1
Reply With Quote
  #22  
Old 09-14-2011, 05:02 AM
fearlessfrog fearlessfrog is offline
Member
 
Join Date: Jul 2010
Posts: 64
Default

Quote:
Originally Posted by Das Attorney View Post
Thanks for the hard work and research on these scripts. Some really awesomesauce going on in this thread.

I was wondering if someone could help me though. I'm using naryv's script to dispatch ambulances etc in a MP dogfight. There's also AI planes that periodically spawn and then land. The problem is that everytime an AI plane lands, fire trucks etc will spawn and eventually lag the game out.

Is there a way of limiting the spawn to just players?

I used to do scripting for Arma 2 (sqf) and the following would be appropriate to filter out AI:

PHP Code:
if (_x == playerthen
{
     
// code 
}; 
I'm not used to C# yet and don't know the syntax well at this point. How could I filter out the AI so firetrucks etc only spawn and deploy for human controlled planes?

I've looked in the examples, but I can't 'get it' yet. I know you're busy guys so even a basic example/link would get me started.

Thanks
On a quick peek, I think there may be a bug around line 212, i.e. this bit:

Code:
                        if (!CurTechCars.Contains(TmpCar))
                             CurTechCars.Add(TmpCar);
                        MissionLoading = false;
..in that it's adding new cars even if they exist as it doesn't find a match for the existing object.

Another way to do this would be an 'if (CurTechCars.count < MAX_CARS) in before the CurTechCars.Add(TmpCar)

Hopefully that's a few clues, as I'm away from a computer (typing this on a pad)
Reply With Quote
  #23  
Old 09-14-2011, 12:46 PM
Lookaloft Lookaloft is offline
Approved Member
 
Join Date: Dec 2010
Posts: 34
Default

Mington, thanks for your detailed advice, and you too Sokol1 for your response. No grandmothers and eggs rule applied here, Ming. On the contrary I’m very happy with your suggestions, pleased as Punch as people say. Put them already into practice and all went very well now! What a terrific script this Naryv script, and what a fantastic game this Cliffs of Dover!
Reply With Quote
  #24  
Old 09-14-2011, 05:39 PM
Ataros Ataros is offline
Senior Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,438
Default

Quote:
Originally Posted by esmiol View Post
maybe we could soon see a script who call supply truck to come...rearm us and go
It is not possible in the game yet and not planned yet. Ask the devs to include it if it is really needed (in appropriate threads). Their argument is that R&R takes at least 30 minutes and no one would really want to waste that much time neither offline nor online.
Reply With Quote
  #25  
Old 09-14-2011, 08:28 PM
fearlessfrog fearlessfrog is offline
Member
 
Join Date: Jul 2010
Posts: 64
Default

Quote:
Originally Posted by Ataros View Post
It is not possible in the game yet and not planned yet. Ask the devs to include it if it is really needed (in appropriate threads). Their argument is that R&R takes at least 30 minutes and no one would really want to waste that much time neither offline nor online.
One work-around for this I had a play with was to fake it by taking the existing player/position and then destroying/recreating the same type of aircraft, i.e. you get refueled and re-armed, plus could even put a delay on that too. I know it's not realistic, but a 5 minute re-arm/refuel custom script does appeal.
Reply With Quote
  #26  
Old 09-14-2011, 08:54 PM
Ataros Ataros is offline
Senior Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,438
Default

Quote:
Originally Posted by fearlessfrog View Post
One work-around for this I had a play with was to fake it by taking the existing player/position and then destroying/recreating the same type of aircraft, i.e. you get refueled and re-armed, plus could even put a delay on that too. I know it's not realistic, but a 5 minute re-arm/refuel custom script does appeal.
This is the only way to do it now I am afraid.

BTW can you make the new aircraft to spawn at exactly the same position heading the same direction as the old one? If yes, the change would be hardly noticeable for a player.
Reply With Quote
  #27  
Old 09-14-2011, 10:12 PM
fearlessfrog fearlessfrog is offline
Member
 
Join Date: Jul 2010
Posts: 64
Default

Quote:
Originally Posted by Ataros View Post
This is the only way to do it now I am afraid.

BTW can you make the new aircraft to spawn at exactly the same position heading the same direction as the old one? If yes, the change would be hardly noticeable for a player.
I haven't tried to fix the rotation. Looking at the API I was assuming that the 'epsilon' point and angle might set that, i.e. 'Place().Pos().epsilonEquals' but would either have to try it a bit more (or we could ask the devs?)

Anyone else dealt with a rotation angle?
Reply With Quote
  #28  
Old 09-15-2011, 11:35 AM
Mington Mington is offline
Junior Member
 
Join Date: Apr 2008
Posts: 29
Default

I demand fully-automated working traffic lights in London town and fleets of Routemasters. Civilization: Cliffs of Dover

Next Week's Demand Or The Kitten Gets It: a flocking algorithm for Heinkels

Ming
Reply With Quote
  #29  
Old 09-15-2011, 11:01 PM
Das Attorney Das Attorney is offline
Approved Member
 
Join Date: May 2011
Posts: 142
Default

Quote:
Originally Posted by fearlessfrog View Post
On a quick peek, I think there may be a bug around line 212, i.e. this bit:

Code:
                        if (!CurTechCars.Contains(TmpCar))
                             CurTechCars.Add(TmpCar);
                        MissionLoading = false;
..in that it's adding new cars even if they exist as it doesn't find a match for the existing object.

Another way to do this would be an 'if (CurTechCars.count < MAX_CARS) in before the CurTechCars.Add(TmpCar)

Hopefully that's a few clues, as I'm away from a computer (typing this on a pad)
Thanks

I managed to modify the script to only work on player planes by adding a condition to ignore AI planes - using !isAiControlledPlane(aircraft)

It's working for player planes only now quite nicely.

I'd like to have a go at adding in some code to rearm/refuel/repair. Off the top of my head, it could probably work by automatically setting fuel etc to 1 when the relevant truck completes it's last waypoint. Or when it completes it's last waypoint, then it activates the Mission menu for the player to select the appropriate emergency service. I'm not sure if these solutions would be possible as I don't know many of the scripting commands.

How can you see the API? Do you have to run kegetys -dump command or is there a different way to look at the API (in the COD folder somewhere maybe)?

EDIT: I suspect it's in the maddox.dll....

Last edited by Das Attorney; 09-15-2011 at 11:31 PM.
Reply With Quote
  #30  
Old 09-16-2011, 03:48 AM
fearlessfrog fearlessfrog is offline
Member
 
Join Date: Jul 2010
Posts: 64
Default

The API is written using Microsoft .Net libraries, so you can examine them in things like Visual Studio (there is a free edition called Express). The 'object browser' shows the signatures and symbols of the files like game.world.dll that you reference in your project.
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:04 AM.

Based on a design by: Miner Skinz.com

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2007 1C Company. All rights reserved.