Compartilhe

terça-feira, 18 de janeiro de 2011

Unreal Script - Building better Weapons

Last night I had a bit of a talk about how someone had made a gun you can attach a silencer and scope and everything else to, and that their source code was available. In the short time that I’ve been awake this morning, I’ve managed to adapt this into my own application. I have used their guns, as quite simply everything was already set up, animated and textured, which for someone who is more of a coder than an artist is probably a good thing.

Anyhow, here is the result of what I got up to:

Having had a look at how PROOF had his code set up, it appears that the only lines I may have been missing came from my weapon class under the addFlashlight function:

simulated function addFlashlight()
{
if(bLight)
{
WorldInfo.Game.Broadcast(self, "Light removed");
PlayWeaponAnimation( 'SupOFF', 2.0 );
SkeletalMeshComponent(Mesh).DetachComponent(SlincerAttachment);

Flashlight.Destroy();
bLight = false;
}
else
{
WorldInfo.Game.Broadcast(self, "Light added");
PlayWeaponAnimation( 'SupON', 2.0 );
SkeletalMeshComponent(Mesh).AttachComponentToSocket(SlincerAttachment,SlincerSocket);

Flashlight = Spawn(class'ZO_WATT_Light', self);
Flashlight.SetBase(self);
Flashlight.LightComponent.SetEnabled(bLightEnabled);
bLight = true;
}
}

It all looks very simple, but was definitely the source of a few hours of head scratching to make it all happen. Big thanks to PROOF at unreal-level.ru for releasing his code to the public domain, as it has definitely pointed me where I need to be pointed for this one. Next on the list is to actually make my own guns with various attachments – so stay tuned!

0 comentários:

Postar um comentário

Seu comentário é importante para a manutenção do BLOG.

Não será publicado comentários que infringirem as seguintes regras:

01- ofensas gratuitas aos membros da UDKBrasil
02- descrédito para com a postagem
03- links com malwares ou qualquer tipo de fraude
04- palavras de baixo calão contra participantes
05- links de download não serão permitidos, a não ser que sejam gratuitos (freeware ou software de teste) e relacionados a UDK ou Computação Grafica.

Pedimos a gentileza de não USAR CAPS LOCK ligado.

OBS; assim que seu comentário for publicado,se junto dele NÃO houver uma resposta para sua dúvida,é porque não sabemos te responder...infelizmente, não sabemos de tudo!!

Seja bem vindo.

Fórum UDKBrasil

Top View Semanal

Top View Mensal

Top View de todos os Tempos

 
UDK BRASIL | by TNB ©2010