PDA

View Full Version : Script extension dll for mission builders



Salmo
May-02-2017, 03:48
I present a new DLL extension for mission builders, with adds to the functions in this thread (https://theairtacticalassaultgroup.com/forum/showthread.php?t=23450). This DLL extends many of the game's class files & adds much needed additional functionality for mission scripters.

HOW TO USE:

1. Download the CLOD_Extensions.dll file HERE (https://www.mediafire.com/?b743d99dxx1p4cx) (225.5kb)
2. Place the DLL into your X:\Program Files (x86)\Steam\steamapps\common\IL-2 Sturmovik Cliffs of Dover\parts\core folder.
3. Add a reference to the DLL in your mission project building software (MS Visual Studio)
3. Add "using TF_Extensions" (no quotes) to your 'using' statements at the top of your mission script file.

Caviat: If you intend to submit your mission to the ATAG server, you will have to ask the server admins to put a copy of the dll file into the servers' X:\Program Files (x86)\Steam\steamapps\common\IL-2 Sturmovik Cliffs of Dover\parts\core folder.

Enjoy.

ATAG_Ribbs
May-02-2017, 10:46
For us non mission builder savvy..what does this allow them to do?
Just curious:)

PreyStalker
May-02-2017, 11:12
For us non mission builder savvy..what does this allow them to do?
Just curious:)

Funny, I was thinking the same thing...

:-)

SD_MBen
May-02-2017, 18:21
Funny, I was thinking the same thing...

:-)
Snap!

Salmo
May-02-2017, 20:40
For us non mission builder savvy..what does this allow them to do?
Just curious:)

Lots of additional code functions that either would need a skilled C# programmer to write, or simply not provided in the game's native functions. For example, there is no native function to provide ground height at a given point, but now mission buildiers can just write :



double GroundHeightASL = GamePlay.gpTerrainHeightASL(123.45, 678.90);

ATAG_Ribbs
May-02-2017, 22:34
Lots of additional code functions that either would need a skilled C# programmer to write, or simply not provided in the game's native functions. For example, there is no native function to provide ground height at a given point, but now mission buildiers can just write :



double GroundHeightASL = GamePlay.gpTerrainHeightASL(123.45, 678.90);

Ahh ok ..sounds like a very helpful function. :thumbsup:

♣_Spiritus_♣
May-03-2017, 01:50
Great work as usual salmo!

Cassius
May-03-2017, 11:35
Thank you.
Could we get full list of Extensions was involved like
AIAIRCRAFT CLASS EXTENSIONS

aircraft.AirCrew(); - Returns an array of type AiPerson of the aircraft's aircrew
aircraft.AirspeedIAS(); - Returns the indicated airspeed of the aircraft
aircraft.AirspeedTAS(); - Returns the true airspeed of the aircraft
aircraft.AirTempAmbient(); - Returns the ambient air temperature in degrees C at the aircraft's position
aircraft.AltitudeAGL(); - Returns the altitude in metres above ground level of the aircraft
aircraft.AltitudeF(); - Returns the altitude in feet of the aircraft
aircraft.AltitudeM(); - Returns the altitude in metres of the aircraft
aircraft.AltitudeMSL(); - Returns the altitude in metres above mean sea level of the aircraft
aircraft.CoPilot(); - Returns the co-pilot of the aircraft as an AiPerson
aircraft.CrewPlaceFunction(function); - Returns to place number for the specified crew function
aircraft.EnginesStart(); - Starts the specifed aircraft's engines
aircraft.EnginesStop(); - Stops the specifed aircraft's engines
aircraft.HasCrewFunction(function); - Returns true if the aircraft has the specified aircrew position/function
aircraft.Heading(); - Instrument-free method to return the heading of the aircraft (aircraft dont need to have a compass)
aircraft.IsAiControlled(); - Returns true if aircraft is AI controlled (no humans aboard)
aircraft.IsAirborne(); - Returns true if aircraft is in the air
aircraft.IsEnginesOff(); - Returns true if the aircraft engines are turned off
aircraft.IsMoving(); - Returns true if the aircraft is moving
aircraft.NumberOfAirCrew(); - Returns the number of aircrew in the aircraft
aircraft.NumberOfAirCrewHuman(); - Returns the number of aircrew in the aircraft that are human players
aircraft.NumberOfEngines(); - Returns the number of engines in the aircraft
aircraft.NumberOfGunners(); - Returns the number of gunners in specified aircraft
aircraft.NumberOfPilots(); - Returns the number of pilots (pilot & copilot) in specified aircraft
aircraft.Pilot(); - Returns the pilot of the aircraft as an AiPerson
aircraft.Pitch(); - Non-instrument method to return the pitch of the aircraft
aircraft.PlayerFunction(); - Returns the crew function of the first human player in specified aircraft
aircraft.PlayerPlace(); - Returns the place number of first human player in specified aircraft
aircraft.RandomSystemFailure(p);- Causes random aircraft system failure with specified probability p.
aircraft.ReturnToHomeBase(); - Sets the aircraft to return to it's home base
aircraft.Speed(); - Instrument-free method to return the speed of the aircraft (does not rely on aircraft instruments)
aircraft.TurnRate(); Returns the turn rate of the aircraft
aircraft.Yaw(); - Non-instrument method to return the yaw of the aircraft

