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

OnActorValueChange

(Difference between revisions)
Return to current revision
  1.  
    Gets called when an [wiki]Actor[/wiki]'s value has changed.
    [h="2"] Declaration [/h]
  2. -
    <code cpp>
    VAULTSCRIPT void OnActorValueChange(vaultmp::ID, vaultmp::Index, vaultmp::Value);
    forward OnActorValueChange(ID, index, Float:value);
    </code>
  3. +
    [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]
  4.  
    [h="2"] Parameters [/h]
  5. -
    [b][wiki="ID"]vaultmp::ID[/wiki][/b] - the ID of the [wiki]Actor[/wiki]
    [b][wiki="Index"]vaultmp::Index[/wiki][/b] - the index of the [wiki]Actor value[/wiki]
    [b][wiki="Value"]vaultmp::Value[/wiki][/b] - the new value
  6. +
    [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
  7.  
    [h="2"] Return value [/h]
    None.
  8. -
    [h="2"] Usage example (C++) [/h]
    <code cpp>
    void VAULTSCRIPT OnActorValueChange(vaultmp::ID actor, vaultmp::Index index, vaultmp::Value value)
    {
    std::string value_name;
    value_name = ValueToString(index);
    // value_name now contains the string representation of the actor value
    }
    </code>
  9.  
    [h="2"] Related pages [/h]
    [list][*][wiki]OnActorBaseValueChange[/wiki]
    [*][wiki]ValueToString[/wiki]
    [/LIST]
    [category]VaultMP interface[/category]
    [category]Scripting callbacks[/category]