MFGG Forums
How can I make a Cape power-up from SMW? - Printable Version

+- MFGG Forums (https://forums.mfgg.net)
+-- Forum: MFGG (https://forums.mfgg.net/forumdisplay.php?fid=4)
+--- Forum: Developer Discussion (https://forums.mfgg.net/forumdisplay.php?fid=10)
+--- Thread: How can I make a Cape power-up from SMW? (/showthread.php?tid=2387)

Pages: 1 2


RE: How can I make a Cape power-up from SMW? - Videogamejunkie443 - 05-19-2020

Langton found an old version of Hello Engine 6 Fan-Made. It has the Cape Feather. If you want to try translating the code from that engine into yours, then go ahead. If it's not available anymore, I'll post a download link.

https://forums.mfgg.net/showthread.php?tid=2357


RE: How can I make a Cape power-up from SMW? - mrpin355 - 05-23-2020

(05-19-2020, 01:59 PM)goh Wrote: Well, I started over and suddenly happens to be that when I got the cape feather and error shows up:
Code:
############################################################################################ FATAL ERROR in action number 1 of Draw Event for object obj_capeanimation: Unable to find any instance for object index '416' name 'obj_flyingmario' at gml_Object_obj_capeanimation_DrawEvent_1 (line 2) - and instance_exists(obj_flyingmario.sprite_index = spr_mario_big_runjump or not instance_exists(obj_flyingmario)) ############################################################################################ -------------------------------------------------------------------------------------------- stack frame is gml_Object_obj_capeanimation_DrawEvent_1 (line 2)
Can anyone fix this, please?
That's not how you use instance_exists, you did not properly write your conditions.
The object was being called before checking if the object exists.

Replace from this
if (instance_exists(obj_flyingmario.sprite_index = spr_mario_big_runjump or not instance_exists(obj_flyingmario))
to this
if (instance_exists(obj_flyingmario)) and (obj_flyingmario.sprite_index == spr_mario_big_runjump)

It checks if the object exists before any other condition ensues.