Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Superjeep3

Pages: [1]
1
Help/FAQ / Controller jump problems
« on: 2005-09-18, 02:27:02 PM »
Thanx for fixing it for us, but we changed it to use the up direction on the pad, which I think is default.  It helped us though because we ended up having to add a button function that took up the button we were going to use for jump.  But, again, thanx.

2
Help/FAQ / Controller jump problems
« on: 2005-09-16, 08:12:01 PM »
that is the code generated from the four buttons, one being jump.

3
Help/FAQ / Controller jump problems
« on: 2005-09-16, 03:45:21 PM »
the smiley face  = 8 so 1smileyface is really 18

4
Help/FAQ / Controller jump problems
« on: 2005-09-16, 03:42:33 PM »
here is all of it, it is not that long

Dim nExpectCount
Dim nShot0Count
Dim arBtn0Shots(2)
Dim nShot2Count
Dim arBtn2Shots(0)
Dim nShot3Count
Dim arBtn3Shots(1)
Sub Player_OnControllerMove(OldActions, NewActions)
   If (Not OldActions) And NewActions And ACTION_BUTTON1 Then DoFireButton0
   If (Not OldActions) And NewActions And ACTION_BUTTON3 Then DoFireButton2
   If (Not OldActions) And NewActions And ACTION_BUTTON4 Then DoFireButton3
End Sub

Sub RecountShots()
   Dim nSIdx, nLIdx
   With ProjectObj.GamePlayer.PlayerSprite.rDef.rLayer
      nSIdx = 0
      Do While nSIdx < nShot0Count
         For nLIdx = 0 to .SpriteCount - 1
            If arBtn0Shots(nSIdx) Is .Sprite(nLIdx) Then
               Exit For
            End If
         Next
         If nLIdx >= .SpriteCount Then
            Set arBtn0Shots(nSIdx) = arBtn0Shots(nShot0Count - 1)
            nShot0Count = nShot0Count - 1
         Else
            nSIdx = nSIdx + 1
         End If
      Loop

      nSIdx = 0
      Do While nSIdx < nShot2Count
         For nLIdx = 0 to .SpriteCount - 1
            If arBtn2Shots(nSIdx) Is .Sprite(nLIdx) Then
               Exit For
            End If
         Next
         If nLIdx >= .SpriteCount Then
            Set arBtn2Shots(nSIdx) = arBtn2Shots(nShot2Count - 1)
            nShot2Count = nShot2Count - 1
         Else
            nSIdx = nSIdx + 1
         End If
      Loop

      nSIdx = 0
      Do While nSIdx < nShot3Count
         For nLIdx = 0 to .SpriteCount - 1
            If arBtn3Shots(nSIdx) Is .Sprite(nLIdx) Then
               Exit For
            End If
         Next
         If nLIdx >= .SpriteCount Then
            Set arBtn3Shots(nSIdx) = arBtn3Shots(nShot3Count - 1)
            nShot3Count = nShot3Count - 1
         Else
            nSIdx = nSIdx + 1
         End If
      Loop

      nExpectCount = .SpriteCount
   End With
End Sub

Sub RemoveShot(Spr)
   Dim nIdx
   With ProjectObj.GamePlayer.PlayerSprite.rDef.rLayer
      For nIdx = 0 to .SpriteCount - 1
         If .Sprite(nIdx) Is Spr Then .RemoveSprite(nIdx) : Exit Sub
      Next
   End With
End Sub

Function GetStateDeltas(DX, DY)
   With ProjectObj.GamePlayer.PlayerSprite
      Select Case .rDef.Template.StateType
      Case STATE_SINGLE
         If Abs(DX) + Abs(DY) > 1 Then
            DX = .DX / (Abs(.DX) + Abs(.DY))
            DY = .DY / (Abs(.DX) + Abs(.DY))
         Else
            If Abs(DX) + Abs(DY) < 1 Then DX = 0 : DY = -1
         End If
      Case STATE_LEFT_RIGHT
         DY = 0
         If (.CurState Mod 2) = 0 Then DX = -1 Else DX = 1
      Case STATE_8_DIRECTION
         Select Case (.CurState Mod 8)
         Case 0 : DX = 0 : DY = -1
         Case 1 : DX = 1 : DY = -1
         Case 2 : DX = 1 : DY = 0
         Case 3 : DX = 1 : DY = 1
         Case 4 : DX = 0 : DY = 1
         Case 5 : DX = -1 : DY = 1
         Case 6 : DX = -1 : DY = 0
         Case 7 : DX = -1 : DY = -1
         End Select
      Case Else
         DX = Cos((.CurState Mod 36) * 3.14159 / 18)
         DY = -Sin((.CurState Mod 36) * 3.14159 / 18)
      End Select
   End With
End Function