Salmo
Sep-10-2017, 20:24
Is anyone using these script code extensions ?

TWC_Flug
Sep-22-2017, 23:24
Is anyone using these script code extensions ?

Hey, thanks for the reminder. I intended to install the dll & start using it but I forgot until just now when I saw this message again. So it is installed now & I'll plan to start using it regularly as part of the TWC servers.

TWC_Flug
Sep-23-2017, 13:09
One further step seems necessary to get the extension to work within a mission .cs file. Somewhere near the top (where you probably have your other //$reference lines:

//$reference parts/core/CLOD_Extensions.dll

TWC_Flug
Sep-23-2017, 13:10
Do you happen to know, or even have an idea at all, if this is going to still work when TF 4.5 is released?

TWC_Flug
Oct-14-2017, 21:17
I'm getting this error when trying to use the TF_Extension. Any thoughts?

Error is:


System.IO.FileNotFoundException: Could not load file or assembly 'extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
at [the method that called some methods in TF_Extenions - see below]


The lines that cause the error:


TF_Extensions.TF_GamePlay.Effect smoke = TF_Extensions.TF_GamePlay.Effect.SmokeSmall;
TF_Extensions.TF_GamePlay.gpCreateEffect(GamePlay, smoke, pos.x, pos.y, pos.z, 1200);

ATAG_Freya
Oct-14-2017, 21:44
Is it a thing where you need brackets?

eg

TF_Extensions.TF_GamePlay.Effect(smoke) = TF_Extensions.TF_GamePlay.Effect.SmokeSmall;
TF_Extensions.TF_GamePlay.gpCreateEffect(GamePlay, smoke, pos.x, pos.y, pos.z, 1200);

??? Shot in the dark, hehe

bb5000
Oct-15-2017, 15:09
It looks more like the assembly reference can't be found when called (the extension DLL). I haven't worked with mission creation, but I program a lot in C#, and errors like these occur when a method reference is missing.

Maybe the solution is a few posts earlier in this thread:

"One further step seems necessary to get the extension to work within a mission .cs file. Somewhere near the top (where you probably have your other //$reference lines:

//$reference parts/core/CLOD_Extensions.dll "

TWC_Flug
Nov-14-2017, 00:38
I'm just going to mention here (because I keep looking for it myself and it always takes me a while to find it) that Salmo posted the source code and various explanations for the TF_Extensions earlier this year.


https://theairtacticalassaultgroup.com/forum/showthread.php?t=23542

https://theairtacticalassaultgroup.com/forum/showthread.php?t=23450

These are earlier versions, I'm sure, and so maybe not word for word the same, but looking at the source & explanation for each method is quite helpful when trying to figure out what various methods do.

uranor
Jan-04-2018, 15:39
Is anyone using these script code extensions ?

Salmo,
I would like to learn more about the scriptable object-model; where can we find more documentation? Beside looking to other missions, it would be nice to have the code and a reference guide (perhaps on GitHub?) to get people started. I like playing and making Single Player Missions as trainers. Scripting can add a whole other dimension. It would also be awesome if one day we could fix some bugs/annoyances in the FMB.

Useful things:
- List of in-game objects accessible through C# scripts
- Their methods and signatures
- Description of functionality and limitations

Probably this does not exist, otherwise you would have made it public, but I wonder if a little more can be made available, if it exists. Can an automatic documentation generator be run on it? Even just list of objects, method names, and signatures would go a long way. I hope it is not an issue of Intellectual Property limitations.

Veteran66
May-19-2018, 05:06
Hi all
i look for a "play sound" script
i find no script entry in the DLL's which can play a sound file only in the Desastersoft.dll
but no in the official CloD DLL`s