The self linking number, an invariant of virtual knots, is the sum of the crossing signs for all of the crossings which have odd interstice, i.e. those for which an odd number of crossings (over/under counted separately) is encountered when travelling along the knot between the over and the under part. It was introduced by Louis Kauffman in A Self-Linking Invariant of Virtual Knots, arXiv:math.GT/0405049.
This is easiest to see from the Gauss code. For example, virtual knot 3.4 has Gauss code O1-O2+U1-U3-U2+O3-. Crossings number 1 and 3 have odd interstice and crossing number 2 has even interstice. Since crossings 1 and 3 are both negative crossings, this knot has self linking number -2.