I'm using a talk system in my cinematic that uses floating text to display the dialogue, displaying 1 character at a time. It's very buggy at the moment. Sometimes a unit's speech will stop halfway through (without finishing what the unit was suppose to say). Sometimes when a unit talks, it will instantly display what the previous unit said. Here is my system:
I cannot send my map publically sorry, but if you ask I will pivately message you the map.
-
Talk Start
- Events
- Conditions
-
Actions
- -------- ------- --------
- -------- Setup Variables --------
- -------- ------- --------
- Set Talk_Index = (Talk_Index + 1)
- Set Talk_Message[Talk_Index] = TalkV_Message
- Set Talk_Unit[Talk_Index] = TalkV_Unit
- Set Talk_Offset[Talk_Index] = TalkV_Offset
- Set Talk_Angle[Talk_Index] = TalkV_Angle
- Set Talk_Speed[Talk_Index] = 0.06
- Set Talk_DurationBuffer[Talk_Index] = 0.75
- Set Talk_Duration[Talk_Index] = ((Talk_Speed[Talk_Index] x (Real((Length of Talk_Message[Talk_Index])))) + Talk_DurationBuffer[Talk_Index])
- Set Talk_MessagePartial[Talk_Index] = |n|n|cffffcc00
- Set Talk_CharacterPosition[Talk_Index] = 1
- Set Talk_NextCharacter[Talk_Index] = (Substring(Talk_Message[Talk_Index], Talk_CharacterPosition[Talk_Index], Talk_CharacterPosition[Talk_Index]))
- -------- ------- --------
- -------- Perform Actions --------
- -------- ------- --------
- Set TempPoint = (Position of Talk_Unit[Talk_Index])
- Set TempPoint2 = (TempPoint offset by Talk_Offset[Talk_Index] towards Talk_Angle[Talk_Index] degrees)
- Floating Text - Create floating text that reads Talk_MessagePartial[Talk_Index] at TempPoint2 with Z offset 0.00, using font size SpeechFontSizeModifier, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Set Talk_FloatingText[Talk_Index] = (Last created floating text)
- Floating Text - Change Talk_FloatingText[Talk_Index]: Disable permanence
- Floating Text - Change the fading age of Talk_FloatingText[Talk_Index] to Talk_Duration[Talk_Index] seconds
- Floating Text - Change the lifespan of Talk_FloatingText[Talk_Index] to (Talk_Duration[Talk_Index] + 1.00) seconds
- Cinematic - Flash a speech indicator for Talk_Unit[Talk_Index] of color (100.00%, 100.00%, 100.00%) with 0.00% transparency
- Custom script: call RemoveLocation (udg_TempPoint)
- Custom script: call RemoveLocation (udg_TempPoint2)
- -------- ------- --------
- -------- Turn on Loop --------
- -------- ------- --------
- Set Talk_LoopCounter[Talk_Index] = 0.00
- Set Talk_CharacterTimer[Talk_Index] = 0.00
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Talk_Index Equal to 1
-
Then - Actions
- Trigger - Turn on Talk Loop <gen>
- Else - Actions
-
If - Conditions
-
Talk Loop
-
Events
- Time - Every 0.01 seconds of game time
- Conditions
-
Actions
- -------- Loops for all instances of talk --------
-
For each (Integer Talk_LoopInteger) from 1 to Talk_Index, do (Actions)
-
Loop - Actions
- -------- Increments talk counters --------
- Set Talk_LoopCounter[Talk_LoopInteger] = (Talk_LoopCounter[Talk_LoopInteger] + 0.01)
- Set Talk_CharacterTimer[Talk_LoopInteger] = (Talk_CharacterTimer[Talk_LoopInteger] + 0.01)
- -------- Update Floating Text Position --------
- Set TempPoint = (Position of Talk_Unit[Talk_LoopInteger])
- Set TempPoint2 = (TempPoint offset by Talk_Offset[Talk_LoopInteger] towards Talk_Angle[Talk_LoopInteger] degrees)
- Floating Text - Change the position of Talk_FloatingText[Talk_LoopInteger] to TempPoint2 with Z offset 0.00
- Custom script: call RemoveLocation (udg_TempPoint)
- Custom script: call RemoveLocation (udg_TempPoint2)
- -------- Checks if its time to display the next character --------
- -------- 0.06 timer for characters --------
- -------- 0.01 wait for spaces (loop cycle) --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
And - All (Conditions) are true
-
Conditions
- Talk_NextCharacter[Talk_LoopInteger] Equal to
-
Conditions
-
And - All (Conditions) are true
-
Conditions
- Talk_NextCharacter[Talk_LoopInteger] Not equal to
- Talk_CharacterTimer[Talk_LoopInteger] Greater than or equal to Talk_Speed[Talk_LoopInteger]
-
Conditions
-
And - All (Conditions) are true
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- -------- Appends the next character to the Speech --------
- Set Talk_MessagePartial[Talk_LoopInteger] = (Talk_MessagePartial[Talk_LoopInteger] + Talk_NextCharacter[Talk_LoopInteger])
- Floating Text - Change text of Talk_FloatingText[Talk_LoopInteger] to Talk_MessagePartial[Talk_LoopInteger] using font size 10.00
- -------- Resets the timer and counts 1 position in the String --------
- Set Talk_CharacterTimer[Talk_LoopInteger] = 0.00
- Set Talk_CharacterPosition[Talk_LoopInteger] = (Talk_CharacterPosition[Talk_LoopInteger] + 1)
- -------- Previews Next Character --------
- Set Talk_NextCharacter[Talk_LoopInteger] = (Substring(Talk_Message[Talk_LoopInteger], Talk_CharacterPosition[Talk_LoopInteger], Talk_CharacterPosition[Talk_LoopInteger]))
- -------- Checks if time has ended --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Talk_LoopCounter[Talk_LoopInteger] Greater than or equal to (Talk_Duration[Talk_LoopInteger] + 1.50)
-
Then - Actions
- -------- All Talk instances are re-indexed --------
- Set Talk_Unit[Talk_LoopInteger] = Talk_Unit[Talk_Index]
- Set Talk_Unit[Talk_Index] = No unit
- Set Talk_FloatingText[Talk_LoopInteger] = Talk_FloatingText[Talk_Index]
- Set Talk_MessagePartial[Talk_LoopInteger] = Talk_MessagePartial[Talk_Index]
- Set Talk_Message[Talk_LoopInteger] = Talk_Message[Talk_Index]
- Set Talk_NextCharacter[Talk_LoopInteger] = Talk_NextCharacter[Talk_Index]
- Set Talk_CharacterPosition[Talk_LoopInteger] = Talk_CharacterPosition[Talk_Index]
- Set Talk_LoopCounter[Talk_LoopInteger] = Talk_LoopCounter[Talk_Index]
- Set Talk_CharacterTimer[Talk_LoopInteger] = Talk_CharacterTimer[Talk_Index]
- Set Talk_Speed[Talk_LoopInteger] = Talk_Offset[Talk_Index]
- Set Talk_Duration[Talk_LoopInteger] = Talk_Duration[Talk_Index]
- Set Talk_DurationBuffer[Talk_LoopInteger] = Talk_DurationBuffer[Talk_Index]
- Set Talk_Offset[Talk_LoopInteger] = Talk_Offset[Talk_Index]
- Set Talk_Angle[Talk_LoopInteger] = Talk_Angle[Talk_Index]
- Set Talk_Index = (Talk_Index - 1)
- Set Talk_LoopInteger = (Talk_LoopInteger - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Talk_Index Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
Events
-
test talkk
- Events
- Conditions
-
Actions
- Set TalkV_Message = John:|r Let's Move!
- Set TalkV_Unit = Commander 0006 <gen>
- Set TalkV_Offset = 330.00
- Set TalkV_Angle = 0.00
- Trigger - Run Talk Start <gen> (ignoring conditions)
- Set TempReal = (0.07 x (Real((Length of TalkV_Message))))
- Wait TempReal seconds
Last edited: