I Wanna Community
Fangames => Game Design => Programming Questions => Topic started by: Loilkas 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.
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?
-
Do you have the scrMakeCherrySpin script set up properly too? That's sort of important.
-
Turns out I completely glossed over the step event code, now I have that in, I get this error
___________________________________________
############################################################################################
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.
-
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.
-
Okay, that's that fixed, but now I get yet ANOTHER error
___________________________________________
############################################################################################
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.
-
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)
-
Thanks guys, its working now.
Sorry for my ignorance when it comes to coding.
-
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: httpss://docs.yoyogames.com/source/dadiospice/002_reference/debugging/runner%20errors.html