[Solved] I think I have encountered a major bug
While putting ENORMOUS amounts of code (and time) into an app I came across some extremely frustrating things that eventually turned out to to make no sense at all. I had a block of code containing rules and loops that would not fire no matter what I did. I then made another code block by copying and pasting the contents of the non-firing block into another code block that contained the EXACT same code. The new block fired and the old block still did not. How can 2 identical blocks of code behave differently when they are the exact same??? This really frustrates me, because how can I make an app if what I am doing will not work even if I enter it correctly. Does anyone else have a comment on this issue? I don't know if this is the new build's problem or what, but I think it should be checked out. @BlackCloakGS @QASalad @ForumNinja @stevej
Comments
It sounds very frustrating! As you might suspect, anyone who would be able to comment would also need to see the two sets of rules ("code blocks"). Can you post a stripped down version of the project with just the offending rules?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
It is also important to take notice of what layer/position the actors are in.
Fortuna Infortuna Forti Una
Another thing that can trip you up is having unlocked actors in a scene.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
How can 2 identical blocks of code behave differently when they are the exact same???
Copying code doesn't necessarily make them identical.
Lots of things can still differ between two actors even when you copy and paste the entirety of the code from one to another, as others have already pointed out layer position and whether locked or unlocked can effect an actor, as well as an actor's attributes, whether it is placed onto a non scrolling layer . . .etc etc. For example something as simple as having 'movable' switched off in your orginal, making a new actor (where 'movable' will be on by default) and then copyng all the code over to this new actor will obviously produce two entirely different results (depending on the code).
Things can get corrupted. This happens from time to time. I've had entire scenes get corrupted as well as behaviors. Although rare this has happened a few times over the years. I don't think it's a bug.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@The_Gamesalad_Guru Same here.
@tatiang @Lovejoy @Socks @The_Gamesalad_Guru Thank you guys for the replies. It would be too much code for me to show you as it is very long, but here is the idea of what is going on.
(DID NOT WORK)
when attribute (game.mode) = analogies
-run 5 loops and other rules
I then wrote "when attribute (game.mode) = analogies"
and pasted in "-run 5 loops and other rules"
(THIS DID WORK)
I don't understand how this was possible, but I think it could have been corrupted code. Keep in mind that all of this exists in a single actor so layer position would not be relevant.
Also note I had many instances of the above with different game modes as follows:
instance -worked
instance -worked
instance -worked
instance -worked
instance -worked
instance -did not work (corrupted?)
instance -did not work (corrupted?)
instance -did not work (corrupted?)
What's weird is how some of them worked and then further down the list they stopped working. Strange stuff..
www.mbstudios.co | Free Stuff
I would have no idea without seeing the project file. I'm glad the second copy worked, though.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang saved the day! This issue was due to me not putting "" when using a text expression. Thanks for all the input guys! @Lovejoy @Socks @The_Gamesalad_Guru @crazycam99
www.mbstudios.co | Free Stuff
Ah glad you got it sorted. Yes the little things can trip you up.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
I still remember my first ever bug I spent hours tracking down in a BASIC program on my C64. I had accidently put the letter S where the number 2 should have been. "little things" indeed...
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Very true, another thing would be to questions one's self logic first, before placing blame on the engine. I have seen time and time again you talk about bloated logic, and since the time i have been here, i have realized how important it is. Also helping out members have showed me first hand what you have been talking about the entire time.
Fortuna Infortuna Forti Una
@The_Gamesalad_Guru @jamie_c @Lovejoy The funny thing is that I actually tried putting "" earlier, but I must not have opened the expression editor which caused it not to work. It really is the "little things" that count. (no pun intended)
www.mbstudios.co | Free Stuff
Yes bloated logic is a major cause of horrible performance. The more code that needs to be scanned the more potential for lag. When one learns to write integrated code, you find how much time you waste writing code that could be eliminated by taking the time to think through and planning ones code. Time spent planning ones code can save hours of time coding and make ones game perform well.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS