Ok... I started a StdAsh.ash lib right now it hasn't got too much in it but I kind of wanted to get the ball rolling. Each function is documented and credited in the .ash file. If I used a function you want me to not have used, or if I credited the wrong code monkey. Let me know. Remeber to feel free to suggest functions, prewritten or requests.
changelog:
[size=8pt]
Ver 1.0 22Feb08:
void SET_D_PRINT(int )
void D_PRINT(string msg, int lvl)
boolean OBTAIN(int n, string cond, location locale)
boolean USE_UPTO(int n, item doodad, boolean purchase)
int min(int a, int b)
float min(float a, float b)
int max(int a, int b)
float max(float a, float b)
int pin(int low, int hi, int val)
float pin(float low, float hi, float val)
element to_element(int)
int to_int(element)
element NEXT_ELEMENT(int, int )
element NEXT_ELEMENT(int)
element NEXT_ELEMENT(element, int)
element NEXT_ELEMENT(element)
int ELEMENT_DAMAGE(int, int)
int ELEMENT_DAMAGE(element, element)
element ELEMENT_WEAKNESS(int, boolean)
element ELEMENT_WEAKNESS(element, boolean)
element ELEMENT_WEAKNESS(int)
element ELEMENT_WEAKNESS(element)
[/size]
So I was looking at a recent post by raorn about some requests for some functions to be directly accessible from the ash scripting language when holatuwol made a very good point about how some and possibly many common tasks could be put into standardized .ash libraries. Personally I think this would be a very good idea.
So, I was thinking about the best way to go about implementing this. My thoughts were pretty much as follows, I would start a thread where people could make suggestions about common functions they would think belongs in such a lib. and I, along with anyone else willing to help could start creating a libash.ash file. I think that at first, we probably wouldn't have to many functions so one .ash file would be able to handle it... but if it started to grow we could break them into multiple libs... plus it would be easy to have a "Master" copy which held all the functions created so far and if you didn't need all the functions you could make a copy of the master, delete the unused functions and include only the code you used.
Also one of the good things about making such a standardized lib is that we can all work together and hopefully end up with the best implementations of each of these suggested functions.
So... I'll start this thread to let anyone request or suggest some functions.
changelog:
[size=8pt]
Ver 1.0 22Feb08:
void SET_D_PRINT(int )
void D_PRINT(string msg, int lvl)
boolean OBTAIN(int n, string cond, location locale)
boolean USE_UPTO(int n, item doodad, boolean purchase)
int min(int a, int b)
float min(float a, float b)
int max(int a, int b)
float max(float a, float b)
int pin(int low, int hi, int val)
float pin(float low, float hi, float val)
element to_element(int)
int to_int(element)
element NEXT_ELEMENT(int, int )
element NEXT_ELEMENT(int)
element NEXT_ELEMENT(element, int)
element NEXT_ELEMENT(element)
int ELEMENT_DAMAGE(int, int)
int ELEMENT_DAMAGE(element, element)
element ELEMENT_WEAKNESS(int, boolean)
element ELEMENT_WEAKNESS(element, boolean)
element ELEMENT_WEAKNESS(int)
element ELEMENT_WEAKNESS(element)
[/size]
So I was looking at a recent post by raorn about some requests for some functions to be directly accessible from the ash scripting language when holatuwol made a very good point about how some and possibly many common tasks could be put into standardized .ash libraries. Personally I think this would be a very good idea.
So, I was thinking about the best way to go about implementing this. My thoughts were pretty much as follows, I would start a thread where people could make suggestions about common functions they would think belongs in such a lib. and I, along with anyone else willing to help could start creating a libash.ash file. I think that at first, we probably wouldn't have to many functions so one .ash file would be able to handle it... but if it started to grow we could break them into multiple libs... plus it would be easy to have a "Master" copy which held all the functions created so far and if you didn't need all the functions you could make a copy of the master, delete the unused functions and include only the code you used.
Also one of the good things about making such a standardized lib is that we can all work together and hopefully end up with the best implementations of each of these suggested functions.
So... I'll start this thread to let anyone request or suggest some functions.