I know there's 26 right now but it hardly seems enough for some of the stuff I make. I'm sure others would appreciate more alterable values as well. Would it be possible to increase the number of alterable values an object can have?
Printable View
I know there's 26 right now but it hardly seems enough for some of the stuff I make. I'm sure others would appreciate more alterable values as well. Would it be possible to increase the number of alterable values an object can have?
Click new at the bottom
A-Z,aa-az,ba-bz,etc.
On a completely unrelated note, the left 5 digits on this post number are 15015. The prominent number of which is 15. This is my 1111th post.
Alterable values only have 26 for objects. Global values are infinite. If you are using 26 values per object you must be doing something very complex or you are wasting values. Try having dummy objects to store important information such as map/level details etc and leave objects individual values for important thigns related only to that object.
You also have 10 strings which you can use aswell ;)
Darkesoft, this will reuse older Values, you really only have 26, if you make AA and co you will overwrite older ones.
My suggestion is using ValueAdd Extension to add unlimited alt values to objects. Then there is no limit.
To do this without an extension, do as bigredron suggests and use very small dummy active objects. This would also make it unlimited Alterable Values.
Marv
It's not possible to do this with a dummy object because each object requires unique ID's and instances of collision and whatnot. When linked to a dummy object to store extra values, the object's ID jumps around when one of them is destroyed, rendering the dummy object useless.I really do use all 26 values and they're not enough. Yes, it is very complex and it yields very nice results but it's limited due to the fact that all of the necessary values aren't there.
Take maVado's suggestion and use the ValueAdd Extension.
stephen1980
Or you can use the Level-Save Object. :)
ValueAdd is not practical for the what I'm using it for and Level-Save has nothing to do with what I am doing. What I am using the alterable values for is entire movement and attack based engines based on a qualifier. For instance, an Enemy's HP would be Alt value 3. Defense, strength and all those good things are in there. Pos X, Pos Y, X Speed, Y Speed [I wouldn't have to use those if the built in movement didn't suck so much.] Distance from enemy, and other things that allow me to make complex movement and AI. It handles it OK based on setting things by qualifier. Inter-qualifier collisions don't work so well though. I don't see what the big deal is. If you can make infinite Global values, why not allow each object to have it's own infinite values as well? It would work much better than slamming 2-3 different dummy objects to load up values.
ValueAdd should do exactly what you want. The Level-Save object can also add unlimiter properties to an active object. Try experimenting more. Whinging about only having 26 values is not going to make the limit increase. Its how MMF2 is designed and will not be changed (maybe in MMF3)
IXIStreakIXI, why don't you use the unlimited number of Global Values for your project. In the Community RPG Project we are using global Values for everything you mentioned. Seems to me that it would be better than struggling with AV as you are. Just a suggestion.
Marv
In case you didn't know, Global values are not limited, unlike Alterables. 26 Alterable Values and 12 Alterable Strings. Most people don't know that Globals aren't limited...
I think IXIStreakIXI knows about the unlimited Globals, as he mentioned it. He may not want to recode his application to use them, although that would not be a disaster to do.
Marv
You see, you're not getting my point. Global Values are not feasible either because there will be multiple instances of things under a certain qualifier. For example, Enemy 1 will have 20 DEF. Enemy 2 will have 100 DEF. You can't set this with a global value because well, the value is GLOBAL. It's nice that there's an extension to add values but to use it would be cluttered. I don't want to set all the values at Runtime or in the event editor. This is a feature that should already be part of MMF2.
As far as the hostility goes ["Whining about global values won't make them increase, blah blah" ] It's not my fault that you're not capable of anything advanced that would require such flexibility. I wasn't whining. I brought up the issue and I think that it should be a feature. I haven't seen an official come in here and tell me to "SHUT UP CUZ THAT'S HOW WE MADE IT" so you should just calm your jets.
An Official appears ...
Please, let's all stay on topic and refrain from taking or giving opinions and having arguments on a personal level. Otherwise, we have to close or delete the thread.
Thanks for your understanding!
An Official disappears ...
I'm having the same troubles than the original poster. Because I'm coding custom movements, this already eats about 15 alterable values.
I've asked CT about more alterable values, and they said that they won't be doing it until MMF3, especially for compatibility reasons.
But Yves gave me a nice tip to store two values into a single alterable value. Both values to store must be an integer inferior to 65536.
It's a bit complicated, but it works well. You can also store 4 values, but the code is more complex. I think that this technique is called bitmasking. I'm sure that a programer could explain it in details.Code://Set val1 and val2 simultaneously:
altval = newval1 + newval2 * 65536
//Set val1 only:
altval = (altval AND 4294901760) OR (newval1 AND 65535)
//Set val2 only: (with simplified variant)
altval = ((newval2 AND 65535) * 65536) OR (altval AND 65535)
altval = (newval2 * 65536) OR (altval AND 65535)
//Get val1
val1 = (altval & 65535)
//Get val2
val2 = altval / 65536
@IXIStreakIXI
Can you please explain what problems you have with ValueAdd, it already offers unlimited values and it works with multiple objects without problems.
@Olivier & all
There are more ways to combine values, simply adding them will also work if you do not touch their range:
lets say we have level and xp in our RPG
Levelrange is from 1-99, XP from 100-100000000
As long as you do not add something less then 100 XP it will work by just combining the values
25014 = 25000XP Level 14
567037 = 567000XP Level 37
In addition add math to combine miltiple values:
Base 100.000.000 (100 million)
combine Attack, Defense, Hit% all those have a range from 1-999
first value * 100000
second value * 1000
third value just add
to retrieve you just left,mid,right into 3 chunks at len(3)
Attack: 67
Defense: 122
Hit%. 87
67.122.087
on retrieve start with right$ to get 087 --> 87 Hit%
then get 122 --> 122 Defense
then get the rest --> 87 Hit%
Be creative.
And you may also use external Datastorage to store unlimited values, for example an array, just map your object with an ID and have it read and write to the array.
I've tested the extension and it actually works pretty well. But it makes the code super heavy to read (see pic#1 below), and I can't monitor the values created via the debugger. I also have a problem at edit time when it comes to drag & replace objects (see pic#2 below). Besides that it is okay.Quote:
Originally Posted by maVado
http://membres.lycos.fr/peggyolivier/valueadd2.gif
http://membres.lycos.fr/peggyolivier/valueadd1.gif
I agree it's not very user friendly when it comes to editing and readability but once you know how it works its no problem. People who look at the code while having never used this extension will probably get lost somewhere inbetween.
For the the OP made it sound that ValueAdd is not useable which is clearly out of question as the extension works.
Again, if you have tons of values either try to combine them somehow into single values or use array, ini or similar to store all the values with a reference to the object.
Also objects have strings, I'm not sure how long those can be, probably 256 chars which is a lot of space for holding values and parse them to extract them.
I do in fact would love to have unlimited alt values or at least 256+ in the next major revision (MMF3+).
I appreciate the report, but unfortunately the images aren't loading for me. I've got a pretty good idea what you're trying to show though.Quote:
Originally Posted by Olivier
IXIStreakIXI: I run into that limitation all the time, even with all the constant values moved to another object, I often find myself in need of more "per-instance" values than the limitation allows, but as I know it's a limit I can not change, workarounds are the only option.
The workarounds I use are plenty, it can be storing several values in a string, and using Jamie's "String Tokenizer" to parse that string. It can be using the Ini++ with groups named after the fixed values of the objects. Of course, all workarounds have their problems and resource usage, but it's really the only way.
Dynasoft, it's the exact same report than I've sent to you by PM some months ago. Here are direct links for the pics:
http://membres.lycos.fr/peggyolivier/valueadd1.gif
http://membres.lycos.fr/peggyolivier/valueadd2.gif
I've tried what Nifflas did before and it work great. Store the values you need as one string. Then, parse them on runtime. Don't use this for all values, just for the ones that don't get changed very often.
OR
If you have multiple states, store them in an alterable string. Every time it changes states, write all the values to a different string. Then use the values that are in this state irrelevant for now relevant values. Hope this helps. :)
Mate I am making an RTS in MMF2 so dont tell me that I am not making anything very complex. I know that each instance of an object needs to store its own values so I can see what you are asking about, but the fact is that there is no way you can increase it apart from what has already been suggested.Quote:
Originally Posted by IXIStreakIXI
But since your making something so advanced and complex, why dont you incorporate LUA into your project? Simply define a table and store all data you need in that and then all you need to do is retreive the value from LUA when you need it. Or you can use an array within MMF2. There are a number of ways you can do this, you just need to think of other methods.
I tried looking at the images directly before and they wouldn't load, but they're fine now. Unfortunately work keeps me too busy to implement improvements to my extensions. So your idea of "Setting an object and then using a fixed of 0 uses that object" (while good) won't be being done for a while. Neither will debugger support.Quote:
Originally Posted by Olivier
The drag-drop thing must be an MMF bug, there is no way I could cause that, as far as I can see.
I have had a bug report from IXIStreakIXI about a bug with the "compare to ext. alt. value" condition when used with a qualifier. I've fixed it now and will be uploading a new version of ValueAdd later today.
Anyway, thanks for having looked into these issues Dynasoft. Your extension is quite useful as it is.
Ok, fixed version of ValueAdd is here: http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=151352#Post1513 52
Thank you Dynasoft.
Marv