System RPG Floating Texts

Manix

Well-Known Member
Reaction score
29
RPG Floating Texts
System

Hello there,

This is the RPG floating texts system I just created, it really helps your map to be more user-friendly, aswell as increasing the level of the gameplay interface.


Features:
  • Floating Text on Level Up
  • Floating Text on Each Attack (Approximate Damage)
  • Floating Text on Unit Orders (Optional)
  • Floating Text on Player Chat Message (Optional)
  • Floating Text on Ability Cast
  • Player Color Codes (Set)

How to use:
The system is REALLY easy to import, make sure you have your "File>Preferences/General>Automatically Create unknown Variables while Pasting Trigger Data" checked, just download the map, attached to the post, then copy the category and paste it into your map.

There's an Initialization trigger in which you need to set some variables depending on your map, I'm guessing no RPG map has more than 15-20 unique heroes, so that wouldn't be a problem for you.

Notice: The floating text for your hero's damage is approximate, in order to get the exact ammount make sure that your heroes' values in the fields "Combat - Attack - Damage Number of Dice" and "Combat - Attack - Damage Sides per Die" in your object editor are set to 1.

I'm open for suggestions and I'll be upgrading and adding stuff to my system if your responses are positive and actually find it useful. :)

Codes:

Trigger:
  • RPGInitialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Setting Player Colors --------
      • Trigger - Run RPGSetPlayerColors <gen> (checking conditions)
      • -------- Setting the Heroes --------
      • Set RPG_Hero[1] = Paladin
      • Set RPG_Hero[2] = Archmage
      • Set RPG_Hero[3] = Mountain King
      • Set RPG_Hero[4] = Blood Mage
      • -------- Setting Heroes' Base Damage --------
      • -------- ( Value from "Combat - Attack 1/2 - Damage Base" ) --------
      • Set RPG_HeroDamage[1] = 0.00
      • Set RPG_HeroDamage[2] = 0.00
      • Set RPG_HeroDamage[3] = 0.00
      • Set RPG_HeroDamage[4] = 0.00
      • -------- Setting Damage Bonus Per Each Primary Attribute Point --------
      • Set RPG_DamagePerAttributePoint = 1.00
      • -------- Setting Heroes' Primary Attribute --------
      • -------- 1 = Strenght --------
      • -------- 2 = Agility --------
      • -------- 3 = Intelligence --------
      • Set RPG_HeroAttribute[1] = 1
      • Set RPG_HeroAttribute[2] = 3
      • Set RPG_HeroAttribute[3] = 1
      • Set RPG_HeroAttribute[4] = 3
      • -------- Setting the Ammount of Heroes available --------
      • Set RPG_HeroesCount = 4
      • -------- Setting the Size of Floating Texts --------
      • Set RPG_TextsSize = 10.00
      • -------- Setting Show Orders On/Off --------
      • Set RPG_Orders = False
      • -------- Setting Player Chat Texts On/Off --------
      • Set RPG_PlayerChat = True
      • -------- --------
      • -------- D - O - N - E --------
      • -------- --------


JASS:
function Trig_RPGSetPlayerColors_Actions takes nothing returns nothing
    set udg_RPG_PlayerColors[1] = "|CFFFF0000"
    set udg_RPG_PlayerColors[2] = "|CFF0000FF"
    set udg_RPG_PlayerColors[3] = "|CFF18E7BD"
    set udg_RPG_PlayerColors[4] = "|CFF520084"
    set udg_RPG_PlayerColors[5] = "|CFFFFFF00"
    set udg_RPG_PlayerColors[6] = "|CFFFF8A08"
    set udg_RPG_PlayerColors[7] = "|CFF18BE00"
    set udg_RPG_PlayerColors[8] = "|CFFE759AD"
    set udg_RPG_PlayerColors[9] = "|CFF949694"
    set udg_RPG_PlayerColors[10] = "|CFF7BBEF7"
    set udg_RPG_PlayerColors[11] = "|CFF086142"
    set udg_RPG_PlayerColors[12] = "|CFF4A2800"
endfunction
function InitTrig_RPGSetPlayerColors takes nothing returns nothing
    set gg_trg_RPGSetPlayerColors = CreateTrigger(  )
    call TriggerAddAction( gg_trg_RPGSetPlayerColors, function Trig_RPGSetPlayerColors_Actions )
endfunction


