Results 1 to 10 of 17

Thread: Cod4 - a few ideas i need confirming

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Brigadier General
    Join Date
    Oct 2012
    Posts
    998
    Thanks
    20
    Thanked 590 Times in 390 Posts
    Those values don't match: you are getting a stat for dvarInt( mc_tokens) + 3175; but you are trying to set the stat number 3175 when a dvar (mc_tokens) has a string value. In other words - mc_tokens is both a stat number and a string. Hence why it wont work. So, it looks to me like you are confused about what mc_tokens is - an integer or a string. So, here are 2 possible solutions:

    1. If you are trying to set a stat when a certain dvarstring matches a certain string value, you need only put in the string value for mc_tokens:

    Code:
    	#define stringvalue (dvarstring( mc_tokens ) == <return_certain_string_value>)
    	statSetOnDvarStringValue( mc_tokens, stringvalue, 3175, 1 );
    statSetOnDvarStringValue is in 4 parts; 1 = the dvarstring; 2 = the string value when to set the stat number; 3 = the stat number to set; 4 = the amount to set the stat number to.

    2. If you are trying to set a stat when the dvar is an integer value:

    Code:
    	#define dvarvalue (dvarbool( mc_tokens ) == <return_certain_int_value>)
    	statsetusingtable( 3175, dvarvalue );
    statsetusingtable is in 2 parts: 1 = the stat number to set; 2 = the stat value to set. It is the UI engine's version of setStat(). The reason it has "table" in its name is because you can get the stat value to set to from a table by using tableLookup().
    Last edited by Tally; 6th February 2015 at 13:04.

  2. The Following User Says Thank You to Tally For This Useful Post:

    Uk_ViiPeR (6th February 2015)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •