$qcassert: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Create page for $qcassert)
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
'''<code>$qcassert</code>''' is a [[QC command]] which will stop a model from compiling if a condition is not what it is expected to be.  
{{This is a|name=$qcassert|QC command|game=Counter-Strike: Global Offensive}} It will stop a model from compiling if a condition is not what it is expected to be.  
{{Todo|Which Source games other than [[Counter-Strike: Global Offensive]] support this?}}
{{Todo|Which Source games other than [[Counter-Strike: Global Offensive]] support this?}}


Line 8: Line 8:
If the result of the condition is not equal to the boolean specified, the compile will fail, informing the user of the result of the assert.
If the result of the condition is not equal to the boolean specified, the compile will fail, informing the user of the result of the assert.


Currently, there are only '''2''' conditions, which both take the bone name as their sole argument:
Currently, there are only '''2''' conditions.
* '''boneexists'''
* '''boneexists''' (takes bone name and model source name)
* '''importboneexists'''  
* '''importboneexists''' (takes bone name)
{{Todo|What is the difference?}}
{{Todo|What, exactly, does importboneexists do?}}


== Example ==
== Example ==


  '''$qcassert boneexists "whatifgaming" false'''
  '''$qcassert boneexists "whatifgaming" "official.dmx" false'''


If there is a bone in the model named '''whatifgaming''', compiling will cease. Otherwise, the model will compile as normal.
If there is a bone in the DMX file "official.dmx" named '''whatifgaming''', compiling will cease. Otherwise, the model will compile as normal.





Latest revision as of 21:33, 5 August 2025

$qcassert is a QC command available in Counter-Strike: Global Offensive Counter-Strike: Global Offensive. It will stop a model from compiling if a condition is not what it is expected to be.

Todo: Which Source games other than Counter-Strike: Global Offensive support this?

Syntax

$qcassert <condition> <arguments> <bool>

If the result of the condition is not equal to the boolean specified, the compile will fail, informing the user of the result of the assert.

Currently, there are only 2 conditions.

  • boneexists (takes bone name and model source name)
  • importboneexists (takes bone name)
Todo: What, exactly, does importboneexists do?

Example

$qcassert boneexists "whatifgaming" "official.dmx" false

If there is a bone in the DMX file "official.dmx" named whatifgaming, compiling will cease. Otherwise, the model will compile as normal.


See also