View Full Version : Vector Variable Assign Question
Psyke
09-30-2010, 04:16 PM
Hi!
I am looking for some newbie help with Vector variable.
I don't know how to edit the values of an vector variable in realtime, only in the defaultProperties.
I have this variable in the defaultProperties:
defaultProperties
{
CrossHairCoordinates=(U=256,V=64,UL=64,VL=64)
}
I want to change the values "U", "V", "UL" and "VL".
I tried many things but doesn't work.
like:
CrossHairCoordinates = (256,64,64,64);
or
CrossHairCoordinates=(U=256,V=64,UL=64,VL=64);
anyway, I appreciate any kind of help, thanks!
ffejnosliw
09-30-2010, 04:24 PM
First, that isn't a Vector. A vector has X, Y, and Z components. (But that is really beside the point)
This should work:
CrossHairCoordinates.U = 256;
CrossHairCoordinates.V = 64;
CrossHairCoordinates.UL = 64;
CrossHairCoordinates.VL = 64;
Psyke
09-30-2010, 04:36 PM
Oh, I thought that was a vector, sorry, hehe
There is no error when I compile the code, but this doesn't change the cursor even if I call this again: CrosshairImage=Texture2D'TormentoPack01.HUD.h_Cros sHairs'
:x
Here is a piece of code:
Switch(FlashLightBrightness)
{
case 0:
BrightnessSpot = 0.f;
FlashLightBrightness = 1;
CrossHairCoordinates.U = 256;
CrossHairCoordinates.V = 448;
CrossHairCoordinates.UL = 64;
CrossHairCoordinates.VL = 64;
CrosshairImage=Texture2D'TormentoPack01.HUD.h_Cros sHairs';
break;
case 1:
BrightnessSpot = 1.f;
FlashLightBrightness = 0;
CrossHairCoordinates.U = 256;
CrossHairCoordinates.V = 64;
CrossHairCoordinates.UL = 64;
CrossHairCoordinates.VL = 64;
CrosshairImage=Texture2D'TormentoPack01.HUD.h_Cros sHairs';
break;
}
Pranav
09-30-2010, 04:38 PM
Dude you need to draw the crossahair image, even if you are extending UTWeapon, nothing is magic ;). That coordinates and the crosshair image will set you up, you need to call a fucntion from the HUD class each DrawHUD() call to display the crosshair
Psyke
09-30-2010, 04:43 PM
But this CrosshairImage=Texture2D'TormentoPack01.HUD.h_Cros sHairs' has a lot of crosshairs made by the udk, it's a unique file, If I change these values from the defaultproperties it works:
CrossHairCoordinates.U = 256;
CrossHairCoordinates.V = 64;
CrossHairCoordinates.UL = 64;
CrossHairCoordinates.VL = 64;
I tried to change the Crosshair image file in REALTIME, example:
CrosshairImage=Texture2D'TormentoPack01.HUD.h_Cros sHairs';
to
CrosshairImage=Texture2D'TormentoPack01.HUD.h_Cros sHairs02'; and it works. but what I need is to change the coordinates to keep all the cursos in one file, if I use that method (change the cursor image file) I need to create 1 file for each cursor.
------
EDIT: this "DrawHUD()" is like an update to the image? I need to call that if I change any information in the HUD like Crosshair coordinates?
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.