Trigger:
  • RPGPlayerChatText
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
      • Player - Player 2 (Blue) types a chat message containing <Empty String> as A substring
      • Player - Player 3 (Teal) types a chat message containing <Empty String> as A substring
      • Player - Player 4 (Purple) types a chat message containing <Empty String> as A substring
      • Player - Player 5 (Yellow) types a chat message containing <Empty String> as A substring
      • Player - Player 6 (Orange) types a chat message containing <Empty String> as A substring
      • Player - Player 7 (Green) types a chat message containing <Empty String> as A substring
      • Player - Player 8 (Pink) types a chat message containing <Empty String> as A substring
      • Player - Player 9 (Gray) types a chat message containing <Empty String> as A substring
      • Player - Player 10 (Light Blue) types a chat message containing <Empty String> as A substring
      • Player - Player 11 (Dark Green) types a chat message containing <Empty String> as A substring
      • Player - Player 12 (Brown) types a chat message containing <Empty String> as A substring
    • Conditions
      • RPG_PlayerChat Equal to True
    • Actions
      • Set RPG_UnitGroup[(Player number of (Triggering player))] = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
      • Set RPG_HeroLoc[(Player number of (Triggering player))] = (Position of (Random unit from RPG_UnitGroup[(Player number of (Triggering player))]))
      • Floating Text - Create floating text that reads (((RPG_PlayerColors[(Player number of (Triggering player))] + (Name of (Triggering player))) + :|r ) + (Entered chat string)) at RPG_HeroLoc[(Player number of (Triggering player))] with Z offset 0.00, using font size RPG_TextsSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 6.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
      • Custom script: call DestroyGroup( udg_RPG_UnitGroup[GetConvertedPlayerId(GetTriggerPlayer())])
      • Custom script: call RemoveLocation( udg_RPG_HeroLoc[GetConvertedPlayerId(GetTriggerPlayer())])


Trigger:
  • RPGSpellText
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set RPG_HeroLoc[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
      • Floating Text - Create floating text that reads ((RPG_PlayerColors[(Player number of (Owner of (Triggering unit)))] + (Name of (Ability being cast))) + (( - + (String((Level of (Ability being cast) for (Triggering unit))))) + |r)) at RPG_HeroLoc[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00, using font size RPG_TextsSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
      • Custom script: call RemoveLocation( udg_RPG_HeroLoc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])


Trigger:
  • RPGLevelUp
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set RPG_HeroLoc[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
      • Floating Text - Create floating text that reads ((RPG_PlayerColors[(Player number of (Owner of (Triggering unit)))] + ((Reached Level: + (String((Hero level of (Triggering unit))))) + !)) + |r) at RPG_HeroLoc[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00, using font size RPG_TextsSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
      • Custom script: call RemoveLocation( udg_RPG_HeroLoc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])


Trigger:
  • RPGAttackText
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) is A Hero) Equal to True
    • Actions
      • Set RPG_HeroLoc[(Player number of (Owner of (Attacking unit)))] = (Position of (Attacking unit))
      • For each (Integer A) from 1 to RPG_HeroesCount, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Attacking unit)) Equal to RPG_Hero[(Integer A)]
            • Then - Actions
              • If (RPG_HeroAttribute[(Integer A)] Equal to 1) then do (Set RPG_TempDamage[(Player number of (Owner of (Attacking unit)))] = (RPG_HeroDamage[(Integer A)] + ((Real((Strength of (Attacking unit) (Include bonuses)))) x RPG_DamagePerAttributePoint))) else do (Do nothing)
              • If (RPG_HeroAttribute[(Integer A)] Equal to 2) then do (Set RPG_TempDamage[(Player number of (Owner of (Attacking unit)))] = (RPG_HeroDamage[(Integer A)] + ((Real((Agility of (Attacking unit) (Include bonuses)))) x RPG_DamagePerAttributePoint))) else do (Do nothing)
              • If (RPG_HeroAttribute[(Integer A)] Equal to 3) then do (Set RPG_TempDamage[(Player number of (Owner of (Attacking unit)))] = (RPG_HeroDamage[(Integer A)] + ((Real((Intelligence of (Attacking unit) (Include bonuses)))) x RPG_DamagePerAttributePoint))) else do (Do nothing)
              • Floating Text - Create floating text that reads ((RPG_PlayerColors[(Player number of (Owner of (Attacking unit)))] + (String((Integer(RPG_TempDamage[(Player number of (Owner of (Attacking unit)))]))))) + |r) at RPG_HeroLoc[(Player number of (Owner of (Attacking unit)))] with Z offset 0.00, using font size RPG_TextsSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Set the velocity of (Last created floating text) to 96.00 towards 90.00 degrees
              • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
            • Else - Actions
      • Custom script: call RemoveLocation( udg_RPG_HeroLoc[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))])


Trigger:
  • RPGOrdersText
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • RPG_Orders Equal to True
    • Actions
      • Set RPG_HeroLoc[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
      • Floating Text - Create floating text that reads ((RPG_PlayerColors[(Player number of (Owner of (Triggering unit)))] + (String((Issued order)))) + |r) at RPG_HeroLoc[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00, using font size RPG_TextsSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
      • Custom script: call RemoveLocation( udg_RPG_HeroLoc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
 

Attachments

  • Floating Texts System.w3x
    21.6 KB · Views: 237

Manix

Well-Known Member
Reaction score
29
Oh well, my bad but it's 8 triggers and it's GUI, am I supposed to post all of them?
 

Manix

Well-Known Member
Reaction score
29
I just realized that if the hero has items with damage bonus it wont display it... I'll work on that tomorrow.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top