This site has been archived and made available for preservation purposes. No edits can be made.

OnActorValueChange

(Difference between revisions)
Return to current revision
Current Revision 04-28-2013, 02:03 AM
  1. -
    Gets called when an [[Actor]]'s value has changed.

    == Declaration ==
    <code cpp>
    VAULTSCRIPT void OnActorValueChange(vaultmp::ID, vaultmp::Index, vaultmp::Value);
    forward OnActorValueChange(ID, index, Float:value);
    </code>
    == Parameters ==

    '''[[ID|vaultmp::ID]]''' - the ID of the [[Actor]]

    '''[[Index|vaultmp::Index]]''' - the index of the [[Value]]

    '''[[Value|vaultmp::Value]]''' - the new value

    == Return value ==

  2. +
    Gets called when an [wiki]Actor[/wiki]'s value has changed.
    [h="2"] Declaration [/h]
    [highlight=cpp]
    VAULTSCRIPT VAULTSPACE Void OnActorValueChange(VAULTSPACE ID, VAULTSPACE ActorValue, VAULTSPACE Value) VAULTCPP(noexcept);
    [/highlight]
    [highlight=c]
    forward OnActorValueChange(ID, ActorValue:index, Float:value);
    [/highlight]
    [h="2"] Parameters [/h]
    [b][wiki="ID"]ID[/wiki][/b] - the ID of the [wiki]Actor[/wiki]
    [b][wiki="ActorValue"]ActorValue[/wiki][/b] - the [wiki="ActorValue"]Actor value[/wiki]
    [b][wiki="Value"]Value[/wiki][/b] - the new value
    [h="2"] Return value [/h]
  3.  
    None.
  4. -

    == Usage example (C++) ==

    <code cpp>
    void VAULTSCRIPT OnActorValueChange(ID actor, Index index, Value value)
    {
    std::string value_name;
    value_name = ValueToString(index);
    // value_name now contains the string representation of the value
    }
    </code>
  5. +
    [h="2"] Related pages [/h]
    [list][*][wiki]OnActorBaseValueChange[/wiki]
    [*][wiki]ValueToString[/wiki]
    [/LIST]
    [category]VaultMP interface[/category]
    [category]Scripting callbacks[/category]