One Click - Checkbox Enabled (1)
17 posts
• Page 2 of 2 • 1, 2
Re: One Click - Checkbox Enabled (1)
UK_Wildcats_Fans wrote:Thank you. I was completely missing the binary to hex conversion, which was the whole key. I created the attached Excel worksheet to help people figure out the hex value based upon specific bit values.
I developed and published a Checkbox with bit offset example script.
Console tuner since my 1st controller.
Scripting, a game in the game.
Believe or dare, It's Titanic!
Scripting, a game in the game.
Believe or dare, It's Titanic!
-
Prototype - Major General
- Posts: 3251
- Joined: Sun Dec 16, 2012 1:43 pm
Re: One Click - Checkbox Enabled (1)
As it isn't possible (as far as I know) to set a single bit of a byte without also setting the other bits of that byte I have added a feature request at github for that: https://github.com/J2Kbr/GtunerIV/issues/341
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: One Click - Checkbox Enabled (1)
Yes, you have to set the full byte and cannot set an individual but. If you want to set a bit, you have to know the the state of all other bits of the byte.
-
UK_Wildcats - Brigadier General
- Posts: 2243
- Joined: Thu Jan 08, 2015 6:53 pm
Re: One Click - Checkbox Enabled (1)
Doing this by code from within a script isn't a problem. I keep the whole byte in a variable and checking/changing the matching bits within it. I can simply write the whole byte back this way.
This isn't working with Prefets / config=control as it isn't possible to read the current state there/set a single bit.
I would like to be able to do that via presets. If I want to be able to toggle different flags/bits via presets I have to put them into seperate bytes to not set the other flags in that byte too I don't want to change..wasting bits.
Thats the reason for the feature request.
This isn't working with Prefets / config=control as it isn't possible to read the current state there/set a single bit.
I would like to be able to do that via presets. If I want to be able to toggle different flags/bits via presets I have to put them into seperate bytes to not set the other flags in that byte too I don't want to change..wasting bits.
Thats the reason for the feature request.
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: One Click - Checkbox Enabled (1)
That was fast https://github.com/J2Kbr/GtunerIV/issues/341
Found this page explaining AND + OR a bit with examples: https://www.programiz.com/c-programming ... -operators
Operations OR and AND added on Gtuner IV 1.05 revision 1 (I suggest wait the same update be available on Gtuner Air before publish scripts).
Here is how this works:
GIVICFG:#02:04 Assign the hex value 04 to position hex 02
GIVICFG:#02|04 Bitwise OR the hex value 04 with the current value on position hex 02
GIVICFG:#02&FB Bitwise AND the hex value FB with the current value on position hex 02
Found this page explaining AND + OR a bit with examples: https://www.programiz.com/c-programming ... -operators
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: One Click - Checkbox Enabled (1)
Awesome
Console tuner since my 1st controller.
Scripting, a game in the game.
Believe or dare, It's Titanic!
Scripting, a game in the game.
Believe or dare, It's Titanic!
-
Prototype - Major General
- Posts: 3251
- Joined: Sun Dec 16, 2012 1:43 pm
Re: One Click - Checkbox Enabled (1)
Very nice page about bitwise operations.
In summary: OR for set a bit, AND for clear.
In summary: OR for set a bit, AND for clear.
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
17 posts
• Page 2 of 2 • 1, 2
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 150 guests