An API that lets developers set custom attributes and properties on players such that ANY plugin may view them (and edit them in the case of properties). The core should also work with any game.
Basics:
Spoiler
[1]Create an 'Egg' and add attributes to it
Code:
Egg myegg = BossEngine_CreateEgg("egghead");
if (myegg != INVALID_EGG)
{
myegg.LoadConfig("egghead");
myegg.SetAttribute("egghead_power");
myegg.SetAttribute("egghead_power2", "10.0");
myegg.ClearAttribute("egghead_power3");
}
[2] Create a monster from that egg by binding it to a client
Code:
public void OnClientPutInGame(int client)
{
Monster chickenlord = BossEngine_CreateMonster(client, myegg);
return;
}
[3] Do stuff
Code:
// in another plugin
public void BossEngine_MonsterCreated(Monster thing, const char[] name, int client)
{
if (thing.HasAttribute("egghead_power"))
{
SDKHook(client, SDKHook_GetMaxHealth, MaxHealthOver9000);
}
char szData[5];
float scale = 0.0;
if (thing.GetAttribute("egghead_power2", szData, sizeof(szData)))
{
scale = StringToFloat(szData);
}
for (int i = 0; i < scale; i++)
{
// do something 10 times
}
}
Other Info:- When a monster is created from an egg, it inherits all its attributes in that instant. Further changes to the egg will not be reflected on the monster
- Attributes on a monster are constant. There is no method available for editing them, only retrieving them.
- Monster Properties are not constant. Any plugin is free to add, modify or remove properties on any monster.
TODO:- Make this page fancier
- Make it possible for configs to contain filenames of other configs (that will also get loaded)
- Allow 'Monsters' to be bound to any entity
- Squish any bugs (help will be much appreciated)
For anything else, send me a PM