One Click - Checkbox Enabled (1)

GPC2 script programming for Titan Two. Code examples, questions, requests.

One Click - Checkbox Enabled (1)

Postby UK_Wildcats » Fri Aug 23, 2019 10:39 pm

For some reason, I cannot figure out how to set my checkbox to TRUE (1) using a one click . Look at the excerps of my code below for the affected code. The "Wildcats Config" is the problem. The two radio boxes work fine but the checkbox does not work. I cannot get it set to true or checked. I can get the checkbox set to disabled (0).

I use #04:00 to disable (0). I have been using #04:01 to enable (1). I have tried 1, 11, 10 and none seem to help. Is there an issue with using the bitoffset?

Code: Select all
/*
[ONE CLICK CONFIGURATION]
shortdesc    = One click predefined configurations
control      = config
item         = Default Values:8002050028FF9C028F0078FF6A
item         = Wildcats Config (saves me time):#00:01#01:01#04:01
 
[ADS/SCOPE AND SHOOT BUTTONS]
shortdesc    = Select the buttons that you are using for ADS/SCOPE and SHOOT buttons
byteoffset     = 0
bitsize     = 8
control     = radiobox
default     = 0
item         = L2 / R2  or  LT / RT
item         = L1 / R1  or  LB / RB
 
[TACTICAL AND MELEE BUTTONS]
shortdesc    = Select the buttons that you are using for MELEE and Crouch/Prone
byteoffset     = 1
bitsize     = 8
control     = radiobox
default     = 0
item         = DEFAULT: R3 / RS for MELEE and Circle / B for Crouch/Prone
item         = TACTICAL: R3 / RS for Crouch/Prone and Circle / B for MELEE
 
[LOOK INVERSION ]
byteoffset      = 4
bitsize      = 1
bitoffset      = 1
control      = checkbox
default      = 0
item          = Check this box if you are using LOOK INVERSION in the game settings
*/

 
User avatar
UK_Wildcats
Brigadier General
Brigadier General
 
Posts: 2243
Joined: Thu Jan 08, 2015 6:53 pm

Re: One Click - Checkbox Enabled (1)

Postby bonefisher » Fri Aug 23, 2019 10:49 pm

Code: Select all
 
/* *****************************************************************************
<cfgdesc>
[ONE CLICK CONFIGURATION]
shortdesc    = One click predefined configurations
control      = config
item         = Default Values:0000000002
item         = Wildcats Config (saves me time):#00:01#01:01#04:01
 
[ADS/SCOPE AND SHOOT BUTTONS]
shortdesc    = Select the buttons that you are using for ADS/SCOPE and SHOOT buttons
byteoffset     = 0
bitsize     = 8
control     = radiobox
default     = 0
item         = L2 / R2  or  LT / RT
item         = L1 / R1  or  LB / RB
 
[TACTICAL AND MELEE BUTTONS]
shortdesc    = Select the buttons that you are using for MELEE and Crouch/Prone
byteoffset     = 1
bitsize     = 8
control     = radiobox
default     = 0
item         = DEFAULT: R3 / RS for MELEE and Circle / B for Crouch/Prone
item         = TACTICAL: R3 / RS for Crouch/Prone and Circle / B for MELEE
 
[LOOK INVERSION ]
byteoffset      = 4
bitsize      = 1
bitoffset      = 1
control      = checkbox
default      = 0
item          = Check this box if you are using LOOK INVERSION in the game settings
</cfgdesc>
***************************************************************************** */

main
{
}
 
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: One Click - Checkbox Enabled (1)

Postby UK_Wildcats » Fri Aug 23, 2019 11:50 pm

I don't understand your post. I see that you changed the "Default Values". My issue is getting the LOOK INVERSION checkbox to be enabled with the one click.
User avatar
UK_Wildcats
Brigadier General
Brigadier General
 
Posts: 2243
Joined: Thu Jan 08, 2015 6:53 pm

Re: One Click - Checkbox Enabled (1)

Postby Scachi » Fri Aug 23, 2019 11:57 pm

One way to do it without having to think about it:
Open the IC via the gear like icon / using as normal.
check all the boxes/set all the value you want.
Click OK
reopen the IC.
click the icon in the IC title "Copy Configuration" paste the code into your preset and remove the "GIVICFG:" part of this string.

Or use the "IC Bytetable" tool (windows only, I am rewriting it atm using qt to support other OS too), load the script file and set the value there, hit "Export" and it will create a minimzed string only containing the values set. Paste the string into your preset, again removing the "GIVICFG:" part of it

This works as you have set your checkbox to bitoffset 1 (the first usable bitoffset is 0):
Code: Select all
item         = Wildcats Config (saves me time):#00:01#01:01#04:02


Here it is with bitoffset 0:
Code: Select all
/* <cfgdesc>
[ONE CLICK CONFIGURATION]
shortdesc    = One click predefined configurations
control      = config
item         = Default Values:8002050028FF9C028F0078FF6A
item         = Wildcats Config (saves me time):#00:01#01:01#04:01
 
[ADS/SCOPE AND SHOOT BUTTONS]
shortdesc    = Select the buttons that you are using for ADS/SCOPE and SHOOT buttons
byteoffset     = 0
bitsize     = 8
control     = radiobox
default     = 0
item         = L2 / R2  or  LT / RT
item         = L1 / R1  or  LB / RB
 
[TACTICAL AND MELEE BUTTONS]
shortdesc    = Select the buttons that you are using for MELEE and Crouch/Prone
byteoffset     = 1
bitsize     = 8
control     = radiobox
default     = 0
item         = DEFAULT: R3 / RS for MELEE and Circle / B for Crouch/Prone
item         = TACTICAL: R3 / RS for Crouch/Prone and Circle / B for MELEE
 
[LOOK INVERSION ]
byteoffset      = 4
bitsize      = 1
bitoffset      = 0
control      = checkbox
default      = 0
item          = Check this box if you are using LOOK INVERSION in the game settings
</cfgdesc>
*/

 
 main {
 }
 
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: One Click - Checkbox Enabled (1)

Postby bonefisher » Sat Aug 24, 2019 12:17 am

lol I was going off of checkbox that you couldn't get on! So I checked and save in one click. Ok Scachi got you all good to go!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: One Click - Checkbox Enabled (1)

Postby UK_Wildcats » Sat Aug 24, 2019 12:42 am

Thank you. The copy configuration is a better choice. This way I can configure it with other options in the future.
User avatar
UK_Wildcats
Brigadier General
Brigadier General
 
Posts: 2243
Joined: Thu Jan 08, 2015 6:53 pm

Re: One Click - Checkbox Enabled (1)

Postby Prototype » Sat Aug 24, 2019 8:28 am

UK_Wildcats_Fans wrote:I use #04:00 to disable (0). I have been using #04:01 to enable (1). I have tried 1, 11, 10 and none seem to help.

#04:FF is how i do when using only 1 bit.
Console tuner since my 1st controller.
Scripting, a game in the game.
Believe or dare, It's Titanic! :smile0517:
User avatar
Prototype
Major General
Major General
 
Posts: 3251
Joined: Sun Dec 16, 2012 1:43 pm

Re: One Click - Checkbox Enabled (1)

Postby Scachi » Sat Aug 24, 2019 9:30 am

prototype wrote:
UK_Wildcats_Fans wrote:I use #04:00 to disable (0). I have been using #04:01 to enable (1). I have tried 1, 11, 10 and none seem to help.

#04:FF is how i do when using only 1 bit.

#04:01 didn't work because of the checkbox using bitoffset 1. For this #04:02 would have worked.
As prototype said, when only using 1 bit you can use FF. The bitoffset the checkbox is using doesn't matter then.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: One Click - Checkbox Enabled (1)

Postby Prototype » Sat Aug 24, 2019 9:56 am

Or #04:55 to have 4 bits enabled and 4 bits disabled (hex to bin: 55 = 01010101).
Console tuner since my 1st controller.
Scripting, a game in the game.
Believe or dare, It's Titanic! :smile0517:
User avatar
Prototype
Major General
Major General
 
Posts: 3251
Joined: Sun Dec 16, 2012 1:43 pm

Re: One Click - Checkbox Enabled (1)

Postby UK_Wildcats » Sat Aug 24, 2019 3:25 pm

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.
Attachments
Binary to Hex worksheet.xlsx
(12.54 KiB) Downloaded 55 times
User avatar
UK_Wildcats
Brigadier General
Brigadier General
 
Posts: 2243
Joined: Thu Jan 08, 2015 6:53 pm

Next

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 104 guests

cron