![]() |
I'm toolset stupid, how do i make a container get a char's class for treasure type to drop. I've seen it done, but can't figure out how, is there a script on the onopen, or ondeath that will give it, or do i need to write one? If so, can someone tell me how?
|
It's a bit of a long script, but I wanted to include all the options and have you be able to give each and every one of them a different item. Just insert it somewhere in both the OnOpen script and the OnDeath scrip where it deals with handing out items.
Quote:
You can add classes together by using the || or 'or' symbol, or create multiclass combinations using && or 'and'. For example, for a fighter/wizard and fighter/rogue only item you'd say Quote:
What the "(GetLevelByClass(CLASS_TYPE_WIZARD, GetLastOpenedBy()) > 0)" line actually says is "does the character who last opened whatever calls this script have more than 0 levels in the wizard class?". |
Thanks Legolas, that is a long script, and no, I didn't know. I'm finally getting around to trying to make a serious mod, instead of just an item stocker mod. Hence the toolset stupid thing. I feel good about myself if the doors and transitions work! :D Thanks again.
|
Area transitions can be difficult to understand, you've every right to feel good if you figured that out by yourself [img]graemlins/thumbsup.gif[/img]
And you're welcome. If you need more help just post so [img]smile.gif[/img] |
Ok, so will it award according to highest class, if a char is multi-class?
|
This script won't, it only checks for at least a single level. Looking at it again, I think it also stops as soon as it has found a matching class. For example, a 19/1 fighter/aberration would only get the abberation items.
It shouldn't be much trouble to rewrite the script to go with the highest class, but if there are two tied for highest a choice still has to be made; do you give the items of one class, the other class, one of the classes at random, both the classes, nothing or a standard classless item? I'm going to rewrite it to get the highest class level from the standard PC classes, and for now I'll make the item handed out in case of a tie one picked at random from between the two or three tied classes. |
that would be a good idea, even if it just picked randomly between the two, so long as a monk's not getting druid items, etc. I've played a lot of cool stuff, and want to translate that over into this mod. Self closing doors, for example, and the reason behind this post. Just haven't gotten that good at it, yet...I've got a few areas drawn up, and a running story line, just got to work out the details.
|
Okay, it's not working yet because not not all control paths seem to return a value (in other words, the editor can think of values to enter which the script does not cover when it should) but I'm posting it anyway [img]smile.gif[/img]
This bit goes before the void main() section of a script and basically adds a new command to the set in the editor. It's a bit cluttered up by " else {return CLASS_TYPE_INVALID;}" lines because that was my first attempt at covering all the bases. They are not needed for the script itself to work, and the editor won't consider them to be covering everything. Quote:
Quote:
[ 07-11-2003, 03:39 PM: Message edited by: Legolas ] |
Meh, okay. I know the problem lies either in comparing the levels (might be), or in resolving the random outcomes (quite likely), or both (probably). It works for single class characters, when I remove the random bit it also works for characters with two classes, but for a character with three classes that doesn't seem to be enough.
I'm sure the fix is as easy as it is logical, I just have to spot it first [img]tongue.gif[/img] :D |
thanks for all the hard work, really appreciate it, in the long run, it will be worth it. on the side, don't you have a module running, infinite realms, or something similar, if so, i've been a frequent visitor of late
|
Nope, I've no modules running on the 'net. I'm sure it would be fun, but if it's going to be a module it's going to be one of my own...
And at this rate, that's not going to happen. My only project is a single-player module based on the Hazardous Times threads from the RP section, and if you download that one you'll see I still have tons of work to do before that one is completed. Although I do suppose that in multiplayer modules I could get away with far less detail, fewer scripts and the like, and I could keep parts of it 'under construction' a while too... But I digress... I seriously doubt that was me. Probably one of those youngsters who decided to grab my name (COC in the making) or similar [img]smile.gif[/img] I'm usually found going by the name of Golas, or Say NO to the Trouser Tyranny if it's one of the older characters I'm playing. |
Okay then, I think I've got it now. Instead of adding elses in ifs everywhere, I've added a single one right at the very end.
Quote:
It has to be linked to every script you write that uses the GetHighestClassRandom command. You can do so by either repeating the above script in each of those other scripts, above the void main(), or by making this into it's own script (by saving it into an empty new script file, without the void main()) and then linking to it by typing #include "script name" above the void main() of the other scripts. Then, you can use a script very similar to the one I used first to cover all the options. Your OnOpen and OnDeath scripts for class related containers will look like one of the below: Quote:
Quote:
As you can see, using #include is a lot more compact and well worth the effort if you are going to use this function in more than one or two scripts. Now, if it does not work, just check the nwclient log file for further instructions. Phew [img]smile.gif[/img] [ 07-12-2003, 02:09 PM: Message edited by: Legolas ] |
once again, thanks for all your hard work, hopefully others will also use this to help with their modules. I appreciate the effort it took to work this out, i'll be sure to send you a copy of the mod, when it's done
|
You're most welcome, and I'll be looking forward to it [img]smile.gif[/img]
I just hope it works as planned, I haven't tested it yet using the different classes available. |
All times are GMT -4. The time now is 10:23 PM. |
Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
©2024 Ironworks Gaming & ©2024 The Great Escape Studios TM - All Rights Reserved