Damage

byEvanthe

Интересующийся
Участник
Сообщения
103
Розыгрыши
0
Решения
1
Репутация
0
Реакции
6
Баллы
380
Hello everyone, it is possible to display damage on screen on H5? And if it's possible, i can find a tutorial about how to make it done
?Thank you !
 

I saw this, but there isn't a start & end of the tutorial. Idk how to add/modify etc. I dont know the package where i should write etc etc
 
I saw this, but there isn't a start & end of the tutorial. Idk how to add/modify etc. I dont know the package where i should write etc etc
well, for tutorial a bit harder, but unless you don't know how to add/change Interface.u/Interface.xdat - i suggest looking towards paying someone (i know bad example). Try as starting point (its in russian, but you can just follow what he is doing, kind of understanding).
Once u know how to edit/work with .u and .xdat files - that topic will make more sense.
 
Why i don't have the option as in video in my XDAT? 1724617645782.png

I have this 1724617666046.png
 
Yes but i have to do 28 :)))))))))))))))))))))))))))))))))))

1724621927856.png
Done!

It's done all 28 !!
 
Последнее редактирование модератором:
  • Мне нравится
Реакции: Vasi
Well, i don;t know how to do that :D But with little help, i can
 
Where i should write this `FormatNumberWithSpaces` and it is function?
 
Запрещено публиковать исходный код без BB-кода — CODE
Well, i don;t know where in this class to add
that
/************************************************

Developer: BITHACK

Copyright (c) 1995,2022 Your company

Script description:....

*************************************************/
class BIT_DemageHUD extends UICommonAPI;

var WindowHandleMe;

const DAMAGE_MESSAGE_OFFSET = 100;
const MAX_DAMAGE_MESSAGE = 28;
var TextBoxHandle DamageText[MAX_DAMAGE_MESSAGE]; //that's how many TextBoxes we need in xdat, i.e. 28

function OnRegisterEvent(){ /* Register game events */

RegisterEvent(EV_SystemMessage);

}

function OnLoad() {

local int i;

Me = GetWindowHandle("BIT_DemageHUD");

for (i=0; i<=MAX_DAMAGE_MESSAGE; i++){
DamageText = GetTextBoxHandle("BIT_DemageHUD.D-" $i);
DamageText.SetText("");
}

}

function OnEvent(int Event_ID, string a_param){

if(Event_ID == EV_SystemMessage) {
HandleSystemMessage(a_param);
}

}

function HandleSystemMessage (string a_Param){

local Color RedColor, WhiteColor;
local int SystemMsgIndex;

ParseInt(a_Param,"Index",SystemMsgIndex);

RedColor.R = 205; RedColor.G = 0; RedColor.B = 0;

WhiteColor.R = 255; WhiteColor.G = 255; WhiteColor.B = 255;

switch (SystemMsgIndex)
{
case 2261: //player msg
case 2281: //summoner msg
DemageHud(WhiteColor, a_param); //Our damage, color white
break;
case 2262: //player msg
case 2263: //player msg
DemageHud(RedColor, a_param); //Damage from enemy, color red
break;
}

}


function DemageHud(Color DColor, string a_param){

local int DamageToPlayer, i;

for(i=0; i <= MAX_DAMAGE_MESSAGE; i++)
{
if(DamageText.GetText() == "") //run in a loop until we hit a free TextBox
{
DamageText.SetAlpha(255); //force opacity, in theory you can tweak the fade in

ParseInt( a_Param, "Param3", DamageToPlayer); //damage number
DamageText.SetText(string(DamageToPlayer)); //set the damage number to a free index of the textbox array
DamageText.SetAnchor( "BIT_DemageHUD", "BottomCenter", "BottomCenter", -120 + Rand(150), Rand(100) ); //select a random point
DamageText.ClearAnchor(); //remove the anchor from the window after the previous action
DamageText.Move(0, -1500, 8f); //start moving the textbox to -1500 (up) with a speed of 8
DamageText.SetTextColor(DColor);
DamageText.SetAlpha( 0, 2.8f ); //smoothly make the textbox transparent
Me.KillTimer(i + DAMAGE_MESSAGE_OFFSET + 1); //kill the timer (index + constant + 1)
Me.SetTimer(i + DAMAGE_MESSAGE_OFFSET + 1, 2500); //we start a timer for this textbox based on the same (index + constant + 1)
break;
}
}

}

function OnTimer(int TimerID){

Me.KillTimer(TimerID); //we kill any timer at the very beginning, the ID is not important to us here

if(TimerID >= 101 && TimerID <= 200) //Here the logic of the factory timer index + DAMAGE_MESSAGE_OFFSET is connected
{
DamageText[TimerID-DAMAGE_MESSAGE_OFFSET-1].SetText(""); //remove the text from the textbox so that it is freed
}

}

defaultproperties{}


Just tell me in what function i should add this FormatNumberWithSpaces(value);
 
Последнее редактирование модератором:
Just tell me in what function i should add this FormatNumberWithSpaces(value);

DamageText.SetText(string(DamageToPlayer)); //set the damage number to a free index of the textbox array
change to
DamageText.SetText(FormatNumberWithSpaces(DamageToPlayer)); //set the damage number to a free index of the textbox array

if it works, great, if not - ignore it.
All that function does - is change the numbers from 111111111 to 111 111 111. Makes it look better, ish.
 
not even sure where this comes from. ignore it than. use what you have
 
Назад
Сверху Снизу