Sub Player_OnAfterMoveSprites
   Dim nIdx, VLeft, VTop, VRight, VBottom, VDat
   With ProjectObj.GamePlayer
      VLeft = .MapScrollX
      VTop = .MapScrollY
      VRight = VLeft + .rMap.ViewWidth
      VBottom = VTop + .rMap.ViewHeight
   End With

   If nExpectCount <> ProjectObj.GamePlayer.PlayerSprite.rDef.rLayer.SpriteCount Then RecountShots
   nIdx = 0
   Do While nIdx < nShot0Count
      With arBtn0Shots(nIdx)
         If .X < VLeft Or .X > VRight Or .Y < VTop Or .Y > VBottom Or (.DX = 0 And .DY = 0) Then
            RemoveShot arBtn0Shots(nIdx)
            Set arBtn0Shots(nIdx) = arBtn0Shots(nShot0Count - 1)
            nShot0Count = nShot0Count - 1
            nExpectCount = nExpectCount - 1
         Else
            nIdx = nIdx + 1
         End if
      End With
   Loop

   If nExpectCount <> ProjectObj.GamePlayer.PlayerSprite.rDef.rLayer.SpriteCount Then RecountShots
   nIdx = 0
   Do While nIdx < nShot2Count
      With arBtn2Shots(nIdx)
         If .X < VLeft Or .X > VRight Or .Y < VTop Or .Y > VBottom Or (.DX = 0 And .DY = 0) Then
            RemoveShot arBtn2Shots(nIdx)
            Set arBtn2Shots(nIdx) = arBtn2Shots(nShot2Count - 1)
            nShot2Count = nShot2Count - 1
            nExpectCount = nExpectCount - 1
         Else
            nIdx = nIdx + 1
         End if
      End With
   Loop

   If nExpectCount <> ProjectObj.GamePlayer.PlayerSprite.rDef.rLayer.SpriteCount Then RecountShots
   nIdx = 0
   Do While nIdx < nShot3Count
      With arBtn3Shots(nIdx)
         If .X < VLeft Or .X > VRight Or .Y < VTop Or .Y > VBottom Or (.DX = 0 And .DY = 0) Then
            RemoveShot arBtn3Shots(nIdx)
            Set arBtn3Shots(nIdx) = arBtn3Shots(nShot3Count - 1)
            nShot3Count = nShot3Count - 1
            nExpectCount = nExpectCount - 1
         Else
            nIdx = nIdx + 1
         End if
      End With
   Loop

End Sub

Sub DoFireButton0()
   Dim NewSpr, DX, DY
   If nShot0Count >= 3 Then Exit Sub
   If ProjectObj.GamePlayer.InvQuantityOwned(2) < 2 Then Exit sub
   ProjectObj.GamePlayer.InvQuantityOwned(2) = ProjectObj.GamePlayer.InvQuantityOwned(2) - 2
   Set NewSpr = ProjectObj.GamePlayer.rMap.SpriteDefs("pulsar_laser").MakeInstance
   Set arBtn0Shots(nShot0Count) = NewSpr
   nShot0Count = nShot0Count + 1
   With ProjectObj.GamePlayer.PlayerSprite
      .rDef.rLayer.AddSprite HostObj.AsObject(NewSpr)
      nExpectCount = nExpectCount + 1
      NewSpr.X = .X + (.Width - NewSpr.Width) / 2
      NewSpr.Y = .Y + (.Height - NewSpr.Height) / 2
      GetStateDeltas DX, DY
      NewSpr.DX = DX * NewSpr.rDef.Template.MoveSpeed
      NewSpr.DY = DY * NewSpr.rDef.Template.MoveSpeed
      If NewSpr.rDef.Template.StateCount = 36 Then NewSpr.CurState = RectToPolarState(DX, DY)
      ProjectObj.MediaMgr.Clip("pulsar").Play
   End With
End Sub

Sub DoFireButton2()
   Dim NewSpr, DX, DY
   If nShot2Count >= 1 Then Exit Sub
   If ProjectObj.GamePlayer.InvQuantityOwned(2) < 3 Then Exit sub
   If ProjectObj.GamePlayer.InvQuantityOwned(10) < 1 Then Exit sub
   ProjectObj.GamePlayer.InvQuantityOwned(2) = ProjectObj.GamePlayer.InvQuantityOwned(2) - 3
   Set NewSpr = ProjectObj.GamePlayer.rMap.SpriteDefs("plasma_rifle").MakeInstance
   Set arBtn2Shots(nShot2Count) = NewSpr
   nShot2Count = nShot2Count + 1
   With ProjectObj.GamePlayer.PlayerSprite
      .rDef.rLayer.AddSprite HostObj.AsObject(NewSpr)
      nExpectCount = nExpectCount + 1
      NewSpr.X = .X + (.Width - NewSpr.Width) / 2
      NewSpr.Y = .Y + (.Height - NewSpr.Height) / 2
      GetStateDeltas DX, DY
      NewSpr.DX = DX * NewSpr.rDef.Template.MoveSpeed
      NewSpr.DY = DY * NewSpr.rDef.Template.MoveSpeed
      If NewSpr.rDef.Template.StateCount = 36 Then NewSpr.CurState = RectToPolarState(DX, DY)
      ProjectObj.MediaMgr.Clip("plasma_rifle").Play
   End With
