Gu3st...
2011-01-05 14:19:34
As we have it right now, we have to hard-code defines and stuff like that into the include to make Extras work. Cstrikes Extra is an awfully good example of this.. A lot of people has been asking about a world walker, and each time we've said "We haven't implemented it yet", and I find that to be a bad way of doing it, so I had to think about ways to do it so people can use Extras "plug-and-play" mode.
This way, the person that made the Extra can implement the Extra himself. All the user has to do is to include it.
How? Well… One way of doing this is to make an array of procedures like SRL does: (but there could be other ways)
Now the Extra creator (in my example cstrike) can do MSI_OnWalkToCall := @cstrike_WalkTo; and MSI would check if the respecting msi_proc is set before calling MSI's WalkTo. If it's set then it'll skip MSI's WalkTo and do the Extra's walkto, if it's not then we'll use MSI's Extra.
In the case that there's more than one Extra that requires a proc, we could make it that the user has to choose which one to use or both of them or something like that… We'll figure that out later; after all.. This is the 'Planning' sub-forum ;)
This would open a lot of doors to people who want to contribute to MSI the Extra way (Like Boreas, who is working on CTWB (Color Tile Walking Base). If this Extra was in MSI, then the development of that project would increase a lot (because atm if you want to help development of that project the scripter has to edit all they're GetMyPos to CTWB_GetMyPos)).
We could have MSI_OnFormOpen/Close, MSI_OnLogin/out, MSI_OnScriptChange and so on.
I really, really, really want this to happen, and this would also make it possible for me to realize one of my dreams…. more on that later ;)
Any comments?
This way, the person that made the Extra can implement the Extra himself. All the user has to do is to include it.
How? Well… One way of doing this is to make an array of procedures like SRL does: (but there could be other ways)
{ const SRL_Procs Constants;
Description: Constants for SRL_Procs. }
const
srl_AntiBan = 0; // Your AntiBan procedure to be called during various SRL functions and procedures. (Flag, FFlag)
srl_OnFindMod = 1; // After a player or Jagex mod is detected talking in the chat box.
srl_OnFindDead = 2; // After the text 'Oh dear you are dead' is detected.
srl_OnFindFight = 3; // After detecting a fighting random.
srl_OnFindTrade = 4; // After the trade has been attempted (either success or failure).
srl_OnNextPlayer = 5; // While the players are logged out and before CurrentPlayer changes.
srl_OnSendStats = 6; // After SRL Script Stats are sent to the server.
srl_OnRandomCall = 7; // Called in FindNormalRandoms, FindInventoryRandoms, FindNonInventoryRandoms. (NOT ONLY WHEN RANDOMS ARE DETECTED).
srl_OnFindRandom = 8; // After a random event is detected. (FNR, FIR, FNIR, FT)
srl_OnLogOut = 9; // Just before the player is logged out.
srl_InNextPlayerLoop = 10; // During the infinite loop in NextPlayer when all players are inactive.
srl_OnCustomRC = 11; // When custom RC trigger has been given.
srl_OnExitToLobby = 12; // On exit to lobby
srl_OnLogIn = 13; // Right after player has successfully logged in.
{ var SRL_Procs: array [0..12] of procedure();
Description: Varibles to store user-defined procs to be called in SRL. }
var
SRL_Procs: array [0..13] of procedure();Now the Extra creator (in my example cstrike) can do MSI_OnWalkToCall := @cstrike_WalkTo; and MSI would check if the respecting msi_proc is set before calling MSI's WalkTo. If it's set then it'll skip MSI's WalkTo and do the Extra's walkto, if it's not then we'll use MSI's Extra.
In the case that there's more than one Extra that requires a proc, we could make it that the user has to choose which one to use or both of them or something like that… We'll figure that out later; after all.. This is the 'Planning' sub-forum ;)
This would open a lot of doors to people who want to contribute to MSI the Extra way (Like Boreas, who is working on CTWB (Color Tile Walking Base). If this Extra was in MSI, then the development of that project would increase a lot (because atm if you want to help development of that project the scripter has to edit all they're GetMyPos to CTWB_GetMyPos)).
We could have MSI_OnFormOpen/Close, MSI_OnLogin/out, MSI_OnScriptChange and so on.
I really, really, really want this to happen, and this would also make it possible for me to realize one of my dreams…. more on that later ;)
Any comments?