int prob
33 posts
• Page 3 of 4 • 1, 2, 3, 4
Re: int prob
here is your code coveted to Titan Two script language:
- Code: Select all
#include <xb1.gph>
#define ADS_SENS 100.0
#define OVE_SENS 100.0
#define MIDPOINT 50.0
fix32 add_time;
fix32 add_times;
fix32 add_timem;
main {
if(get_val(XB1_LT)) {
sensitivity(XB1_LX, MIDPOINT+add_timem, ADS_SENS+add_time);
sensitivity(XB1_LY, MIDPOINT+add_timem, ADS_SENS+add_time);
} else { // OVERALL SENS
sensitivity(XB1_LX, MIDPOINT+add_timem, OVE_SENS+add_times);
sensitivity(XB1_LY, MIDPOINT+add_timem, OVE_SENS+add_times);
}
if(get_val(XB1_LT)) {
if(event_active(XB1_Y)) add_times += 5.0;
if(event_active(XB1_B)) add_times -= 5.0;
}
if(get_val(XB1_LS)) {
if(event_active(XB1_Y)) add_timem += 5.0;
if(event_active(XB1_B)) add_timem -= 5.0;
}
if(get_val(XB1_P4)) {
if(event_active(XB1_Y)) add_time += 5.0;
if(event_active(XB1_B)) add_time -= 5.0;
}
}
void sensitivity(uint8 i, fix32 m, fix32 s) {
fix32 v = get_val(i);
if(v) {
if(m) {
v = (v > 0.0) ? midpoint(v, m) : midpoint(v * -1.0, m) * -1.0;
}
if(s) {
v = (v * s) / 100.0;
}
if(v > 100.0) v = 100.0;
else if(v < -100.0) v = -100.0;
set_val(i, v);
}
return;
}
fix32 midpoint(fix32 v, fix32 m) {
if(v <= m) return((v * 50.0) / m);
return(((50.0 * (v - m)) / (100.0 - m)) + 50.0);
}
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: int prob
nope doesnt change any sens in the game
-
yohimbe - Sergeant Major
- Posts: 84
- Joined: Sun Mar 01, 2015 7:27 pm
Re: int prob
Sorry, I mistakenly used LX/LY instead of RX/RY, fixed:
- Code: Select all
#include <xb1.gph>
#define ADS_SENS 100.0
#define OVE_SENS 100.0
#define MIDPOINT 50.0
fix32 add_time;
fix32 add_times;
fix32 add_timem;
main {
if(get_val(XB1_LT)) {
sensitivity(XB1_RX, MIDPOINT+add_timem, ADS_SENS+add_time);
sensitivity(XB1_RY, MIDPOINT+add_timem, ADS_SENS+add_time);
} else { // OVERALL SENS
sensitivity(XB1_RX, MIDPOINT+add_timem, OVE_SENS+add_times);
sensitivity(XB1_RY, MIDPOINT+add_timem, OVE_SENS+add_times);
}
if(get_val(XB1_LT)) {
if(event_active(XB1_Y)) add_times += 5.0;
if(event_active(XB1_B)) add_times -= 5.0;
}
if(get_val(XB1_LS)) {
if(event_active(XB1_Y)) add_timem += 5.0;
if(event_active(XB1_B)) add_timem -= 5.0;
}
if(get_val(XB1_P4)) {
if(event_active(XB1_Y)) add_time += 5.0;
if(event_active(XB1_B)) add_time -= 5.0;
}
}
void sensitivity(uint8 i, fix32 m, fix32 s) {
fix32 v = get_val(i);
if(v) {
if(m) {
v = (v > 0.0) ? midpoint(v, m) : midpoint(v * -1.0, m) * -1.0;
}
if(s) {
v = (v * s) / 100.0;
}
if(v > 100.0) v = 100.0;
else if(v < -100.0) v = -100.0;
set_val(i, v);
}
return;
}
fix32 midpoint(fix32 v, fix32 m) {
if(v <= m) return((v * 50.0) / m);
return(((50.0 * (v - m)) / (100.0 - m)) + 50.0);
}
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: int prob
no, i already corrected it.
there just no sens change in the game.
there just no sens change in the game.
-
yohimbe - Sergeant Major
- Posts: 84
- Joined: Sun Mar 01, 2015 7:27 pm
Re: int prob
yohimbe wrote:there just no sens change in the game.
It change the sensitivity for me when i set the midpoint to 60 for example.
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: int prob
Jefferson,
maybe to avoid issue for the general "non developper" public, maybe we should have a "wrapper" type that would
cast behind the scene the variable to avoid confusion.. basically making everything defined a fix32 for example but behind the scene.. not sure if that makes sense but this will avoid a lot of problem in the futur for people not familiar with the various variable type.. it would consume a bit more memory but should be a problem.
maybe to avoid issue for the general "non developper" public, maybe we should have a "wrapper" type that would
cast behind the scene the variable to avoid confusion.. basically making everything defined a fix32 for example but behind the scene.. not sure if that makes sense but this will avoid a lot of problem in the futur for people not familiar with the various variable type.. it would consume a bit more memory but should be a problem.
-
paname - Sergeant Major of the Army
- Posts: 204
- Joined: Wed Jan 07, 2015 3:02 pm
Re: int prob
paname wrote:Jefferson,
maybe to avoid issue for the general "non developper" public, maybe we should have a "wrapper" type that would
cast behind the scene the variable to avoid confusion.. basically making everything defined a fix32 for example but behind the scene.. not sure if that makes sense but this will avoid a lot of problem in the futur for people not familiar with the various variable type.. it would consume a bit more memory but should be a problem.
yes, I liked your idea ... like 'var', which is just a synonymous of fix32. Is 'var' an good keyword for that purpose? or any other suggestion?
GitHub: https://github.com/J2Kbr/GtunerIV/issues/21
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: int prob
J2Kbr wrote:paname wrote:Jefferson,
maybe to avoid issue for the general "non developper" public, maybe we should have a "wrapper" type that would
cast behind the scene the variable to avoid confusion.. basically making everything defined a fix32 for example but behind the scene.. not sure if that makes sense but this will avoid a lot of problem in the futur for people not familiar with the various variable type.. it would consume a bit more memory but should be a problem.
yes, I liked your idea ... like 'var', which is just a synonymous of fix32. Is 'var' an good keyword for that purpose? or any other suggestion?
GitHub: https://github.com/J2Kbr/GtunerIV/issues/21
I really like "var", perfectly describes what it is.
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR
My R6 script: https://youtu.be/x-9NtxyySVM
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
Re: int prob
+1 for var!
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
33 posts
• Page 3 of 4 • 1, 2, 3, 4
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 108 guests