|
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
Arnk Kilo Dylie Seasoned Helper
Age:37 Gender: Joined: Jul 14 2006 Posts: 108 Offline
|
Posted: Sat Jan 23, 2010 1:12 am Post subject: ACE -- ASSS C Enricher (beta) |
|
|
|
|
I'm a lazy guy, and this is a tool that I pieced together to enable my lazy tendencies. With any luck, it will be useful to you too.
ACE is a tool for building modules. Some of the most tedious things asss makes you do are automated by using a special middle language that has directives and expansion functions wrapped around your usual C functions.
After working on it on and off for a few months, I am making a beta release to get feedback and iron out any problems I couldn't find in my simple tests of everything (and any really embarrassing things like debug messages that break the output!)
The target audience for this tool is lazy programmers, or specifically anyone who is annoyed at some of the overhead in making well-behaved modules (gracefully failing, logging why load failed, registering/unregistering things, etc.)
Major functionality:
* Generate full asss modules (especially the entry point function) from a builder language that lets the user specify specific asss patterns.
* Wrap asss constructs including callbacks, interfaces, commands, and advisers by automatically registering and unregistering them in the correct order.
* Specify what interfaces your module needs to successfully load, and ACE will fully handle and log any failures to obtain the interfaces.
* Automatic handling of "dynamic" per-arena-data and per-player-data, allowing full structures to only be allocated when they apply.
* Automatically prototype functions.
It is designed to work with the asss makefile if you put it in the src/ace/ folder right now, with your input files using the .aces extension. You still have to put your modules in a .mk for so_files=blah like normal C modules.
Stand in awe at how a simple hello-world program is actually about as many lines as one should be in ACE, while the resulting C program is much bigger (even if you don't count the fourth-gear logging and error handling ACE adds):
$#module greeter
$#callback global CB_PLAYERACTION
void paction(Player *p, int action, Arena *a)
{
if (action == PA_CONNECT)
chat->SendMessage(p, "Greetings, human.");
}
$#endcallback
|
#include "asss.h"
local Imodman *mm;
local Ilogman *lm = 0;
local Ichat *chat = 0;
local void paction(Player *p, int action, Arena *a);
void paction(Player *p, int action, Arena *a)
{
if (action == PA_CONNECT)
chat->SendMessage(p, "Greetings, human.");
}
EXPORT int MM_greeter(int action, Imodman *_mm, Arena *arena)
{
int failedLoad = FALSE;
if (action == MM_LOAD)
{
mm = _mm;
lm = mm->GetInterface(I_LOGMAN, ALLARENAS);
if (!lm)
return MM_FAIL;
chat = mm->GetInterface(I_CHAT, ALLARENAS);
if (!chat)
{
lm->Log(L_ERROR, "<greeter> error obtaining required interface I_CHAT " I_CHAT);
failedLoad = TRUE;
goto ace_fail_load;
}
mm->RegCallback(CB_PLAYERACTION, paction, ALLARENAS);
return MM_OK;
}
else if (action == MM_UNLOAD)
{
mm->UnregCallback(CB_PLAYERACTION, paction, ALLARENAS);
ace_fail_load:
mm->ReleaseInterface(lm);
mm->ReleaseInterface(chat);
if (failedLoad)
return MM_FAIL;
else
return MM_OK;
}
return MM_FAIL;
}
|
I encourage all of you to try ACE and give feedback on the language and performance. Please document issues on the issue tracker, too.
Downloads
Home page - There's fairly complete documentation here, too.
Issue Tracker
Last edited by Arnk Kilo Dylie on Tue Apr 26, 2011 11:04 pm, edited 3 times in total |
|
Back to top |
|
|
Lynx Newbie
Age:35 Gender: Joined: Jan 26 2009 Posts: 19 Location: My mothers basement. Offline
|
Posted: Sat Jan 23, 2010 8:12 am Post subject: |
|
|
|
|
Nice Job |
|
Back to top |
|
|
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Mon Jan 25, 2010 12:02 am Post subject: |
|
|
|
|
im also lazy, therefore i dont feel like downloading anything extra _________________ SSC Distension Owner
SSCU Trench Wars Developer |
|
Back to top |
|
|
Arnk Kilo Dylie Seasoned Helper
Age:37 Gender: Joined: Jul 14 2006 Posts: 108 Offline
|
Posted: Tue Apr 26, 2011 11:04 pm Post subject: |
|
|
|
|
Update: Beta 2 was released. This version is much more polished, and more feature complete, and you are encouraged to try it out and find things it still lacks or that you still want.
SSCE Hockey/Football Zone and SSCE Hyperspace both use this tool to different degrees, and you are encouraged to as well.
Check the downloads links in the first post. |
|
Back to top |
|
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 130 page(s) served in previous 5 minutes.
|