So I'm trying to include detailed combat log messages as part of my
armor-based saving throws mod. Here's what I'm working with, basically:
// If saving throw succeeds, remove status, turn deflect percentage (.00 - 1.00) into an int (1-100) and return save message:
IF "c1"
IsRandom(_DeflectTally)
THEN
ListAdd(_RemoveList, _Status)
Set(_Status,null)
Multiply(_DeflectTally, 100)
Cast(_DeflectChance, _DeflectTally)
Print(_Text, "Physical effect failed ([1]% deflect chance)", _DeflectChance)
Cast(_CombatText, _Text)
CombatLogText(_Character, _CombatText, 0, 1)
With _Text as a string and _CombatText as a fixed string. So this gives me a very basic message in the combat log, no matter who saves against what skill. I'd like to get more specific, to recreate the specificity of the messages you get when players are dealt damage or given status effects.
My initial attempt at revising the Print call looked something like:
Print(_Text, "[1]'s magic armor deflected [2] ([1]% deflect chance)", _Character, _Status, _DeflectChance)
Which gives me this when the Red Prince saves against Chicken Form:
S_Player_RedPrince's magic armor deflected CHICKEN (50% deflect chance)
So, closer, but not yet where I need it to be. I can get the status CHICKEN to return its display name by doing the following:
Print(_String, "[1]_DisplayName", _Status)
Cast(_FixedString, _String)
CombatLogText(_Character, _FixedString, 0, 1)
That will give me part of what I want: a message with the proper translated string for any given status. In this case it takes CHICKEN_DisplayName and returns "Chicken Form". But though I can call that as a fixed string, and get a single line in the combat log reading "Chicken Form," I can't output that fixed string as part of another fixed string. For example:
Print(_String, "[1]_DisplayName", _Status)
Cast(_FixedString, _String)
Print(_Text, "[1]'s magic armor deflected [2] ([1]% deflect chance)", _Character, _FixedString, _DeflectChance)
As you might guess, this will yield the following combat message:
S_Player_RedPrince's magic armor deflected CHICKEN_DisplayName (50% deflect chance)
Does anyone have any ideas for what I might try, here? To grab a character's name, the name of a status, and output them as part of another message in the combat log? If anyone can show me how the base game populates damage and status messages in the combat log so I might make use of some of those tricks, my subscribers and I would greatly appreciate it.