OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: RangerX3X on 05 Aug 2005, 05:04:06
-
I am completely new to this ECP thing:
1. Is there a tut on how everything is suppose to function?
2. If I use ECP in creating a mission, is it a true add-on in that other people who play the mission have to have ECP as well?
-
1. look for ECP.pdf in your "OFP\ECP\Readme" folder
2. i asked a similar question in the ECP thread (http://www.ofpec.com/yabbse/index.php?board=19;action=display;threadid=15809;start=60;boardseen=1); here's what you need to do to make ECP a required addon:
Machoman:
You can edit the mission.sqm manually. All you need to do is add ECP_Effects to the required addons array.
So it would look something like this:
Code:
addOns[]=
{
"ECP_Effects"
};
-
No, people can play your mission even if they don't have ECP, but i think there's a variable to detect ECP to avoid people getting error messages if you put some ECP specific variables in your mission, i think so but i'm not sure, look in readme or settings.
-
Making a mission so as to require ECP to be present (by adding "ECP_Effects" to the mission.sqm) is the wrong way to go about it.
One has to think of ECP as something that might be present, not "must be present". Take all the stock BIS missions, for example. They play fine without ECP but get a new life when you have ECP loaded. A well made mission lets the player choose wether or not to use ECP.
Now, a mission maker might want to guarantee that some of the neat features of ECP is present in his/her mission. A common example would be rotorwash dust effects for helicopters, or perhaps neat wreckage burn effects on vehicles.
In order to have those effects in the mission even when a player doesn't use ECP, you'd have to use custom third-party effects scripts. However, if a player does use ECP, they are not needed. So what should you do as a mission maker?
The solution: Detect if ECP is present or not and take action accordingly
How do we do that then?
Example 1: Detecting any version of ECP
This is done by checking if the global variable ECP_path exists.
_ECP_present=false
?format["%1",ECP_path]!=format["%1",nil]:_ECP_present=true
...
...
...
; Add your own code and use _ECP_present as needed
Example 2: Detecting the latest ECP (1.085 or later)
ECP 1.085 being present means ECP_path exists and that there's an array named ECP_public too.
_ECP_present=false
?format["%1",ECP_path]!=format["%1",nil]&&format["%1",count ECP_public]!="scalar":_ECP_present=true
...
...
...
; As before...
Summary
- BAD: requiring ECP to be present for a mission to work. Sloppy. Amateurish. Bad form.
- GOOD: check if ECP is there and adapt.
-
Although I provided the solution, I agree with Killswitch. It is best not to make ECP usage mandatory. His solution is best, but if you're lazy, do what I said. ;)