As previously outlined in the Roadmap for M.U.G.E.N, new CNS development will be discontinued in the eventual 2.x engine. But before then, we'll look at adding some features that help improve CNS usability for developers without being too much of a problem in terms of backward- or forward-compatibility. In the "CNS's Last Hurrah" blog post series (which may be sporadically updated), we'll take a look at CNS features that are in the planning or development stages for 1.1.
Today we'll be looking at recursive redirection. Triggers can currently be redirected once, as in
helper(<helperID-expression>), stateno
This would evaluate <helperID-expression>, find PLAYER's helper with that ID, and then get its stateno. Another example would be
enemynear(var(1)), stateno
which would get the stateno of PLAYER's var(1)'th nearest enemy. But there is currently no way in CNS to get PLAYER's helper's nearest enemy's stateno (or any other such trigger evaluation).
Recursive redirection solves the problem by allowing us to write expressions of the following form:
helper(<helperID-expression>), enemynear(var(1)), stateno
Recursive redirections can be nested to arbitrary depth (actually, a very large fixed number). The order of evaluation is left-to-right. Thus each redirection is relative to the player that was computed by the keyword binding to it on its immediate left.
Now, consider var(1) in the preceding expression. Whose var(1) is it -- PLAYER's or PLAYER's helper's? The answer is that since var(1) is not directly bound by a redirection keyword, it is evaluated in the original context, i.e., it is PLAYER's variable. To get the helper's var(1), you would have to redirect that access as well.
- R.




Hmm...
I've just noticed the Blog's session is not the same as the forum's one. I.E. if you login here, you're not logged in the forums and vice versa. I don't know if it could be solved.
Anyways, about all the stuff you're doing, very well done. On a side note I just hope none of the 1.0 nor 1.1 features would be SFFv2 only. No, we need SFFv1, I just wanted to point that out.
Another cool feature !
This will be great. I guess some of us won't be able to wait for the 1.1 version, when the final 1.0 isn't even here...
"The answer is that since var(1) is not directly bound by a redirection keyword, it is evaluated in the original context, i.e., it is PLAYER's variable. To get the helper's var(1), you would have to redirect that access as well."
Does that means we can imbricate several recursive redirections into the same expression ? Such as :
helper(), enemynear(partner, helper(1000), var(1)), statenoIf so, this will be very flexible...
True!
I think that's the way it will work.
"If so, this will be very flexible..."
I think possibilities will be infinite...
I just hope they add this soon. I don't want to wait for 1.1 for that.
How about character transformations?
Here are some ideas from the community.
Trigger: sprite no and group no triggers.
http://elecbyte.com/forum/index.php?topic=150.msg5212#msg5212
Interchangeable get hit sprites
http://elecbyte.com/forum/index.php?topic=85.0
Yay! Multiple redirection!
An interesting development. Though I find it both strange and exciting that you guys are already talking about 1.1...!
Hooray!
This is one of the things we were waiting for! We were expecting this so much!
Thank you Elecbyte!
Wonderful!!!