SphereServer BugTracker - SphereServer
View Issue Details
0001792SphereServernew feature requestpublic08-08-10 16:1623-08-10 21:37
xantier 
 
normalfeaturealways
closedwon't fix 
0.56c Nightly 
 
Not Available
None
None
0001792: Overriding Hardcoded Functions
I think this suggestion will solve most of common problems. As RunUO (c#) coding has overriding ability, coders can customize the server freely.. Why not also in SphereServer ? Main idea is to override hardcoded functions so that we can customize everything hardcoded. How ? See the example :

Most known problem is Highlight color of characters. This is controlled by NotoGetFlag function. You will have to rewrite complete NotoGetFlag. It will require a bit professional scripting knowledge. We want player 1 to see player 2 as orange :


[override function NotoGetFlag]
ref1=<argv[0]> // viewer serial

if (<ref1.uid>==Player1Uid) && (<uid>==Player2Uid)
return NOTO_ORANGE // or NOTO_ENEMY ?
endif


... overrided notogetflag code ...
...
..


You can ask "you can already do this by creating your of noto function". But this is override. So this will affect everything related with hardcoded Notogetflag. So you will see player 2 as orange and you will be able to attack him freely. If you had created your own noto function, this wouldn't affect anything hardcoded, it was just going to be your own check.


Example 2 , you want to rewrite your own Canseelos function :


[override function Canseelos]
///argv[0] or args will be uid or location to see
if (xxx)
return 1 // in sight, you can see
else
return 0 // not in line of sight
endif


[override function CanseelosFlag]
///argv[1,2,3] will be uid or location to see
///argv[0] flag
if (xxx)
return 1 // in sight, you can see
else
return 0 // not in line of sight
endif


I hope you understood main idea. These are two functions i have just remembered. One more example :

[override function resurrect]
MENU m_are_you_sure


Overriding hardcoded functions will surely be a difficult thing for sphere scripters. Because there would be lots of checks we can miss. But this feature will make sphereserver more customizable.
No tags attached.
Issue History
08-08-10 16:16xantierNew Issue
08-08-10 16:16xantierNightly Version => Not Available
08-08-10 16:16xantierExperimental Flags => None
08-08-10 16:16xantierOption Flags => None
08-08-10 16:36MirravinNote Added: 0000543
23-08-10 21:37MrSugarCubeStatusnew => closed
23-08-10 21:37MrSugarCubeNote Added: 0000589
23-08-10 21:37MrSugarCubeResolutionopen => won't fix

Notes
(0000543)
Mirravin   
08-08-10 16:36   
Yes, it can be very useful...
(0000589)
MrSugarCube   
23-08-10 21:37   
We can add triggers to where they may be useful and appropriate, but it's not practical to provide an override for every single internal function.