First off, identifying the functions that'll be needed to be changed to edit the functionality of these functions.
First off: Scope.
- ScopeOn()
ScopeOff()
ScopeToggle()
and their codes are:
- Code: Select all
function ScopeOn()
{
if (bHasScope && !bZoomed && (Owner != None) && Owner.IsA('DeusExPlayer'))
{
// Show the Scope View
bZoomed = True;
RefreshScopeDisplay(DeusExPlayer(Owner), False, bZoomed);
}
}
function ScopeOff()
{
if (bHasScope && bZoomed && (Owner != None) && Owner.IsA('DeusExPlayer'))
{
bZoomed = False;
// Hide the Scope View
RefreshScopeDisplay(DeusExPlayer(Owner), False, bZoomed);
//DeusExRootWindow(DeusExPlayer(Owner).rootWindow).scopeView.DeactivateView();
}
}
simulated function ScopeToggle()
{
if (IsInState('Idle'))
{
if (bHasScope && (Owner != None) && Owner.IsA('DeusExPlayer'))
{
if (bZoomed)
ScopeOff();
else
ScopeOn();
}
}
}
However, you don't want a boring old scope button thingy, do you? No? Well then, hang about. I'm going to show you how to get it to do something intresting...
![Wink ;)](./images/smilies/icon_wink.gif)
- Code: Select all
function ScopeOn()
{
}
function ScopeOff()
{
}
simulated function ScopeToggle()
{
if (bHasScope)
{
if (bZoomed)
ScopeOff();
else
ScopeOn();
}
}
Right, that's gotten rid of everything that the original scope needs. (Note, this'll mean you can no longer use a scope, so make something decent to replace it...) Now, to make it do something cool. Hmm... ideas ideas ideas...
Well, I suppose summoning a Plasma Bolt will have to do. I can't think of anything better.
- Code: Select all
function ScopeOn()
{
Spawn(class'PlasmaBolt',Pawn(Owner),,Pawn(Owner).Location,Pawn(Owner).ViewRotation);
}
function ScopeOff()
{
Spawn(class'PlasmaBolt',Pawn(Owner),,Pawn(Owner).Location,Pawn(Owner).ViewRotation);
}
simulated function ScopeToggle()
{
if (bHasScope)
{
if (bZoomed)
ScopeOff();
else
ScopeOn();
}
}
The Pawn(Owner) parts are being used to get the location and rotation to fire the projectile at. Also, this can be used to modify the owner of a weapon in several other 'interesting' ways... Now, if you have a weapon with a scope on it, and this code in it's source, the scope will, instead of zooming in, spit out plasma bolts.
I'm going to have to add to this later/tomorrow, school work beckons to be dealt with...