CON Command: SetConditionalParameter

Synopsis

Set parameters on a car depending on various conditions.

For use inside CON files.

Syntax

drawableVisibility Parameter

SetConditionalParameter("drawableVisibility", <vehicle_drawable_name>, <condition>, [<condition_value1>, ...]);
  • "drawableVisibility": This type of parameter sets the visibility of a drawable on the car if the condition is true.
  • vehicle_drawable_name: The name of the drawable on the vehicle to show/hide.
  • condition: The condition that determines if the prop is visible.
    • vehicleHealth: A condition that depends on the health of the vehicle.
      • This condition requires 2 more arguments specifying the minimum health and the maximum health for the condition to be true.
    • level: A condition that depends on the level the player is currently in.
      • This condition requires an argument specifying the level that the condition will return true in.

hasdoors Parameter

SetConditionalParameter("hasdoors", <condition>, [<condition_value1>, ...]);
  • "hasdoors": This type of parameter controls whether or not the car has doors if the condition is true.
  • condition: See the "drawableVisibility" section.

highroof Parameter

SetConditionalParameter("highroof", <condition>, [<condition_value1>, ...]);
  • "highroof": This type of parameter controls whether or not the car has a high roof if the condition is true.
  • condition: See the "drawableVisibility" section.

Examples

SetConditionalParameter("drawableVisibility", "clfamilyRoof", "vehicleHealth", 0.5, 3.0); 
SetConditionalParameter("drawableVisibility", "clfamilyFood", "level", 1); 

SetConditionalParameter("hasDoors", "vehicleHealth", 1.5, 3.0);

SetConditionalParameter("highRoof", "vehicleHealth", 0.0, 0.5);

Notes

No additional notes.

History

  

1.18

  • Added this command.
Back to top