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.
BienDemUnit is a variable to count the unit.
Aggg,i'm from Vietnam,so i'm sorry if my English is bad.
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.