Compartilhe

terça-feira, 18 de janeiro de 2011

Unreal Script - Advancing the Flashlight

Last night I made a rudimentary flashlight that was either on or off, pretty simple really. Tonight, this has expanded into the ability to attach or remove a flashlight from a gun, and then turn it on or off if it is attached. This also works between guns, so one of your guns might have the light attached, and the other might not. As is my normal, i have created another video that shows this in action.


There are a couple of minor changes in the script from last night, mainly in the Weapon class, as shown here:

simulated function toggleFlashlight()
{
if(bLight)
{
bLightEnabled = !bLightEnabled;
WorldInfo.Game.Broadcast(self, "Weapon sent trigger");
FlashLightToggled();
// if we are a remote client, make sure the Server Set's toggles the flashlight
if( Role < Role_Authority )
{
ServerToggleFlashlight();
}
}
}

simulated function addFlashlight()
{
if(bLight)
{
PlayWeaponAnimation('reload', 1.0);
WorldInfo.Game.Broadcast(self, "Light removed");
bLight = false;
}
else
{
PlayWeaponAnimation('reload', 1.0);
WorldInfo.Game.Broadcast(self, "Light added");
bLight = true;
}
}

So, as you can see, not a lot different, but it makes a sizeable difference to the way that the game is played. The only things that really remain to be seen from a functional point of view are the implementation of some animations – which knowing me will be very rough ones; and turning the light off when the weapon is put away, otherwise an artifact of the old light is left in place, and a player could quite easily light up a room in this way.

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