PokemonButcher Posted June 1, 2018 Share Posted June 1, 2018 I asked a modder how I am to decrease the amount by which a variable increases. He highlighted the line in the .pex file that he created that would affect the change I need (+= ChangeStep) and told me to divide it: += ChangeStep ---------- divide change step there How do I divide it? I don't know anything about coding. As far as I know, there is no division symbol on a keyboard, but there must be some way to divide a variable/value (ChangeStep)! Please, does anyone know how to "divide" it in... lets say, half? Link to comment Share on other sites More sharing options...
Evangela Posted June 2, 2018 Share Posted June 2, 2018 (edited) Division in programming uses the backslash. / To replicate the aforementioned operation step in your post: /= ChangeStep What this means is, the division is performed and the result is added to the value. Edited June 2, 2018 by Rasikko Link to comment Share on other sites More sharing options...
PokemonButcher Posted June 2, 2018 Author Share Posted June 2, 2018 (edited) Division in programming uses the backslash. / To replicate the aforementioned operation step in your post: /= ChangeStep What this means is, the division is performed and the result is added to the value. So, if I were inclined to divide it in half, I would write it as: + / 2 = ChangeStep or / 2 = ChangeStep or += ChangeStep / 2 Edited June 2, 2018 by PokemonButcher Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted June 2, 2018 Share Posted June 2, 2018 Definitely the latter. All else will throw a compiler error. The "+= ChangeStep" is only part of a longer line of code, likely more looking like "SomeOtherVariable += ChangeStep", where the "+=" is an integral part of the assignment (equal to "SomeOtherVariable = SomeOtherVariable + ChangeStep") and should not be messed with.What you can change is the right side of the assignment: "ChangeStep". And if you change it into "ChangeStep / 2" or "ChangeStep * 0.5", the half of what "ChangeStep" is will be what's added onto the left side variable here. Link to comment Share on other sites More sharing options...
PokemonButcher Posted June 2, 2018 Author Share Posted June 2, 2018 Definitely the latter. All else will throw a compiler error. The "+= ChangeStep" is only part of a longer line of code, likely more looking like "SomeOtherVariable += ChangeStep", where the "+=" is an integral part of the assignment (equal to "SomeOtherVariable = SomeOtherVariable + ChangeStep") and should not be messed with.What you can change is the right side of the assignment: "ChangeStep". And if you change it into "ChangeStep / 2" or "ChangeStep * 0.5", the half of what "ChangeStep" is will be what's added onto the left side variable here. Grand! T'anks 'o ton Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now