End Sub

Sub DoFireButton3()
   Dim NewSpr, DX, DY
   If nShot3Count >= 2 Then Exit Sub
   If ProjectObj.GamePlayer.InvQuantityOwned(2) < 2 Then Exit sub
   If ProjectObj.GamePlayer.InvQuantityOwned(4) < 1 Then Exit sub
   ProjectObj.GamePlayer.InvQuantityOwned(2) = ProjectObj.GamePlayer.InvQuantityOwned(2) - 2
   Set NewSpr = ProjectObj.GamePlayer.rMap.SpriteDefs("freeze_ray").MakeInstance
   Set arBtn3Shots(nShot3Count) = NewSpr
   nShot3Count = nShot3Count + 1
   With ProjectObj.GamePlayer.PlayerSprite
      .rDef.rLayer.AddSprite HostObj.AsObject(NewSpr)
      nExpectCount = nExpectCount + 1
      NewSpr.X = .X + (.Width - NewSpr.Width) / 2
      NewSpr.Y = .Y + (.Height - NewSpr.Height) / 2
      GetStateDeltas DX, DY
      NewSpr.DX = DX * NewSpr.rDef.Template.MoveSpeed
      NewSpr.DY = DY * NewSpr.rDef.Template.MoveSpeed
      If NewSpr.rDef.Template.StateCount = 36 Then NewSpr.CurState = RectToPolarState(DX, DY)
      ProjectObj.MediaMgr.Clip("freeze_ray").Play
   End With
End Sub

Function RectToPolarState(X, Y)
   Dim Angle, Pi
   Pi = 3.14159
   If X <> 0 Then
       Angle = Atn(-Y / X)
   Else
       Angle = -(Pi / 2) * Sgn(Y)
   End If
   If X < 0 Then
       Angle = Pi + Angle
   ElseIf Y > 0 Then
       Angle = Pi * 2 + Angle
   End If
   RectToPolarState = ((Angle * 18) / Pi) Mod 36
End Function

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

5
Help/FAQ / Post subject: Controller jump problems
« on: 2005-09-16, 11:39:43 AM »
I am using version 1.4.5, as I am a student in at the Guildhall.  Any ideas?  The gameplay is better with a controller.

6
Help/FAQ / Controller jump problems
« on: 2005-09-15, 06:09:47 PM »
The problem is not that the player does not jump high enough.  The problem is that when we set up the controls config to enable joystick, the button we set up for jump only makes the player sprite "bunny hop".  Pressing up on the controller will make the player sprite jump the full length, but the button (same button setup as the up key) will not.

7
Help/FAQ / Controller jump problems
« on: 2005-09-15, 10:15:38 AM »
Heya all, have another little question for ya.  I have configured the controls to enable a joystick, and have used the scripting wizard for my weapon fire buttons.  The fire buttons work fine on the joystick, but I wanted the player jump to be a button on the right side of the controller, and not on the left direction pad.  I did the scripting wizard to make one of the buttons jump, and in the game it does, but it does not jump the full height of the player.  What am I doing wrong?

8
Help/FAQ / Player Sprite Jumping Question
« on: 2005-08-12, 08:02:17 PM »
I think I figured it out

9
Help/FAQ / Player Sprite Jumping Question
« on: 2005-08-12, 07:22:53 PM »
your post kind of confused me, are you talking about the up button on the keyboard, as in the direction button, or what ever you define the up button as in the controls, so if I set the up button as spacebar, then jump is space bar?  Thanx, and sorry about the confusion.

10
Help/FAQ / Player Sprite Jumping Question
« on: 2005-08-12, 06:52:11 PM »
In SDK, is it possible to have the jump button defined as a direction?  I noticed in the scripting wizard, it has an option for jump, and I asume this is to make the player sprite jump.  If this is so, I can not have 4 weapons in the game as they would take up my four scripting buttons.  Is that right?  Can I assign a direction button to jump?  So if A,W,D,S were my direction buttons, and it is a side scrolling game, can the W button be my jump button, or am I missing it somewhere else?

Is it possible to have more than four scripted buttons using the scripting wizard?

What I am wanting in the game is 3 directions, left, right, jump...4 weapons (pickups)fired by 4 buttons...and one button used as a health regn (pickup).  so that would be 3 direction keys and 5 buttons.

Pages: [1]