Topic:   Exception?   (Read 23634 times)


0 Members and 2 Guests are viewing this topic.

Xiphos


  • GMG-er

  • **


  • Posts: 676
Exception?
« on: June 26, 2009, 11:23:40 AM »
"An exception has occurred.
Stability will decrease."

silvercreator v1.6a9
I put in code in a new method and that's what it says.
The code is 42 lines long. No parameters. No return type.
« Last Edit: June 26, 2009, 11:30:11 AM by Xiphos »

GMG Hendo


  • GMG-er

  • **


  • Posts: 155

  • [WITTY TEXT GOES HERE]
Re: Exception?
« Reply #1 on: June 26, 2009, 12:09:06 PM »
Try downloading SilverCreator 1.6b3. It's much newer and more stable. Here's a mirror for you since the SC site is down.

http://kttns.org/mwu5o

Xiphos


  • GMG-er

  • **


  • Posts: 676
Re: Exception?
« Reply #2 on: June 26, 2009, 02:31:00 PM »
thanks a lot! =)

It still say stability will decrease but works just fine! =)
« Last Edit: June 26, 2009, 03:09:19 PM by Xiphos »

GMG Hendo


  • GMG-er

  • **


  • Posts: 155

  • [WITTY TEXT GOES HERE]
Re: Exception?
« Reply #3 on: June 26, 2009, 02:58:25 PM »
Your welcome :)

GMG Mike


  • Administrator

  • GMG-er

  • *****

  • no avatar

  • Posts: 536
    • mikerichardson.name
Re: Exception?
« Reply #4 on: June 26, 2009, 05:20:07 PM »
What is the code? I need to know the code and then I can fix the "stability will decrease" error. It is a bug in SilverCreator.

Xiphos


  • GMG-er

  • **


  • Posts: 676
Re: Exception?
« Reply #5 on: June 26, 2009, 08:23:22 PM »
Code: [Select]
IF spritevalid(1) = true THEN
IF mainspacex = 1 THEN
   LET spritex(1) = 0
END IF
IF mainspacex = 2 THEN
   LET spritex(1) = 40
END IF
IF mainspacex = 3 THEN
   LET spritex(1) = 80
END IF
IF mainspacex = 4 THEN
   LET spritex(1) = 120
END IF
IF mainspacex = 5 THEN
   LET spritex(1) = 160
END IF
IF mainspacex = 6 THEN
   LET spritex(1) = 200
END IF
IF mainspacex = 7 THEN
   LET spritex(1) = 240
END IF
IF mainspacey = 1 THEN
   LET spritey(1) = 0
END IF
IF mainspacey = 2 THEN
   LET spritey(1) = 45
END IF
IF mainspacey = 3 THEN
   LET spritey(1) = 90
END IF
IF mainspacey = 4 THEN
   LET spritey(1) = 135
END IF
IF mainspacey = 5 THEN
   LET spritey(1) = 180
END IF
IF mainspacey = 6 THEN
   LET spritey(1) = 225
END IF
IF mainspacey = 7 THEN
   LET spritey(1) = 270
END IF
END IF

HarryCaray


  • GMG-er

  • **


  • Posts: 119

  • I love YaBB 1G - SP1!
Re: Exception?
« Reply #6 on: June 26, 2009, 08:39:12 PM »
If I'm not mistaken, SPRITEX and SPRITEY aren't assignable. They return values.

GMG Mike


  • Administrator

  • GMG-er

  • *****

  • no avatar

  • Posts: 536
    • mikerichardson.name
Re: Exception?
« Reply #7 on: June 26, 2009, 08:42:55 PM »
Quote
If I'm not mistaken, SPRITEX and SPRITEY aren't assignable. They return values.


They are assignable. It is a little-known feature. I was actually thinking of removing it.

However, there is one benefit to using the assignment vs MOVESPRITE and it's that you can assign the X and Y individually.

LET SPRITEX(5) = 50

You would need to do this to replicate with movesprite:

MOVESPRITE 5, 50, SPRITEY(5)

However the assignment method does not support adding the extra boolean to suppress the screen update.

Xiphos


  • GMG-er

  • **


  • Posts: 676
Re: Exception?
« Reply #8 on: June 26, 2009, 08:45:42 PM »
EDITTED: Yeah what Mike said...

=)
« Last Edit: June 26, 2009, 08:46:27 PM by Xiphos »

HarryCaray


  • GMG-er

  • **


  • Posts: 119

  • I love YaBB 1G - SP1!
Re: Exception?
« Reply #9 on: June 26, 2009, 08:50:00 PM »
I wonder what would happen if you tried to make a SPRITEX array and then tried to assign a value to it.

Xiphos


  • GMG-er

  • **


  • Posts: 676
Re: Exception?
« Reply #10 on: June 26, 2009, 08:53:15 PM »
What's an array???? ???

GMG Mike


  • Administrator

  • GMG-er

  • *****

  • no avatar

  • Posts: 536
    • mikerichardson.name
Re: Exception?
« Reply #11 on: June 26, 2009, 08:56:39 PM »
Quote
What's an array???? ???

Array is new in SC v1.6b2.

This creates an array:

DIM donald(50)

Basically it creates a number variable with 50 different choices (or any number you want. you pick the number).

PRINT STR$(donald(25))

LET donald(43) = 27
« Last Edit: June 26, 2009, 08:57:00 PM by Mike_Richardson »

GMG Mike


  • Administrator

  • GMG-er

  • *****

  • no avatar

  • Posts: 536
    • mikerichardson.name
Re: Exception?
« Reply #12 on: June 26, 2009, 08:57:27 PM »
Quote
I wonder what would happen if you tried to make a SPRITEX array and then tried to assign a value to it.


One will override the other. I don't remember which though.

HarryCaray


  • GMG-er

  • **


  • Posts: 119

  • I love YaBB 1G - SP1!
Re: Exception?
« Reply #13 on: June 26, 2009, 08:58:15 PM »
Its a variable that can hold more than one value.
Say you have an amount of gold you win after each level of fighting. First you'd create the array

DIM goldAmount(50)

(50) means there are 50 slots within the variable goldAmount, you could use this as each level.

Then you'd assign a value to each slot:

LET goldAmount(1)=10
LET goldAmount(2)=15
LET goldAmount(3)=20
LET goldAmount(4)=25
etc...

So when you beat level one, you get 10 gold, level two, 15 gold and so on.

LET level=3
LET playerGold=playerGold+goldAmount(level)


Whoops, you beat me to it, but I have a question also, how are arrays saved to a file?
« Last Edit: June 26, 2009, 08:59:19 PM by HarryCaray »

Xiphos


  • GMG-er

  • **


  • Posts: 676
Re: Exception?
« Reply #14 on: June 26, 2009, 09:04:13 PM »
Okay I think I understand!