Help With Show Damage + EXP system

lucifekit

New Member
Reaction score
2
I'm making a RPG map.My spell have many dummy unit and have several times dealing damage<e.g: a spell with 18 dummy unit go to 18 way from the caster>.So if i use the old show damage system it's show very much value,and it's hard to be seen.

So i write a new system here.But it's maybe lag or leak somewhere cause my map drop FPS after play about 10-15'.<or maybe cause of my spell>.Basic this system store a value is OldLife and Old EXp,and every 0,5s it stored a new value of life and exp,so if the new life least than the old life it's will show the difference,and if the new exp greater than the old exp it's will show the difference.

Anyone plz give me some advice about my Show Damage + EXP Gain System.Thks you.

Code:
Set Value in the Map initialization
    Events
        Map initialization
    Conditions
    Actions
        Set BienDemUnit = 0
        Set TempGroup = (Units in (Playable map area))
        Unit Group - Pick every unit in TempGroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Unit-type of (Picked unit)) is Summoned) Equal to False
                    Then - Actions
                        Unit - Set the custom value of (Picked unit) to BienDemUnit
                        Set OldLife[(Custom value of (Picked unit))] = (Life of (Picked unit))
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Picked unit) is A Hero) Equal to True
                            Then - Actions
                                Set OldExp[(Custom value of (Picked unit))] = (Hero experience of (Picked unit))
                            Else - Actions
                        Set BienDemUnit = (BienDemUnit + 1)
                    Else - Actions
        Custom script:   call DestroyGroup(udg_TempGroup)

Code:
Set Value to any new unit
    Events
        Unit - A unit enters (Entire map)
    Conditions
        ((Unit-type of (Triggering unit)) is Summoned) Equal to False
        (Custom value of (Triggering unit)) Equal to 0
    Actions
        Unit - Set the custom value of (Triggering unit) to BienDemUnit
        Set OldLife[(Custom value of (Triggering unit))] = (Life of (Triggering unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) is A Hero) Equal to True
            Then - Actions
                Set OldExp[(Custom value of (Triggering unit))] = (Hero experience of (Triggering unit))
            Else - Actions
        Set BienDemUnit = (BienDemUnit + 1)

Code:
Update Life every half second
    Events
        Time - Every 0.50 seconds of game time
    Conditions
    Actions
        Set TempGroup = (Units in (Playable map area) matching ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) is Summoned) Equal to False)))
        Unit Group - Pick every unit in TempGroup and do (Actions)
            Loop - Actions
                Set NewLife[(Custom value of (Picked unit))] = (Life of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is A Hero) Equal to True
                    Then - Actions
                        Set NewExp[(Custom value of (Picked unit))] = (Hero experience of (Picked unit))
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                NewExp[(Custom value of (Picked unit))] Less than OldExp[(Custom value of (Picked unit))]
                            Then - Actions
                                Set TempLocation[1] = (Position of (Picked unit))
                                Set TempLocation[2] = (TempLocation[1] offset by 50.00 towards 315.00 degrees)
                                Set TempInt = (OldExp[(Custom value of (Picked unit))] - NewExp[(Custom value of (Picked unit))])
                                Floating Text - Create floating text that reads ( -  + (String(TempInt))) at TempLocation[2] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 100.00%), and 0.00% transparency
                                Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 45.00 degrees
                                Floating Text - Change (Last created floating text): Disable permanence
                                Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
                                Custom script:   call RemoveLocation(udg_TempLocation[1])
                                Custom script:   call RemoveLocation(udg_TempLocation[2])
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        NewExp[(Custom value of (Picked unit))] Greater than OldExp[(Custom value of (Picked unit))]
                                    Then - Actions
                                        Set TempLocation[1] = (Position of (Picked unit))
                                        Set TempLocation[2] = (TempLocation[1] offset by 50.00 towards 315.00 degrees)
                                        Set TempInt = (NewExp[(Custom value of (Picked unit))] - OldExp[(Custom value of (Picked unit))])
                                        Floating Text - Create floating text that reads ( +  + (String(TempInt))) at TempLocation[2] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 100.00%), and 0.00% transparency
                                        Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 45.00 degrees
                                        Floating Text - Change (Last created floating text): Disable permanence
                                        Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
                                        Custom script:   call RemoveLocation(udg_TempLocation[1])
                                        Custom script:   call RemoveLocation(udg_TempLocation[2])
                                    Else - Actions
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        NewLife[(Custom value of (Picked unit))] Less than OldLife[(Custom value of (Picked unit))]
                    Then - Actions
                        Set TempLocation[1] = (Position of (Picked unit))
                        Set TempLocation[2] = (TempLocation[1] offset by 50.00 towards 315.00 degrees)
                        Set TempInt = (Integer((OldLife[(Custom value of (Picked unit))] - NewLife[(Custom value of (Picked unit))])))
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (TempInt Greater than 1) and (TempInt Less than 49000)
                            Then - Actions
                                Floating Text - Create floating text that reads ( -  + (String(TempInt))) at TempLocation[2] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                                Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 45.00 degrees
                                Floating Text - Change (Last created floating text): Disable permanence
                                Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
                            Else - Actions
                        Custom script:   call RemoveLocation(udg_TempLocation[1])
                        Custom script:   call RemoveLocation(udg_TempLocation[2])
                    Else - Actions
                Set OldLife[(Custom value of (Picked unit))] = (Life of (Picked unit))
                Set OldExp[(Custom value of (Picked unit))] = (Hero experience of (Picked unit))
        Custom script:   call DestroyGroup(udg_TempGroup)

BienDemUnit is a variable to count the unit.

Aggg,i'm from Vietnam,so i'm sorry if my English is bad.
 

perkeyone

something clever
Reaction score
71
i think there is an easier way to detect damage and display it.

Code:
trigger 1

event
map initialization

action
pick every unit in playable map
   add picked unit to damage group
   add event to trigger 3 (picked unit is damaged)

Code:
trigger 2

event
unit enters playable map area

action
if unit is not in damage group
  add unit to damage group
  add event to trigger 3 (picked unit is damaged)

Code:
trigger 3

action
 create floating text for the damage

those codes are freehand
idk how you could do experience
ive never looked into it
 

lucifekit

New Member
Reaction score
2
Plz look to this
My spell have many dummy unit and have several times dealing damage<e.g: a spell with 18 dummy unit go to 18 way from the caster>.So if i use the old show damage system it's show very much value,and it's hard to be seen.

At this spell,it's will show 18 value above the unit,the 18 number is very close to each other.

And another example,in a boss's hunting,10 player continues to use spell and attack to the boss,very much value come out and it's hard to see.
 

perkeyone

something clever
Reaction score
71
maybe you should add the dummy casters to a different unit group instead of damage

then display only one of the units damage x 18
 

lucifekit

New Member
Reaction score
2
can u explain it ? if i have to write one show damage trigger for each spell,it's very tired T_T

maybe it's ok with dummies,but maybe it doesn't ok with a spell that i use " cause hero to damage unit,dealing xxx damage..."???

in sum,plz help me about my trigger,is that leak or lag?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top