sexta-feira, 2 de agosto de 2013

Tutorial como colocar o efeito de Call of Duty 4 quando esta com pouca vida.

Tutorial como colocar o efeito de Call of Duty 4 quando esta com pouca vida.


Desculpe pela tradução ruim,doi feita no Google.

Abra o Editor UDK 
Abra o navegador de conteúdo 
Encontrar um arquivo chamado "Eny_Effects.Beams.Materials.M_EFX_Beam_EnergyScro ll_01" (ou outro material "animado"). 
Botão direito do mouse e copie-o clicando em "Criar uma cópia" (duh!), Dar-lhe um nome de pacote (Você precisa se lembrar disso!). I o nome "Throb01" para este tutorial.
Apague o "Grupo" informação e dar-lhe um nome de fácil (ou difícil, mas você precisa se lembrar disso). 
Certifique-se de habilitar "Salvar Packages" (não estou 100% de certeza se é realmente necessário, mas me acostumei a ele devido ao kismet-bastardo de estragar meus pacotes se eu não ativá-lo.) 
Vai agora criaram um novo pacote para você, clique direito sobre ela e salvar que, em / UDK / UTGame Conteúdo / YOURGAMENAME / UPK 
Tudo feito no editor, fechá-lo 

myHUD.uc criação, preparação, materiais de desenho., os detalhes!

Abra o seu ambiente de programação da escolha, eu estou usando o Microsoft Visual Studio Shell de 2008 com nFringe. 

Crie um arquivo de script UC e nomeá-lo algo que você gosta, eu vou estar usando "myHUD" neste tutorial. 

Salve-o em / UDK / Desenvolvimento / YOURGAMENAME / Src / Classes / 

Alterar pouco da "classe" na parte superior do documento para:

class myHUD extends UTHUD; 
  
Isso amplia o arquivo UTHUD 

Adicione esta linha abaixo dela:

var Material Throb01;

Isso define o material que nós fizemos no navegador conteúdo.

Adicione o seguinte pedaço de código abaixo dele:

function DrawGameHud()

{
//Let's define the following: IF the player has equal to or less than 100 (<=100) AND (&&) has more or equal to 61 (>=61) then draw the material (detailed below)

if (PlayerOwner.Pawn.Health <=100 && PlayerOwner.Pawn.Health >=61)


{
//Let's draw the material, this looks is similar to drawing a texture (drawtile)
Canvas.DrawMaterialTile(Default.Throb01, 200, 100);


}


//Now it DOESN'T display the material if the player's health is equal or smaller than 60 (<=) AND greater than or equal to 30 (you could insert a different material here if you wanted to, I am just not displaying it to show you it works. Change "Throb01" to your new material if you want to do that, be sure to define it).


if (PlayerOwner.Pawn.Health <=60 && PlayerOwner.Pawn.Health >=30)
{
//Drawing a Material
//Canvas.DrawMaterialTile(Default.Throb01, 200, 100);


}
}

Adicione o seguinte ao default properties:

Throb01 = Material'myHUD.throb01'

O "myHUD" sendo o nosso pacote no editor de conteúdo, e "throb01" o material em nosso pacote.


E pronto! Receba um lançador de foguetes ou algo que possa prejudicar a sua saúde, o fogo de um foguete em si mesmo e você verá que ele irá exibir o material de saúde acima de 60, e não apresentá-lo abaixo de 60 saúde.

Para fazer igual ao Call of Duty:

Mova a localização do material e redimensioná-lo (eu provavelmente centro-la e ampliá-lo para caber na tela, em seguida, faça o centro do meu material só branco, transparente)

Código inteiro:

//Class



class myHUD extends UTHUD;


//Variables


var Material Throb01;


//Drawing the actual hud elements and linking them


function DrawGameHud()

{


//Let's define the following: IF the player has equal to or less than 100 (<=100) AND (&&) has more or equal to 61 (>=61) then draw the material (detailed below)


if (PlayerOwner.Pawn.Health <=100 && PlayerOwner.Pawn.Health >=61)


{


//Let's draw the material, this looks is similar to drawing a texture (drawtile)


Canvas.DrawMaterialTile(Default.Throb01, 200, 100);


}


//Now it DOESN'T display the material if the player's health is equal or smaller than 60 (<=) AND greater than or equal to 30 (you could insert a different material here if you wanted to, I am just not displaying it to show you it works. Change "Throb01" to your new material if you want to do that, be sure to define it).


if (PlayerOwner.Pawn.Health <=60 && PlayerOwner.Pawn.Health >=30)


{


//Drawing a Material


//Canvas.DrawMaterialTile(Default.Throb01, 200, 100);


}

}
defaultproperties


{


Throb01 = Material'myHUD.throb01'


}

Nenhum comentário:

Postar um comentário