View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001792SphereServernew feature requestpublic08-08-10 16:1623-08-10 21:37
Reporterxantier 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version0.56c Nightly 
Target VersionFixed in Version 
Summary0001792: Overriding Hardcoded Functions
DescriptionI 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.
TagsNo tags attached.
Nightly VersionNot Available
Experimental FlagsNone
Option FlagsNone
Internal Build Number
Attached Files

- Relationships

-  Notes
(0000543)
Mirravin (reporter)
08-08-10 16:36

Yes, it can be very useful...
(0000589)
MrSugarCube (administrator)
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.

- Issue History
Date Modified Username Field Change
08-08-10 16:16 xantier New Issue
08-08-10 16:16 xantier Nightly Version => Not Available
08-08-10 16:16 xantier Experimental Flags => None
08-08-10 16:16 xantier Option Flags => None
08-08-10 16:36 Mirravin Note Added: 0000543
23-08-10 21:37 MrSugarCube Status new => closed
23-08-10 21:37 MrSugarCube Note Added: 0000589
23-08-10 21:37 MrSugarCube Resolution open => won't fix


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker