Common Problems in Mission-Making
Some of the most common problems i see when reviewing missions are the "__cur_sp" error, and the jerky camera. Well, here's some answers for you all on how to get rid of this.

__cur_sp Error
The "__cur_sp" and "__cur_mp" problems are caused by missing mission titles when the mission is exported from the OFP editor. It takes a good 10 seconds to fix this problem.



Up in the top right corner of the editor window is the Intel section. Here you can set the weather, time of day, Resistance friendliness etc. More importantly for us, you can also set the name and text of a mission.



The Name field is by default blank. This is the "__cur_sp" error. Simly type in the name of the mission, and heh presto, no more "__cur_sp"
The Description only works for MP games. What you type in here shows on the "Choose Spots" screen during setup of the MP game.



Be warned, too much typing here will overflow the available space on th "Choose Spots" screen. Keep it short and simple.

The Jerky Camera

I've thrown together an example mission here for you to download.

It's only quick and dirty, but gets the point across. It's straight from the editor, so you can examine how i did things. Please note, extract the folder contained in the zip archive directly to your your User//missions folder.

The "mission" is in 2 parts. The first shows a standard scripted intro/cutscene following a soldier. Notice how the camera jerks up and down in time to the soldiers movement. This is due to the camera being targetted directly on the soldier. If he suddenly jumped 10 feet into the air, the camera would stay focussed on him. While this can be a good thing sometimes, it has the jerky problem which can irritate the hell out of mission-makers, players, and ( of course ) reviewers. The 2nd part shows the sae scene scripted differently, to avoid the jerkiness.

So, how do you get rid of the damn jerky camera ? I'm glad you asked :)

Here's the code from the intial camera scene. It targets the soldier, and follows his motion.

_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]
_cam camcommit 0
_cam camsettarget dude
_cam camsetrelpos [0,-20,2]
_cam camcommit 0
@camcommitted _cam
~10
_cam camsetrelpos [-20,0,2]
_cam camcommit 5
@camcommitted _cam
~10
_cam camsetrelpos [0,50,2]
_cam camcommit 5
@camcommitted _cam
~10
_cam camsettarget target
_cam camsetrelpos [0,-20,2]
_cam camcommit 0
@camcommitted _cam
~20
_cam cameraeffect ["terminate", "back"]
camdestroy _cam
exit


I'm not claiming any prizes for clean or neat code here :).

As you can see, this scene initially targets the soldier named "dude", and then just moves the camera around him to various spots. While this looks good, and always has the soldier as the focus of the camera, the jerkiness can be irritating. This is even more pronounced when a vehicle is the target, and it gets shot / runs over a mine. The camera then jumps all over the place.

And here's a look at the editor screen for this scene



The screen is nice an uncluttered. Only the target, his waypoint, and the ( default ) player.

The way to get rid of this jerkiness is to add a few more things to the editor screen. It takes a little more work, but if us mission-makers were afraid of that, we wouldn't be mission-makers :)

Here's a screenshot of the 2nd scene.



and here's the code :

_cam camsettarget target
_cam camsetrelpos [0,-20,2]
_cam camcommit 0
@camcommitted _cam
dude1 stop false
_cam camsettarget target1
_cam camcommit 10
@camcommitted _cam
_cam camsettarget target2
_cam camsetrelpos [0,0,2]
_cam camcommit 0
@camcommitted _cam
_cam camsettarget target1
_cam camcommit 0
@camcommitted _cam
_cam camsettarget target3
_cam camcommit 10
@camcommitted _cam
_cam camsettarget target4
_cam camsetrelpos [0,0,2]
_cam camcommit 0
@camcommitted _cam
_cam camsettarget target1
_cam camcommit 0
@camcommitted _cam
_cam camsettarget target3
_cam camcommit 10
@camcommitted _cam
~20
_cam cameraeffect ["terminate", "back"]
camdestroy _cam
exit


It's more code, roughly twice as much, as you are directing the camera to specific positions, and redirecting the focus a lot more. But it results in a cleaner, smoother scene.
Rather then target just the soldier, the 2nd scene focuses on 5 different objects. I used the "H (invis)" object, as it's invisible :) No extra stuff cluttering up the screen.

The extra work comes in timing. It's a case of trial and error to get the pauses and _camcommit commands to the right length of time. I'm assuming you've looked at the example mission by now. If not, go and take a look. You can see the difference.

The "H Invis" object is found in the "Empty\Objects" list. It's just a helo landing pad thats invisible.

You'll also note that in the 1st scene, the camera slides into new positions, and in the 2nd it jumps from spot to spot. This is not an indication that you cannot have slides using the 2nd method. You can, it takes more work.

Whereas the 1st method is really just a logical process of "step A, then step B, etc", the 2nd method is much more intutitive, more of and art-form. There's no hard-and-fast rules to follow. You really just have to get in and try it.

With both methods, you can use the "camsetpos" cammand, and cut down the lines of code. Personally, i've had a few troubles using "comsetpos" so i avoid it. However it's personal preference :)

Well, that about wraps this up. Any questions, feel free to email me.

Hangfyre.