ok, having a small problem with this. i've finally started working on the levels, and i changed the or's to ands like stated above, but the 3 subsequent maps wont work. when i open them it crashes and gives me the messages:
Error playing map: Tried to draw text when no drawing surface is available [OK]
Script stopped at line 99 on character 9: Subscript out of range [OK]
i believe line 99 is
With oLayer.Sprite(intSprTwo)
---edit---
ok, i figured out the problem; in the level select, there is only 1 layer behing Main, and in the multi there are 2, so how do i change the number of layers behind the main (in the script)
'Two Player Stuff
If ProjectObj.GamePlayer.rMap.Name <> "7-1MultiButtRace" and ProjectObj.GamePlayer.rMap.Name <> "0-4LevelSelect" and ProjectObj.GamePlayer.rMap.Name <> "7-2MultiLawnMower" and ProjectObj.GamePlayer.rMap.Name <> "7-3MultiChainsawSkate" Then
intSprTwo = -1
oPlayer.ScrollMarginY = 185
Else
Set oLayer = oMap.MapLayer(1)
If intSprTwo < 0 Then
For i = 0 To oLayer.SpriteCount - 1
If oLayer.Sprite(i).rDef.Name = "Player2" Then intSprTwo = i
Next
End If
With oLayer.Sprite(intSprTwo)
oPlayer.ScrollMarginY = 62
If .ProcessAction(P2Actions) Then
.CurState = (.CurState Mod (.rDef.Template.StateCount \ 2)) _
+ .rDef.Template.StateCount \ 2
.CurFrame = .CurFrame Mod .rDef.StateFrameCount(.CurState)
Else
.CurState = (.CurState Mod (.rDef.Template.StateCount \ 2))
End If
oMap.ViewTop = 240
If P2OffsetX + oPlayer.ScrollMarginX > .X Then
P2OffsetX = .X - oPlayer.ScrollMarginX
End If
If P2OffsetX + oMap.ViewWidth - oPlayer.ScrollMarginX < .X + nSprWidth Then
P2OffsetX = .X - oMap.ViewWidth + oPlayer.ScrollMarginX + nSprWidth
End If
If P2OffsetY + oPlayer.ScrollMarginY > .Y Then
P2OffsetY = .Y - oPlayer.ScrollMarginY
End If
If P2OffsetY + oMap.ViewHeight - oPlayer.ScrollMarginY < .Y + nSprHeight Then
P2OffsetY = .Y - oMap.ViewHeight + oPlayer.ScrollMarginY + nSprHeight
End If
If P2OffsetX < 0 Then P2OffsetX = 0
If P2OffsetY < 0 Then P2OffsetY = 0
nLyrWid = oLayer.Columns * 32
nLyrHgt = oLayer.Rows * 32
If P2OffsetX > nLyrWid - oMap.ViewWidth Then P2OffsetX = nLyrWid - oMap.ViewWidth
If P2OffsetY > nLyrHgt - oMap.ViewHeight Then P2OffsetY = nLyrHgt - oMap.ViewHeight
oMap.Draw P2OffsetX, P2OffsetY, False
oMap.ViewTop = 0
End With
End If