Author Topic: More Spinning Cherries  (Read 1857 times)

Loilkas

  • Wannabe
  • Posts: 6
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 52.0.2743.116 Chrome 52.0.2743.116
    • View Profile
  • Playstyle: Keyboard
More Spinning Cherries
« on: August 19, 2016, 05:36:30 PM »
Okay, I been trying to use Sudnep's code from the original Spinning Cherry topic, and it is not working. I am almost certain I have done everything correctly but hey, I have no coding experience, so you might be able to see an error I've made that I can't.

Code: [Select]
with(delicious_fruit) { scrMakeCherrySpin(objCherry,384,320,5,1,900,5) }
Also, where do I put this script? I am making a boss using alarms, should I put it in there?

Also also, if I can get this to work, is there a way to merge it with the applesplosion script?
« Last Edit: August 19, 2016, 05:47:13 PM by Loilkas »

Kyir

  • The Kid
  • Posts: 293
  • Normal Guy
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 52.0.2743.116 Chrome 52.0.2743.116
    • View Profile
  • Playstyle: Keyboard
Re: More Spinning Cherries
« Reply #1 on: August 20, 2016, 07:49:18 PM »
Do you have the scrMakeCherrySpin script set up properly too? That's sort of important.

Loilkas

  • Wannabe
  • Posts: 6
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 52.0.2743.116 Chrome 52.0.2743.116
    • View Profile
  • Playstyle: Keyboard
Re: More Spinning Cherries
« Reply #2 on: August 21, 2016, 10:29:06 AM »
Turns out I completely glossed over the step event code, now I have that in, I get this error
Code: [Select]
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of  Step Event0
for object mustrack:

Variable objCherry.radiusDevdiusDev(100019, -2147483648) not set before reading it.
 at gml_Script_scrMakeCherrySpin (line 24) - orbitRadiusDev = radiusDevdiusDev
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_scrMakeCherrySpin (line 24)
called from - gml_Object_mustrack_StepNormalEvent_1 (line 1) - with(objCherry) { scrMakeCherrySpin(1,x,y,5,0,3,5) }
I don't know if it is to do with the fact I am using the Yoyoyo engine.

MLSTRM

  • Wannabe
  • Posts: 6
  • OS:
  • Windows 10 Windows 10
  • Browser:
  • Chrome 46.0.2486.0 Chrome 46.0.2486.0
    • View Profile
  • Playstyle: Keyboard
Re: More Spinning Cherries
« Reply #3 on: August 21, 2016, 11:12:28 AM »
I'm fairly sure it's an error with the original script. It should be radiusDev not radiusDevdiusDev. The first is called by the script but the second is never mentioned anywhere else.

Loilkas

  • Wannabe
  • Posts: 6
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 52.0.2743.116 Chrome 52.0.2743.116
    • View Profile
  • Playstyle: Keyboard
Re: More Spinning Cherries
« Reply #4 on: August 21, 2016, 11:29:48 AM »
Okay, that's that fixed, but now I get yet ANOTHER error
Code: [Select]
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of  Step Event0
for object objCherry:

Variable objCherry.orbitRadiusInc(100075, -2147483648) not set before reading it.
 at gml_Object_objCherry_StepNormalEvent_1 (line 8) - if orbitRadiusInc = true { orbitRadius -= orbitRadiusDev; if orbitRadius < orbitRadiusMax { orbitRadius = orbitRadiusMax; orbitRadiusInc = false } } // increase radius
############################################################################################
Sorry I keep adding to the list of errors, I can't seem to fix them myself.

MLSTRM

  • Wannabe
  • Posts: 6
  • OS:
  • Windows 10 Windows 10
  • Browser:
  • Chrome 46.0.2486.0 Chrome 46.0.2486.0
    • View Profile
  • Playstyle: Keyboard
Re: More Spinning Cherries
« Reply #5 on: August 21, 2016, 02:40:50 PM »
So this is another simple fix, and probably comes from the fact that studio acts differently to gm8/8.1

When in studio you have to set a variable to true or false, whereas in older versions it defaults to false.
The fix would be to do the following:

After "if orbitRadiusMax > orbitRadius { orbitRadiusDec = true }" add "else { orbitRadiusDec = false }"
and
After "if orbitRadiusMax < orbitRadius { orbitRadiusInc = true }" add "else {orbitRadiusInc = false }"

(Apologies I don't know how to do code formatting here and the button seems broken for me)

Loilkas

  • Wannabe
  • Posts: 6
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 52.0.2743.116 Chrome 52.0.2743.116
    • View Profile
  • Playstyle: Keyboard
Re: More Spinning Cherries
« Reply #6 on: August 21, 2016, 03:43:56 PM »
Thanks guys, its working now.
Sorry for my ignorance when it comes to coding.

Kyir

  • The Kid
  • Posts: 293
  • Normal Guy
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 52.0.2743.116 Chrome 52.0.2743.116
    • View Profile
  • Playstyle: Keyboard
Re: More Spinning Cherries
« Reply #7 on: August 21, 2016, 07:21:06 PM »
It's okay. No one starts knowing everything. Learning to read error messages is very useful though. I recommend looking at this in the future to see if you can figure it out: https://docs.yoyogames.com/source/dadiospice/002_reference/debugging/runner%20errors.html