Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Fixing after the update

    Help
    9
    28
    1473
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AndyG1985
      AndyG1985 last edited by

      So I’ve finally found time to look at my games broken after the update, and read over the help for the common problems. I’m still stuck and really, really hoping someone can help with my Eye of the Switch Warrior game (HQ4L3MNDXH, pending).

      From what I can tell, the problems seem to occur when setting properties for multiple of the same sprite through for-loops. For example:

      array spider[10]  createenemy (spider, enemies, 20, red)
      for a = 0 to 10 loop  spider[a].rest = 1  repeat 
      

      ... will return Invalid variable access error. Later on, using a for-loop in the same way to setspritecolour(dragon[a], blue) will return Incorrect type int. There are others.

      It’s all frustrating as I was hoping to enter this for the gallery. There may be a better place in the forum for this post so please move if so :)

      1 Reply Last reply Reply Quote 1
      • Dave
        Dave Fuze Team last edited by Dave

        Hi Andy - I've taken a look at this and the fix seems to be to add the "ref" keyword before the "spritename" parameter in your createenemy() function define. I believe it's line 519, unless I forgot about moving something else around.

        The reason for this is you are passing an array to the function with the intention of referencing it in the function and changing the contents of it using the variable local to that function "spritename".

        It should read:

        function createenemy( ref spritename, spritesheet, animstart... etc )
        

        This has to now be specified as pass by reference here, in order to have your changes actually apply to the passed array.

        Game looks awesome by the way - well worth a Showcase submission :) I had a couple of questions about it as I couldn't seem to attack the enemies I came across - how do I attack with a weapon?

        Also - if you're unfortunate enough to have bad Joy-Con drift, it makes moving around a real nightmare. Perhaps a choice between joystick movement or d-pad movement at the start of the game would be helpful. This way, if a user knows their Joy-Con's aren't doing too well, they can select D-pad move and not have to worry.

        1 Reply Last reply Reply Quote 5
        • AndyG1985
          AndyG1985 last edited by AndyG1985

          Wow, fantastic stuff! The simple addition of 3 letters has fixed everything! Well, I will just double-check the collision areas and play it to completion a few times to double-check :).

          It sounds like I also need to update the instructions so they’re clearer... (but to answer the question, battle is automatic - you just need the right weapon!)

          Thanks a lot for your help :D

          1 Reply Last reply Reply Quote 4
          • vinicity
            vinicity F last edited by

            Maybe add a deadzone to the analogue controls? That is usually very helpful for combating the dreaded drift...

            AndyG1985 1 Reply Last reply Reply Quote 4
            • AndyG1985
              AndyG1985 @vinicity last edited by

              @vinicity I haven’t heard of that before. Do you mean like detecting where the player’s analog is and setting that as default?

              1 Reply Last reply Reply Quote 0
              • D
                DaddyJDM last edited by

                I can recommend a "threshold" value for c.lx, c.ly, etc.

                For example,
                If abs(c.lx)>threshold then
                // do action associated with c.lx

                vinicity 1 Reply Last reply Reply Quote 2
                • vinicity
                  vinicity F @DaddyJDM last edited by

                  @DaddyJDM said in Fixing after the update:

                  I can recommend a "threshold" value for c.lx, c.ly, etc.

                  For example,
                  If abs(c.lx)>threshold then
                  // do action associated with c.lx

                  That’s what I meant when talking about adding a deadzone.

                  The "joystick deadzone" is the area around the center of a joystick that does not respond to movement.

                  1 Reply Last reply Reply Quote 3
                  • AndyG1985
                    AndyG1985 last edited by

                    I've now come to fix my Dizzy game and I'm hoping it's another simple fix! The overlay and text are all showing, but the game area is blank. Can anyone please help?

                    pianofire 1 Reply Last reply Reply Quote 0
                    • PickleCatStars
                      PickleCatStars F last edited by

                      Have you went through putting all your refs in?

                      1 Reply Last reply Reply Quote 1
                      • pianofire
                        pianofire Fuze Team @AndyG1985 last edited by

                        @AndyG1985 Are you using setDrawTarget because you now need to make sure it is set back to the frameBuffer explicitly after drawing to an image (before update() did it automatically)

                        1 Reply Last reply Reply Quote 2
                        • AndyG1985
                          AndyG1985 last edited by

                          No, I did try adding "setdrawtarget ( framebuffer )" after update as per the forum post but this didn't help. @toxibunny - sorry, I'm not sure what you mean by this.
                          (Btw, I'm looking to fix the much-smaller "Dizzy 4 Fuze" program since it's the same problem affecting both, and I can copy once it's figured out.)

                          pianofire 1 Reply Last reply Reply Quote 0
                          • pianofire
                            pianofire Fuze Team @AndyG1985 last edited by

                            @AndyG1985 Previously some arguments had been passed to functions by reference. That is a pointer to the actual object was passed. This meant that if you changed the contents in the function the change was reflected outside as well. The patch changed this so that some things are now passed by value. This means that a copy is made that is local to the function. To make it behave as before you need to add the ref keyword in front of the argument definition.

                            function AFunction( arg1) 
                            
                            becomes
                            
                            function AFunction(ref arg1)
                            
                            1 Reply Last reply Reply Quote 2
                            • AndyG1985
                              AndyG1985 last edited by

                              Oh sorry, yes, as Dave already explained :). Well I've added "ref" to every function with arguments and added "setdrawtarget (framebuffer)" once each after "update()", "updatemap()" and "updatesprites()", and I'm afraid it's still the same.

                              pianofire 1 Reply Last reply Reply Quote 0
                              • pianofire
                                pianofire Fuze Team @AndyG1985 last edited by

                                @AndyG1985 Do you want me to take a look?

                                AndyG1985 1 Reply Last reply Reply Quote 1
                                • AndyG1985
                                  AndyG1985 @pianofire last edited by

                                  @pianofire That would be excellent :D
                                  The code is 5G261NNDXH.
                                  (You’ll notice the dialogue also starts when the game does - this will be an issue with the collision areas so I can sort that!)

                                  1 Reply Last reply Reply Quote 0
                                  • pianofire
                                    pianofire Fuze Team last edited by

                                    I have managed to get stuff to display by moving all of the drawing stuff to the end of the main loop:

                                    loop
                                    	clear()
                                    
                                    	setspritecamera (camerax, cameray)
                                    	
                                    	setcolliders()
                                    	
                                    	screen()
                                    	
                                    	sleep(delay)
                                    	   
                                    	game()
                                    	coins()
                                    	inventory()
                                    	movement()
                                    
                                    	updatesprites()
                                    	drawsprites()
                                    	updatemap()
                                    	drawmap()
                                    	update()
                                    repeat
                                    

                                    Not sure why this is now an issue. Also there seem to be some transparency problems

                                    1 Reply Last reply Reply Quote 3
                                    • AndyG1985
                                      AndyG1985 last edited by

                                      Wow that’s messed up! Thanks for trying.. it’s always something of a guessing game for me working out the order the main loop commands go in, and I’ve had a bit more of a play, but I guess the problems run deeper.

                                      pianofire 1 Reply Last reply Reply Quote 1
                                      • pianofire
                                        pianofire Fuze Team @AndyG1985 last edited by

                                        @AndyG1985 Yes we need to get to the bottom of this because if there are more issues with moving to the new patch they need to be documented. Unfortunately I don't know what is is supposed to look like. I will downgrade my edev to the old version and have a look

                                        1 Reply Last reply Reply Quote 2
                                        • AndyG1985
                                          AndyG1985 last edited by

                                          What a hero! Thanks for that. You may or may not need to put the main loop back in the order it was already in..

                                          pianofire 1 Reply Last reply Reply Quote 2
                                          • pianofire
                                            pianofire Fuze Team @AndyG1985 last edited by

                                            @AndyG1985 No it still works with that order. I see what you mean now!

                                            1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post