Author Topic: Overflow  (Read 8999 times)

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Overflow
« Reply #15 on: 2005-07-30, 08:47:44 AM »
So what's the error message you get on Line 123.  Hm, this might go faster if I could just have a look at your project.  Do you have a place to post that?

Rosko

  • Visitor
  • *
  • Posts: 11
    • View Profile
    • http://www.boxwars.tk
Overflow
« Reply #16 on: 2005-07-31, 10:29:28 AM »
I have some space, I just have to clear a bit. Should have the project up tomorrow. Thanks for the support so far!

Rosko

  • Visitor
  • *
  • Posts: 11
    • View Profile
    • http://www.boxwars.tk
Overflow
« Reply #17 on: 2005-08-01, 02:24:07 AM »
Ok, here it is. I've removed the background to save space!

Boxwars Alpha:
http://www.alphalink.com.au/~koger/boxwars.rar

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Overflow
« Reply #18 on: 2005-08-01, 06:02:33 AM »
I think the problem is this block of code

Code: [Select]

if ProjectObj.GamePlayer.PlayerSprite.CurState > 7 then
   arBtn0Shots(0).CurState = ProjectObj.GamePlayer.PlayerSprite.CurState - 8
else
   arBtn0Shots(0).CurState = ProjectObj.GamePlayer.PlayerSprite.CurState
end if


The "7" and "8" in this block suggest that the script is designed to work with an 8-directional sprite/attack, but your attacks can only go left or right.  That block of script is designed to make the sword sprite match the state of the player sprite so the attack goes in the right direction.  Apparently the player sprite has 16 states but your sword only has 2.  So an error occurs after you put the sword sprite sprite into state 2 and there are only 2 states (0 and 1).