CyberP
Unwanted
- Joined
- Aug 2, 2013
- Messages
- 1,711
Can I request some help? DeusEx modding communities are dead so here will have to do.
Unrealscript (unreal Engine 1, so no functions present in later versions or Kismet stuff).
Deus Ex's game code.
Player class (DeusExPlayer.u)
What I need to do: Make Multitools able to hack keypads and such at range.
Why: Lockpick & multitools cost the same, there are the same number of these tools across the game on average, and roughly the same number of hack/pickable devices too. However, multitools are slightly less worthy of investment due to the fact that by the time you are in reach of a camera, turret, alarm unit etc, you have usually overcome the threat they present (you are out of the turret or cameras FOV, you've cleaned out the place before reaching the alarm unit etc) so by making multitools a ranged tool balance will be achieved and infiltration would be more interesting, plus multitools are already wireless anyhow.
What I want to do is if (inHand.IsA('Multitool')) Then Increase maxFrobDistance, but only for hackabledevices.
I've made a number of attempts but am struggling to solve this problem.
It may be a bit of vague problem, but I am hoping someone can help. The code has a few comments so it should be easy enough to understand. Follow-up questions will be answered swiftly. This function is needed so we can Frob targets at a distance and also so the object highlight is displayed, so we can see how many multitools are needed to hack the objects.
I haven't been coding too long so please use laymans terms if necessary.
Unrealscript (unreal Engine 1, so no functions present in later versions or Kismet stuff).
Deus Ex's game code.
Player class (DeusExPlayer.u)
What I need to do: Make Multitools able to hack keypads and such at range.
Why: Lockpick & multitools cost the same, there are the same number of these tools across the game on average, and roughly the same number of hack/pickable devices too. However, multitools are slightly less worthy of investment due to the fact that by the time you are in reach of a camera, turret, alarm unit etc, you have usually overcome the threat they present (you are out of the turret or cameras FOV, you've cleaned out the place before reaching the alarm unit etc) so by making multitools a ranged tool balance will be achieved and infiltration would be more interesting, plus multitools are already wireless anyhow.
Code:
// ----------------------------------------------------------------------
// HighlightCenterObject()
//
// checks to see if an object can be frobbed, if so, then highlight it
// ----------------------------------------------------------------------
function HighlightCenterObject()
{
local Actor target, smallestTarget;
local Vector HitLoc, HitNormal, StartTrace, EndTrace;
local DeusExRootWindow root;
local float minSize;
local bool bFirstTarget;
if (IsInState('Dying'))
return;
root = DeusExRootWindow(rootWindow);
// only do the trace every tenth of a second
if (FrobTime >= 0.1)
{
// figure out how far ahead we should trace
StartTrace = Location;
EndTrace = Location + (Vector(ViewRotation) * MaxFrobDistance);
// adjust for the eye height
StartTrace.Z += BaseEyeHeight;
EndTrace.Z += BaseEyeHeight;
smallestTarget = None;
minSize = 99999;
bFirstTarget = True;
// find the object that we are looking at
// make sure we don't select the object that we're carrying
// use the last traced object as the target...this will handle
// smaller items under larger items for example
// ScriptedPawns always have precedence, though
foreach TraceActors(class'Actor', target, HitLoc, HitNormal, EndTrace, StartTrace)
{
if (IsFrobbable(target) && (target != CarriedDecoration))
{
if (target.IsA('ScriptedPawn'))
{
smallestTarget = target;
break;
}
else if (target.IsA('Mover') && bFirstTarget)
{
smallestTarget = target;
break;
}
else if (target.CollisionRadius < minSize)
{
minSize = target.CollisionRadius;
smallestTarget = target;
bFirstTarget = False;
}
}
}
FrobTarget = smallestTarget;
// reset our frob timer
FrobTime = 0;
}
}
What I want to do is if (inHand.IsA('Multitool')) Then Increase maxFrobDistance, but only for hackabledevices.
I've made a number of attempts but am struggling to solve this problem.
It may be a bit of vague problem, but I am hoping someone can help. The code has a few comments so it should be easy enough to understand. Follow-up questions will be answered swiftly. This function is needed so we can Frob targets at a distance and also so the object highlight is displayed, so we can see how many multitools are needed to hack the objects.
I haven't been coding too long so please use laymans terms if necessary.