Navigation

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

    New to Fuse4-want a Faery Tale Adventure like game

    General Discussion
    17
    186
    25251
    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.
    • tdg8934
      tdg8934 @xevdev last edited by

      @xevdev

      ID: Z7573MND51

      If you or anyone can check it out. Currently I only have the CharacterWalk() commented out in the main loop. It should crash within a minute or two. If you comment out the other function call MenuPress() it shouldn’t crash.

      Thanks. I am not seeing any memory leaks

      1 Reply Last reply Reply Quote 0
      • xevdev
        xevdev F last edited by

        I'll have a look when it becomes live.

        1 Reply Last reply Reply Quote 1
        • xevdev
          xevdev F last edited by

          Had a look at your old code.


          I would have thought that would throw an error.
          So return void
          What I can see is you are also using OSx and OSy to push sprites off screen. I don't use sprites but I think they may have updated the sprite control set with removesprite()?.
          Someone else may know better.

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

            There is certainly a remove sprite command (always has been) but moving them off screen is also a perfectly valid way of doing things too if you want to do it that way. The reason people typically push sprites off screen when they are not in use is that sprites can have custom properties added to them which is incredibly useful but if you use 'removeSprite()' then there is a bit more work involved in making sure that the sprite still exists before accessing these properties. A simple way round that is to create an empty sprite at the start that you never use (we'll call it nullSprite but it could be called anything). This sprite has no image, no custom properties and never has any of the built in properties set. Then after calling removeSprite(spr) you would assign spr = nullSprite. That way you can ensure that you don't get an error by accessing a property that doesn't exist by checking if it is equal to nullSprite first.

            An example of what I'm talking about - this isn't necesarily a real world scenario:

            nullSprite = createSprite()
            
            player = createSprite()
            setSpriteImage(player, image)
            player.x = 100
            player.y = 100
            // Custom properties
            player.lives = 3
            player.health = 100
            
            // Some time later
            if player != nullSprite then
                player.lives -= 1
                if player.lives == 0 then
                    removeSprite(player)
                    player = nullSprite
                endif
            endif
            

            I've used this for ship firing shots where you have an array of maybe 10 shots and when the player presses fire you rattle through the array looking for the first slot in the array that isn't nullSprite and then create a new player shot, otherwise if all the slots are taken you just ignore the fire button.

            1 Reply Last reply Reply Quote 2
            • xevdev
              xevdev F last edited by

              Yes this basically what I do but I don't use sprites I just use struct in an array and the drawimageex () to display them. All the commands for sprites are things you need to really keep track of anyway. So I can't (blame fuze then(in the end it's myself)) see the point of sprites or maps other than you can create these in fuze.

              1 Reply Last reply Reply Quote 0
              • xevdev
                xevdev F last edited by

                but i cant see anything yet that is that problematic in this code (old code) yet. So its interesting in that all of the code I've written never crashes like this.

                tdg8934 1 Reply Last reply Reply Quote 0
                • tdg8934
                  tdg8934 @xevdev last edited by

                  @xevdev

                  I’m almost sure I have this figured out to be too many c=control(0) statements where there should only be 1 in a loop.

                  The character selection blue screen uses it along with MenuPress() and CharacterWalk() functions.

                  xevdev 1 Reply Last reply Reply Quote 0
                  • xevdev
                    xevdev F @tdg8934 last edited by

                    @tdg8934 hopefully yes. I once tried something like that. In another thread somewhere I'll look.

                    1 Reply Last reply Reply Quote 0
                    • xevdev
                      xevdev F last edited by

                      https://fuzearena.com/forum/topic/804/crashing-what-did-i-do
                      This is it

                      1 Reply Last reply Reply Quote 0
                      • xevdev
                        xevdev F last edited by

                        And you should check out saharamins reply at the end I use this and it's awesome.
                        https://fuzearena.com/forum/topic/645/any-way-to-hide-this-mess-of-initialisation-code/6

                        tdg8934 1 Reply Last reply Reply Quote 2
                        • tdg8934
                          tdg8934 @xevdev last edited by tdg8934

                          @xevdev SUCESS - NO CRASHES !!!

                          Following Sahara-Min method:
                          “
                          function main()
                          // Program starts here
                          return void

                          // Other functions...
                          // Variables...

                          main()
                          “

                          See the working crash free (WIP) FTA like game:

                          ID: Z7573MND51

                          From now on I will always use this program layout.

                          Thanks so much especially @xevdev and @sahara-min

                          tdg8934 1 Reply Last reply Reply Quote 5
                          • tdg8934
                            tdg8934 @tdg8934 last edited by

                            All,

                            I have made some great updates to the (WIP) - FTA like game

                            Updates:

                            1. Fixed logic so when you find objects they are removed not going into the abyss
                            2. Have N S E W NE SE SW NW and Home teleport locations (Use if you have a travel stone)
                            3. 24 hour day over 1800 seconds (Set it to what you want but it might get dark sooner)
                            4. Green jewel night vision capability
                            5. Bird totem zoom out capability
                            6. Find object- keys, jewels, rings, jade skulls, orbs, glass vials, bird totems, money bags, treasure chest
                            7. Coins (find money bag)
                            8. Use Glass viaL to increase vitality
                            9. Help menu

                            Plus previous stuff - all crash free!!!

                            What’s not working yet:
                            Keys, orb, ring, jade skull, sea shell
                            Creating bad guys to fight
                            Creating landscape, water
                            More...

                            ID: Z7573MND51

                            tdg8934 1 Reply Last reply Reply Quote 8
                            • tdg8934
                              tdg8934 @tdg8934 last edited by

                              Update on the FTA (WIP) game!

                              ‪FTA ‬
                              ‪ID: Z7573MND51‬ (Live)

                              For all that are following this game development. I’m now over 8K lines of code still with no crashes.

                              I have been focusing on going outside of the home village of Tambry. You can teleport to 9 locations (if you have a bird totem). There is now a cemetery when the character can also fight to the left or right now. The grim reaper is inside of the crypt and will give you a gold statue if you come back after midnight. If you continue south and then to the right along the paths (note teleport stations). You will find the capital city of Marheim where the king is at. His daughter is missing. Lots more to see and do but not going to give away too much yet. See the pics ![alt text](9EF7F16C-58BA-42E3-ABB9-8458EC29F821.jpeg 507FE402-7FEC-423D-93D6-B6F06CF5361C.jpeg 94A393F3-3FA5-4ED6-B88D-46712E8E9056.jpeg DE5A2000-9D1F-44EB-8C20-353E76D57A32.jpeg 17B33F0A-851A-42F4-B734-DEE1A9ABF834.jpeg 8CFB7047-023D-4CB7-ADC6-D45119FA8523.jpeg 0AB111F8-6462-42E8-927B-E50CEAE93B6A.jpeg A5004BEB-BD1A-43E0-A19A-1221339BC46E.jpeg 3E1E5349-634A-4360-AE21-64FD8E11439D.jpeg D9C8912D-F67B-4295-82D0-F2BC6C9AF56E.jpeg 7E8138B5-0636-4993-9A5D-AD0DA74A9690.jpeg 17C31CE6-E494-46C0-8450-E37A4492687C.jpeg image url)

                              1 Reply Last reply Reply Quote 6
                              • xevdev
                                xevdev F last edited by

                                Looking really sweet.

                                tdg8934 1 Reply Last reply Reply Quote 2
                                • tdg8934
                                  tdg8934 @xevdev last edited by

                                  @xevdev yes I’m pretty happy with it . I just can’t believe how much work is involved in the details. I love spending every free minute I can on it daily. I have learned so much on this project being my first Fuse4 program.

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

                                    Addicted like me.
                                    I like how you've kept on going because there is a lot of details in every game and that's where you learn to code. I love the puzzle of it all too.

                                    tdg8934 1 Reply Last reply Reply Quote 2
                                    • tdg8934
                                      tdg8934 @xevdev last edited by

                                      @xevdev I’ve been able to get 5 enemies to come out (no weapons yet). They can walk towards the main character and keep some distance between all of them. The main character can collide his weapon into the enemy and the visibility is set to false (ie killed). One issue is the main character uses c=controls() but the enemies move toward the main character from random locations but they are always in a running/waking animated mode (no idle stance) that I can’t seem to figure out yet. It’s looking great so far.

                                      tdg8934 1 Reply Last reply Reply Quote 2
                                      • tdg8934
                                        tdg8934 @tdg8934 last edited by

                                        I did a lot of code cleanup and added in a user interface coding from Gothans Rubics cube Fuze4 program. Also focused on the title screens . Sorry the lighting wasn’t great for the time of day on my tv.312C837D-9B34-474B-92B8-90EA4FF0264B.jpeg 3A412623-0BF2-42BF-A324-D05A5D6712B7.jpeg AB1E53E4-CC8B-4C01-B64D-56A6C2956F2A.jpeg F5A5F6BB-7423-463B-97BB-0D596E5789FF.jpeg B0B810CE-ED09-4991-BA84-86BC791D68E9.jpeg 86DB4DD0-C2F6-408E-A2E1-60F2C8DF5576.jpeg B8E981A0-C176-42FC-94CE-4DADAC91BED6.jpeg 3427EC39-08CB-473E-86AC-683D824F0E37.jpeg Gotham

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

                                          Looking good, Tim!

                                          1 Reply Last reply Reply Quote 2
                                          • PickleCatStars
                                            PickleCatStars F last edited by

                                            Yeah, it totally is!

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