Jump to content

Recommended Posts

Posted (edited)

This seems to be how triggers work...

 

itemMod              -> Status effect ApplyOnEvent:    kill or whatever ->    a Status Effect that does nothing we'll call it "null_effect"
also in ItemMod   -> Ability containing a Function Called condition: If (character) has null effect     ->    Apply the effects in an ATTACK

 

As you can see, one branch of the object chain seems to apply a flag (null_effect) and the other branch uses an ability to do the function call to check whether the flag is up or not, and apply the attack if it is.

 

 

 

For functions, the Parameter GUIDs are here: https://eternity.obsidian.net/game-data-formats/instanceids

The FunctionHash is the same, so just find an existing Parameter and copy the FunctionHash Number from underneath it (the green one, if you're using VSCode).

 

Parameter Hashes correspond to parameter GUIDs, so to find the ParameterHash for an attack/race/statuseffect etc, you need;

  • search for the name of the Attack in the Attacks file or name of the race in ..er.. characters or global?, name of the Status Effect in Status Effects file etc. then copying it's GUID.
  • then search the StatusEffects file for the GUID being used in another condition, then copy it's corresponding ParameterHash.

 

*I don't know modern programming terminology, so if I've got the terms wrong, please forgive/correct me.

Edited by Svartypops
  • Thanks 1
Posted

Triggers in Deadfire refer to something different.  In the Trigger section of the status effects you can set actions that would trigger changes to the status effect.  You can change duration, status effect value, etc.

 

What you're talking about is "how to trigger an effect after an action", which could also be called triggers but there is a specific use for the term trigger in Deadfire.  You ApplyStatusEffectOnEvent to have a status effect create when the EventValue occurs.

 

For instance, let's say you make that ApplyStatusEfectOnEvent status to create a Damage status effect OnHit.  So Whenever you're hit, you create damage to yourself.  But if you wanted to increase the damage OnCriticallyHit, then you'd put that in the TriggerOnEvent for the Damage status effect, and ValueAdjustment 5, to increase the damage by 5.  TriggerOffEvent would be OnDamaged to clear the bonus damage before the next round of hits.

  • Thanks 2
Posted

Regarding ParameterHash & FunctionHash, the game ignores these properties during deserialization*, so you can safely write ScriptCallData objects without those lines in your mod files!

*Snippet from decompiled ParseScriptCall method:

else if (text.Equals("UnrealCall") || text.Equals("FunctionHash") || text.Equals("ParameterHash") || text.Equals("Flags"))
{
    JsonUtilities.DiscardNextBlock(jsonReader);
}

 

  • Like 2
Posted (edited)

Here is simpler trigger I found;


itemMod              -> a Status Effect that does nothing, with the suffix "_information", this has a TextString reference to something like "When the user is bloodied"
also in ItemMod   -> Ability containing a Function Called condition    ->    Apply the effects in an ATTACK

Edited by Svartypops

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...