Author Topic: forced scrolling modification  (Read 19932 times)

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
forced scrolling modification
« Reply #15 on: 2005-08-03, 08:38:33 PM »
well no, actually only 2 sprites, opne for top and bottom, the map is only the screens width
well, no im not really that curious, its not shaking anymore, and its working for my purposes, which is really all i care about ;) .
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
forced scrolling modification
« Reply #16 on: 2005-08-03, 09:01:58 PM »
Are you using the new script BlueMonk sent for scrolling, or still using the old one?  If you're still using the old one, that would explain your problems (probably the code that's supposed to push the player sprite if it touches the edge is instead pushing it the wrong direction, and scroll margins don't make a difference because it's drawing the map scrolled to the correct place over the old map)
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
forced scrolling modification
« Reply #17 on: 2005-08-04, 05:58:31 AM »
Well only one sprite can be the player sprite so I wouldn't be surprised if the second sprite was being called a player and could get off the visible area of the map.

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
forced scrolling modification
« Reply #18 on: 2005-08-04, 09:40:01 AM »
1, yes im using hte old script, and 2, theres only 1 sprite on the map right now
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
forced scrolling modification
« Reply #19 on: 2005-08-05, 05:53:51 AM »
Well, if things don't work out for you, you might want to try switching to that new script.  It's so much cleaner, no disrespect to durnurd intended ;).

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
forced scrolling modification
« Reply #20 on: 2005-08-05, 01:42:55 PM »
Well, I would imagine that the guy who made the program could probably write a better add-on than I could (having not examined ways of scrolling before writing the script) :-).

Oh, BTW, I saw your tile on the floor in the Reif Center.  I don't know why I said that here, but it just came to mind.
Edward Dassmesser

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
forced scrolling modification
« Reply #21 on: 2005-08-14, 12:00:43 AM »
Ok, I'm going to have to switch to your scrolling script for the 4-2 level, because, for whatever reason I'm still getting sucked off the map; it's just too, for lack of a better word, messy, to deal with. (I dont think I'll worry about the other horizontal-scrolling level, just because it's working great; I've never had any problems with the player going off screen or anything, (and partly becuase I'm lazy, I don't want to have to go back in and change a bunch of things when it already works fine :D ). So out of your script, which parts would I need to copy for the vertical-upwards scroll?

(also, as a small side request, is there any simple way to make the 'margines' around the screen's edge a little smaller? Like, so the player can go further before "hitting the border"? If not, no big deal, don't worry about it.)
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
forced scrolling modification
« Reply #22 on: 2005-08-14, 07:42:59 AM »
OK, for reference, this is the new script I suggested:
Code: [Select]
Dim ScrollerSprite

Function FindScrollerSprite()
   With ProjectObj.GamePlayer.PlayerSprite.rDef.rLayer
      For I = 0 To .SpriteCount - 1
         If Left(.Sprite(I).rDef.Name, 8) = "Scroller" Then
            Set FindScrollerSprite = .Sprite(I)
            Exit Function
         End If
      Next
   End With
End Function

Sub Player_OnAfterMoveSprites()

   If IsEmpty(ScrollerSprite) Then
      Set ScrollerSprite = FindScrollerSprite
   End If

   If Not ScrollerSprite.rDef.rLayer.pMap Is ProjectObj.GamePlayer.rMap Then
      Set ScrollerSprite = FindScrollerSprite
   End If


   With ProjectObj.GamePlayer
      .MapScrollX = ScrollerSprite.X
      .MapScrollY = ScrollerSprite.Y
      If .PlayerSprite.Y > .MapScrollY + .rMap.ViewHeight - .ScrollMarginY - .PlayerSprite.Height Then
         .PlayerSprite.DY = -.PlayerSprite.rDef.Template.MoveSpeed
      ElseIf .PlayerSprite.Y < .MapScrollY + .ScrollMarginY Then
         .PlayerSprite.DY = .PlayerSprite.rDef.Template.MoveSpeed
      End If

      If .PlayerSprite.X > .MapScrollX + .rMap.ViewWidth - .ScrollMarginX - .PlayerSprite.Width Then
         .PlayerSprite.DX = -.PlayerSprite.rDef.Template.MoveSpeed
      ElseIf .PlayerSprite.X < .MapScrollX + .ScrollMarginX Then
         .PlayerSprite.DX = .PlayerSprite.rDef.Template.MoveSpeed
      End If
   End With

End Sub

HostObj.SinkObjectEvents ProjectObj.GamePlayer, "Player"
HostObj.ConnectEventsNow()
ProjectObj.GamePlayer.Play 16

There is no distinction between horizontal scrolling, vertical scrolling or diagonal scrolling.  The script simply auto-scrolls according to the current position of a sprite called "Scroller" (more specifically, the first sprite whose SpriteDef name begins with "Scroller" on the player's current layer).  That sprite can move along vertical path, horizontal path, diagonal path or any kind of path you want, and the scrolling will follow.  So you basically want the entire FindScrollerSprite function copied into your script, and you want all the contents of OnAfterMoveSprites to be in a part of your OnAfterMoveSprites function that handles processing of your auto-scrolling map(s).  Then remember to create a sprite called "Scroller" on the map(s) where you want to implement this kind of auto-scrolling.

The question of increasing the scroll margins gets interesting, but it's really quite simple to deal with.  It's interesting because The auto-scrolling levels should set it to zero if you want to allow the player to get right up next to the edge like auto-scrolling levels on most games.  But on other levels you probably want it to be different, and GameDev was only designed to have one scroll margin setting for the whole game (mental note -- fix that for SGDK2).  Anyway, setting the scroll margins in script is quite easy:
Code: [Select]
  With ProjectObj.GamePlayer
      .ScrollMarginX = 0
      .ScrollMarginY = 0
   End With

If you can detect when you are swithing maps (have your switch map function raise an event maybe) you could just set the scroll margins to sensible values based on which map you are switching to.

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
forced scrolling modification
« Reply #23 on: 2005-08-15, 11:03:36 PM »
I'm sorry, but I've tried a few different things, and I can't for the life of me figure out how to merge these 2 scripts.
I've made a little progress, gotten some parts in:

Code: [Select]
' ======== INITIAL STARTUP SCRIPT (Number 0) =========

Sub Player_OnPlayInit()
HostObj.StartScript=1
End Sub

HostObj.SinkObjectEvents ProjectObj.GamePlayer, "Player"
HostObj.ConnectEventsNow()
ProjectObj.GamePlayer.Play 16



Option Explicit

Dim XOff, YOff
Dim P2OffsetX, P2OffsetY
Dim P2Actions, intSprTwo

Const nSprWidth = 41
Const nSprHeight = 75

Sub Display_KeyDown(KeyCode, Shift)
' E=69, S=83, D=68, F=70
If KeyCode = 69 Then P2Actions = P2Actions Or ACTION_UP
If KeyCode = 83 Then P2Actions = P2Actions Or ACTION_LEFT
If KeyCode = 68 Then P2Actions = P2Actions Or ACTION_DOWN
If KeyCode = 70 Then P2Actions = P2Actions Or ACTION_RIGHT
End Sub

Sub Display_KeyUp(KeyCode, Shift)
If KeyCode = 69 Then P2Actions = P2Actions And Not ACTION_UP
If KeyCode = 83 Then P2Actions = P2Actions And Not ACTION_LEFT
If KeyCode = 68 Then P2Actions = P2Actions And Not ACTION_DOWN
If KeyCode = 70 Then P2Actions = P2Actions And Not ACTION_RIGHT
End Sub

Sub Player_OnAfterMoveSprites()

if ProjectObj.GamePlayer.rMap.Name = "4-2SpaceFlight" and YOff = 0 then YOff = 15003 - ProjectObj.GamePlayer.rMap.ViewHeight 'ProjectObj.GamePlayer.rMap.HeightHeight

  Dim oMap, oPlayer, oLayer, nLyrWid, nLyrHgt, i
  Set oPlayer = ProjectObj.GamePlayer
  Set oMap = oPlayer.rMap


'Two Player Stuff
'If ProjectObj.GamePlayer.rMap.name = "0-4LevelSelect" or ProjectObj.GamePlayer.rMap.name = "map2" or ProjectObj.GamePlayer.rMap.name = "map3" or ProjectObj.GamePlayer.rMap.name = "map4" then

  If ProjectObj.GamePlayer.rMap.name <> "0-4LevelSelect" 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

'Automatic Scrolling Stuff
  If ProjectObj.GamePlayer.rMap.name = "2-4BonusLevel" then
      XOff = XOff + 1
      With ProjectObj.GamePlayer
          if .PlayerSprite.X <= XOff then
              if .PlayerSprite.DX < 0 then .PlayerSprite.DX = 1
              .PlayerSprite.DX = .PlayerSprite.rDef.Template.MoveSpeed
              if .PlayerSprite.X < XOff - .PlayerSprite.Width / 2 then
                  XOff = 1
              End if
          end if
          .rMap.Draw XOff, YOff
      End With
  End If


If ProjectObj.GamePlayer.rMap.name = "4-2SpaceFlight" then
oPlayer.ScrollMarginX = 280
oPlayer.ScrollMarginY = 170
Dim ScrollerSprite
end if

End Sub

Sub Player_OnAfterMoveSprites()

   If IsEmpty(ScrollerSprite) Then
      Set ScrollerSprite = FindScrollerSprite
   End If

   If Not ScrollerSprite.rDef.rLayer.pMap Is ProjectObj.GamePlayer.rMap Then
      Set ScrollerSprite = FindScrollerSprite
   End If


   With ProjectObj.GamePlayer
      .MapScrollX = ScrollerSprite.X
      .MapScrollY = ScrollerSprite.Y
      If .PlayerSprite.Y > .MapScrollY + .rMap.ViewHeight - .ScrollMarginY - .PlayerSprite.Height Then
         .PlayerSprite.DY = -.PlayerSprite.rDef.Template.MoveSpeed
      ElseIf .PlayerSprite.Y < .MapScrollY + .ScrollMarginY Then
         .PlayerSprite.DY = .PlayerSprite.rDef.Template.MoveSpeed
      End If

      If .PlayerSprite.X > .MapScrollX + .rMap.ViewWidth - .ScrollMarginX - .PlayerSprite.Width Then
         .PlayerSprite.DX = -.PlayerSprite.rDef.Template.MoveSpeed
      ElseIf .PlayerSprite.X < .MapScrollX + .ScrollMarginX Then
         .PlayerSprite.DX = .PlayerSprite.rDef.Template.MoveSpeed
      End If
   End With

End Sub

Sub Player_OnControllerMove(OldActions, NewActions)

'Jumping Player
  With ProjectObj.GamePlayer.PlayerSprite
      If (Not OldActions) And NewActions And ACTION_BUTTON2 Then
          If (.rDef.SolidTest(.X, .Y + .Height) Or .rDef.SolidTest(.X + .Width - 1, .Y + .Height)) Or (Not .pRideOnRef Is Nothing) Then
              .DY = - .rDef.Template.JumpHeight
          End If
      End If
  End With

End Sub

intSprTwo = -1
HostObj.SinkObjectEvents ProjectObj.GamePlayer, "Player"
HostObj.SinkObjectEvents CurrentDisplay, "Display"
HostObj.ConnectEventsNow()


and all its saying now is that the scrollingsprite vaiable is undefined, which I think means that I need to put this in:

Code: [Select]
Function FindScrollerSprite()
   With ProjectObj.GamePlayer.PlayerSprite.rDef.rLayer
      For I = 0 To .SpriteCount - 1
         If Left(.Sprite(I).rDef.Name, 8) = "Scroller" Then
            Set FindScrollerSprite = .Sprite(I)
            Exit Function
         End If
      Next
   End With
End Function


but I haven't been able to figure out where to put it without getting a syntax error.

Heres the original script before my changes (since mine are probably wrong):

Code: [Select]
' ======== INITIAL STARTUP SCRIPT (Number 0) =========

Sub Player_OnPlayInit()
HostObj.StartScript=1
End Sub

HostObj.SinkObjectEvents ProjectObj.GamePlayer, "Player"
HostObj.ConnectEventsNow()
ProjectObj.GamePlayer.Play 16



Option Explicit

Dim XOff, YOff
Dim P2OffsetX, P2OffsetY
Dim P2Actions, intSprTwo

Const nSprWidth = 41
Const nSprHeight = 75

Sub Display_KeyDown(KeyCode, Shift)
' E=69, S=83, D=68, F=70
If KeyCode = 69 Then P2Actions = P2Actions Or ACTION_UP
If KeyCode = 83 Then P2Actions = P2Actions Or ACTION_LEFT
If KeyCode = 68 Then P2Actions = P2Actions Or ACTION_DOWN
If KeyCode = 70 Then P2Actions = P2Actions Or ACTION_RIGHT
End Sub

Sub Display_KeyUp(KeyCode, Shift)
If KeyCode = 69 Then P2Actions = P2Actions And Not ACTION_UP
If KeyCode = 83 Then P2Actions = P2Actions And Not ACTION_LEFT
If KeyCode = 68 Then P2Actions = P2Actions And Not ACTION_DOWN
If KeyCode = 70 Then P2Actions = P2Actions And Not ACTION_RIGHT
End Sub

Sub Player_OnAfterMoveSprites()

if ProjectObj.GamePlayer.rMap.Name = "4-2SpaceFlight" and YOff = 0 then YOff = 15003 - ProjectObj.GamePlayer.rMap.ViewHeight 'ProjectObj.GamePlayer.rMap.HeightHeight

  Dim oMap, oPlayer, oLayer, nLyrWid, nLyrHgt, i
  Set oPlayer = ProjectObj.GamePlayer
  Set oMap = oPlayer.rMap


'Two Player Stuff
'If ProjectObj.GamePlayer.rMap.name = "0-4LevelSelect" or ProjectObj.GamePlayer.rMap.name = "map2" or ProjectObj.GamePlayer.rMap.name = "map3" or ProjectObj.GamePlayer.rMap.name = "map4" then

  If ProjectObj.GamePlayer.rMap.name <> "0-4LevelSelect" 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

'Automatic Scrolling Stuff
  If ProjectObj.GamePlayer.rMap.name = "2-4BonusLevel" then
      XOff = XOff + 1
      With ProjectObj.GamePlayer
          if .PlayerSprite.X <= XOff then
              if .PlayerSprite.DX < 0 then .PlayerSprite.DX = 1
              .PlayerSprite.DX = .PlayerSprite.rDef.Template.MoveSpeed
              if .PlayerSprite.X < XOff - .PlayerSprite.Width / 2 then
                  XOff = 1
              End if
          end if
          .rMap.Draw XOff, YOff
      End With
  End If

If ProjectObj.GamePlayer.rMap.name = "4-2SpaceFlight" then
oPlayer.ScrollMarginX = 280
oPlayer.ScrollMarginY = 170
end if

'Automatic Scrolling Stuff 2
  If ProjectObj.GamePlayer.rMap.name = "4-2SpaceFlight" then
      YOff = YOff - 1
      With ProjectObj.GamePlayer
          if .PlayerSprite.Y <= YOff then
              if .PlayerSprite.DY > 0 then .PlayerSprite.DY = -1
              .PlayerSprite.DY = -.PlayerSprite.rDef.Template.MoveSpeed
              if .PlayerSprite.Y > YOff + .rMap.ViewHeight - .PlayerSprite.Height / 2 then
                  YOff = ProjectObj.GamePlayer.rMap.Height - ProjectObj.GamePlayer.rMap.ViewHeight 'YOff = 1
              End if
          end if
          .rMap.Draw XOff, YOff
      End With
  End If
End Sub

Sub Player_OnControllerMove(OldActions, NewActions)

'Jumping Player
  With ProjectObj.GamePlayer.PlayerSprite
      If (Not OldActions) And NewActions And ACTION_BUTTON2 Then
          If (.rDef.SolidTest(.X, .Y + .Height) Or .rDef.SolidTest(.X + .Width - 1, .Y + .Height)) Or (Not .pRideOnRef Is Nothing) Then
              .DY = - .rDef.Template.JumpHeight
          End If
      End If
  End With

End Sub

intSprTwo = -1
HostObj.SinkObjectEvents ProjectObj.GamePlayer, "Player"
HostObj.SinkObjectEvents CurrentDisplay, "Display"
HostObj.ConnectEventsNow()
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
forced scrolling modification
« Reply #24 on: 2005-08-16, 11:45:37 PM »
this is un-related to the topic, but is there a 256 frame limit on a sprites animation? don't think that i figured it out based on some mini-revalation based on figuring out the program or something, i just tried to make a realllly long sprite animation is all. heh :D
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
forced scrolling modification
« Reply #25 on: 2005-08-17, 06:13:45 AM »
First of all you can't have multiple OnAfterMoveSprites subroutines.  You have to merge the contents of the new one into the existing one.  I think you're close -- just do this:
1) Delete the End Sub for your first OnAfterMoveSprites
2) Delete the "Sub Player_OnAfterMoveSprites()" that follows
3) Move the "End If" that was right before the "End Sub" down to by right before the next End Sub (for OnAfterMoveSprites).

This will merge the two OnAfterMoveSprite functions into one and cause the contents of the second one to only be executed when you are on map 4-2SpaceFlight.

There's one more thing I think I neglected to mention (sorry) and you have it, but it's in the wrong place:
Code: [Select]
Dim ScrollerSprite
That line should by up with your other Dim Statements under the Option Explicit.  If you have it where it is now inside the OnAfterMoveSprites sub, then it will be reset each frame when it hits the End Sub.  (A variable that is declared inside a sub only lasts as long as the Sub.)

Also, it's very possible that there is a 256-frame limit for a sprite animation.  I don't have time to investigate now though.

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
forced scrolling modification
« Reply #26 on: 2005-08-17, 09:30:11 AM »
Ok, so I don't need to add in that whole Function FindScrollerSprite() section I mentioned?

---edit---
yea im gonna need that because when i try to go to that level via the level select it crashes and says
Script stopped at line 106 on character 7:
Variable is undefined: 'FindScrollerSprite'

ill do a little experimenting and see if i get lucky

---edit2---
ehhh... no luck..
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
forced scrolling modification
« Reply #27 on: 2005-08-18, 06:39:28 AM »
Oh yeah, I forgot to re-state you do need that function too.  Didn't my original message state that?  That function must be inserted into the script just like any other function.  Make sure you don't paste it into an existing sub, just put it near the top or bottom outside all the other subroutines.

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
forced scrolling modification
« Reply #28 on: 2005-08-18, 08:13:35 AM »
Mmm ok, put it right @ the top underneath the DimScrollerSprite line, but now it's saying that variable I is undefined.

---edit---
is it possible its getting confused because ive already got a similar thing in there for the other version of the scrolling script for the 2-4 level using the same I variable (since i didn't want to have to change that)?

---edit2---
mmm io tried changing all the I's to Q's to see if a letter change would work but no now its asking for variable Q

<sarcasm>didnt see that 1 coming!</scarcasm>
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
forced scrolling modification
« Reply #29 on: 2005-08-18, 04:28:10 PM »
OK, I see that I neglected to declare the variable "I" in the FindScrollerSprite function.  Bad me.  Add this line right after "Function FindScrollerSprite()" (yes, inside the Sub this time):
Code: [Select]
Dim I