Rumble
Just like with the player LEDs, the GPC language also can handle the controller rumbles.
Related GPC Functions:
Rumble Identifiers:
RUMBLE_A: Strong
RUMBLE_B: Weak
RUMBLE_RT: Right trigger rumble (XBox One controller)
RUMBLE_LT: Left trigger rumble (XBox One controller)
|
Example of usage:
Once a rumble is activated by the script the rumble engine will remain activated until the script send a command to turn it off.
combo RumbleExample {
// Vibrate the controller for 1 second
set_rumble(RUMBLE_A, 100);
wait(1000);
// Turn the rumble off
set_rumble(RUMBLE_A, 0);
}
|
1. get_rumble
Returns the current value of a rumble.
Prototype:
int get_rumble ( <rumble_ident> )
Parameters:
<rumble_ident> : the identifier of a rumble
Return:
the rumble (engine) speed, can range from 0 (off) to 100 (max speed)
Example:
if(get_rumble(RUMBLE_A) == 100) {
/* Rumble A is running at max speed */
}
|
2. set_rumble
Set the value of a rumble (engine speed).
Prototype:
set_rumble ( <rumble_ident> )
Parameters:
<rumble_ident> : the identifier of a rumble
Return:
None
Example:
set_rumble(RUMBLE_RT, 80);
|
3. block_rumble
Blocks any rumble action sent by the console.
Prototype:
block_rumble ( )
Parameters:
None
Return:
None
Example:
block_rumble();
|
4. reset_rumble
Unblocks the rumble (if is blocked), and set its values to 0.
Prototype:
reset_rumble ( )
Parameters:
None
Return:
None
Example:
reset_rumble();
|