This packge includes 3 include files that can be used to make tag based scripting much less complicated.
rr_tagbased:
This script allows generic functions to be used to acquire objects. GetPC(), GetItem(), and GetTarget() are all "event independant". When you use GetPC(), you always get the current PC being addressed by the current event.
Also allowed is event encapsulation. An example is ExitNotOnHitCast(). You just use this function and the event you are using is set. (no more switch statements) Just use like this
if(ExitNotOnHitCast()) return;
rr_debug:
This script allows you to send debug data to the screen so you can see why your tagbased scripts aren't working (if you have problems)
rr_loops:
This script presents some commonly used loops that you might find convenient.
Oh man, now I see wht you mean Talmud, my design is flawed. The exitnotcast functions only return in their own scope, they would need to return a varible to be checked in the calling functions (ooooops!) _________________________ My Submissions
The ExitNot functions encapsulate tag-based scripting events. What that means is that if you want to only script for an onequip event, then running the ExitNotEquip function causes every other tag-based scripting event (unequip onhitcast activate etc) to exit without executing any further code. In this way, you can avoid a switch statement.
If you have ever done tag-based scripting, this should make sense to you. You know, the big switch statement that lists every event possible for tag-based scripting? _________________________ My Submissions
This is an interesting package. One thing that I noticed was that your ExitNot functions do not work as intended (currently they do nothing). If you wish to set up proper sentinel functions you will need to have be value returning and be combined with an if() statement containing a return in the body of the script to be exited.
Example:
void main()
{
if(NotOnHitCast()) return;
DoStuff();
}
}
if (
Posted by RapidDeployment at 2006-09-15 20:29:04 Voted 10.00 on 09/30/06
Wow.
I employ a huge amount of items in my mod and this gem here has inspired me to rewrite all of the code to incorperate this awesome system.
Neat and tidy. Just the way I like it. _________________________ I am 9fires.In Hell I burn in flames. So cold inside the fires heals the pain.
Posted by RapidDeployment at 2006-09-15 19:01:29 Voted 10.00 on 09/30/06
HA! First poster! I get the cookie!
If this is anything like everything else you've scripted, I'm sure its awesome.
I'm voting 10 blind _________________________ I am 9fires.In Hell I burn in flames. So cold inside the fires heals the pain.
You must be Logged In to post comments in this section.