Doing custom stats??
Blitz3D Forums/Blitz3D Programming/Doing custom stats??
| ||
in my rpg engine im allowing custom stats for the characters etc and they are all stored in a string for each char eg Health=99|MaxHealth=100|speed=34| etc which means unlimited stats upto a max string length, is this wise, are string functions fast enough. Most of the custom stuff is based on this process and works well allowing unlimited user animations,stats etc where i just parse the strings and grab what i need(from the ton of functions ive made) eg AddCharStat(ent,StatName$,Value$=0) DeleteCharStat(ent,StatName$) GetCharStatInt%(ent,StatName$);plus to return as string/float SetCharStatInt%(ent,StatName$,value$);also ones which set int/float etc in this way it lets the user have a stat without no definite type ie doesnt have to be either string,float or int but all of them based on the function used to return the value. Do you think its a good idea? it seems alot simpler and more powerful than doing something like type npc field mesh.EntityModel field stats.EntityStatistics end type type EntityStatistics field StatName$[MaxStats] field IntValue%[MaxStats] field FloatValue#[MaxStats] field StrValue$[MaxStats] end type or type EntityStatistics field Health% field MaxHealth% field Speed% field Power% end type what are your thoughts? |