don't click here

Looking for Java/Smali programmer for solving algorithm for Android mod.

Furikan

Green Hill Zone
Apr 20, 2021
14
3
23
27
Hello there !

I'm here to tell you that I'm currently working on a brand new mod of Sonic Advance on Android. This mod will have the ability to select a soundtrack by pressing either of these 2 buttons in the image down below.


The problem is that I'm stuck with an obstacle and I can't make this feature properly as the result. Here are the codes that take care of the soundtrack select :

First of all, I implemented a private int value called "soundValue". Since it has no default value set, this value equals 0.



Then, there is an algorithm about when we are pressing either "Yes" or "No" during the soundtrack select menu ("Midi" or "GBA Mix" respectively for the mod's context).

As you can see, there is the "soundValue" value that eventually equals 1 when we press "No".


After that, there is a public boolean called "soundMode()" which gets the value of "soundValue".

This boolean will be used in the soundtrack folder condition. So if "soundMode()" equals "false", the program will take the soundtrack from the "/mid/" folder. Otherwise, it will take the soundtrack from the "/mid_gba/" folder.



Now, this whole implementation should normally work. In fact, the result of my codes go like this :

When the "soundValue" value equals 0, we get the soundtrack from "/mid/". And when I change the "soundValue" value to 1, we get the soundtrack from "/mid_gba/".

But what's not working however is the "soundValue" value changement when we press "No" during the mod's soundtrack select menu. The "soundValue" value doesn't change at all, and I wonder how to solve this issue.

Keep in mind that not only I'm just a beginner at Java programming, but most importantly, the whole result has to be written into Smali language. So if you give me the right solution in Java, I have to turn it into Smali, and this could be an difficult task depending of the solution's complexity because I don't know any software about converting Java programming into Smali language.

If you manage to helping me out, I'll credit you to my mod and I can give you a reward if you want.

Thanks for reading my demand.
 

PM13

Shameless Recolor
Feb 25, 2018
80
79
128
As someone who only has scattered Java knowledge, it wouldn’t have anything to do with the fact that you are returning an integer from a method that defines a Boolean return type, would it?
 

Furikan

Green Hill Zone
Apr 20, 2021
14
3
23
27
I guess so. I just don't know any better, because I never tackled Java before. I do know how to program in other languages like web and database languages.

If I can't find a solution to the problem, I can't include a Soundtrack Select feature. But that doesn't mean the project will be cancelled.
 

PM13

Shameless Recolor
Feb 25, 2018
80
79
128
So, and I can’t reiterate enough how much of a Java amateur I am, but what if instead of defining your method as
Code:
public static boolean soundMode()
you used
Code:
public static int soundMode()
Does anything change?
 

Furikan

Green Hill Zone
Apr 20, 2021
14
3
23
27
Well, I actually did what you said and I even tried to change the "soundMode()" value instead of "soundValue" in the condition of when we press either Yes or No. But none of my attempts work ._.

Oh... I forgot to say that the code from the last image is on a different file than the one from the other images. But I don't think that this is the problem, because this transition works.
 

PM13

Shameless Recolor
Feb 25, 2018
80
79
128
What happens if you try switching it around and using "/mid_gba/" if soundMode() returns false?
This won't fix it, but it will tell me if there's something else to be looking for.
 

Furikan

Green Hill Zone
Apr 20, 2021
14
3
23
27
I already did ! But still no changes. It's either nothing changed or the game crashes anything I press No.
 

PM13

Shameless Recolor
Feb 25, 2018
80
79
128
Hmm....
Then, considering I’m out of depth here, I’m not sure.

Are you part of the community discord? You could try asking for help in the developers channel.
 

Furikan

Green Hill Zone
Apr 20, 2021
14
3
23
27
I don't have a Discord account. But if you can find some help, I would appreciate.

Also, if you want to give more informations about my problem, here are some files :
- the .JAVA zip folder contains the 2 files where the codes are in question in JAVA language.
- the .SMALI zip folder is the same, but in SMALI language.
- the menu image/sprite sheet for better understanding what I want.
 

Attachments

PM13

Shameless Recolor
Feb 25, 2018
80
79
128
Unfortunately I have neither the time nor the energy to ask for help on behalf of anyone else. I’m a firm believer in letting the project leader handle that.

But a discord account is free, and, in this instance, the pros to getting one outweigh the cons.

But I will take a look at those files when I have access to my PC.