Easygoing Eyebeast Thralni Posted December 27, 2005 Share Posted December 27, 2005 I want to take all energy, healing and all other potions from the player at a certain moment in game. Also taking wands may be a good idea, but i was wondering if there is a quick and efficient way of doing this, instead of using char_has_item about 23586012,56 times. Link to comment Share on other sites More sharing options...
Easygoing Eyebeast *i Posted December 27, 2005 Share Posted December 27, 2005 It is not difficult with a loop: Code: i = 0;j = 1;while (i < 499) { if (j==1) i = 17; if (j==2) i = 32; if (j==3) i = 74; if (j==4) i = 500; take_num_of_item(i,200); j = j + 1;} This will pretty much take all of (or at least 200 of) items 17, 32, and 74. Just add more conditionals for items you want to take. Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Thralni Posted December 27, 2005 Author Share Posted December 27, 2005 Sounds good to me. thanks. I take it that i is the itm number, but what exactly is j? EDIT: never mind. I already understand it. j is how many times the loop has been run, every time the loop has finished it adds 1 up to j, therey making it possible... Okay. I understand it. thanks! Link to comment Share on other sites More sharing options...
Easygoing Eyebeast *i Posted December 27, 2005 Share Posted December 27, 2005 Thought about it a little bit more and this method would be better for grouped items. That's what I get for being so hasty: Code: i = 220;while (i <= 238) { take_num_of_item(i,200); i = i + 1;} This takes all items between 220 and 238, i.e. all the potions. If you want to take items individually, it is best just to use the take_num_of_item() with the number you want directly. Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Thralni Posted December 27, 2005 Author Share Posted December 27, 2005 I want the party to keep potions that will only harm them (like searing balm). thanks anyway. God, these loops, I never used them, but they are so handy! Thanks for showing me them! Another question: I made a custom special ability, but I don't know what th game will do with it. The ability shouldn't be there immeditaly when the scenario starts, they should get it at some point, but I don't know if the gmae automatically ives it or not. then something else, how do i give it? for now i just did set_char_trait(0,0,1), but i don't know if that's correct. i looked in the docs and other scenario's, but didn't find what i needed. Link to comment Share on other sites More sharing options...
Easygoing Eyebeast *i Posted December 27, 2005 Share Posted December 27, 2005 If you want to take away most of the helpful potions, set the top limit to 241 on the while loop. I never personally mucked with special abilities, I intend to, just never got around with it. Most of TMs scenarios and Bahssikava have them I know. Take a look at their main scenario script file. Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted December 27, 2005 Share Posted December 27, 2005 Bahs gives special abilities in the START_SCEN_STATE in slithhome.txt, near the end of the state. The call you want is change_custom_abil_uses. You also have to make sure to init the special ability in the LOAD_SCEN_STATE. Link to comment Share on other sites More sharing options...
Fledgling Fyora coreyh2 Posted December 27, 2005 Share Posted December 27, 2005 is there a reason to use take_num_of_item instead of take_all_of_item? Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Thralni Posted December 28, 2005 Author Share Posted December 28, 2005 Yes, i was thinking about that too. Isn't it better to use take_all_item? I already looked in bahs's scenario script, but couldn't find it. Anyway, now kelandon told me where to look, I'll figure it out soon enough. I looked at change_custom_abil_uses, but i thought it was only for changing how many times the party can still use the thing. i suppose it will work lime this (tell me if I'm wrong): In the beginning, you set it to 0, so the party can't use it. later, you set it to a large number, say 200, so the party cn use it all the time. Am i right? Link to comment Share on other sites More sharing options...
Easygoing Eyebeast *i Posted December 28, 2005 Share Posted December 28, 2005 Yes, take_all_of_item will work fine as well. I believe that's how custom abilities work. Test it to find out. Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted December 28, 2005 Share Posted December 28, 2005 It defaults to 0. You don't have to set it to 0. When they're supposed to get the ability, set their uses to, say, 1. Then, in the state that gets called when they use the ability, set the uses of the character who used the ability back to 1. (That is, if the ability is ability number 1, for example, the first line of the ability state should be Code: change_custom_abil_uses(who_used_custom_abil(),1,1); All of Bahs's abilities work like this. Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Thralni Posted December 29, 2005 Author Share Posted December 29, 2005 Thanks kelandon. i got an email back from jeff about the graphics, saying to download the most recent version, and see what happens next. i did that, thereby deleting all my save files. that's not so bad, actually, thanks to kelandon's high party maker. otherwise I would have been mad, yes. Anyway, i installed it, but the game was immediatly registered. is this normal? EDIT: oh yes, when i tried to install the update to version 1.1.2, the updater said it couldn't install, because the graphics and some other files were corrupt. Could this have been the reason for my graphics not to work? Link to comment Share on other sites More sharing options...
Easygoing Eyebeast *i Posted December 29, 2005 Share Posted December 29, 2005 Possibly. What platform are you on? Did you uninstall all of the files for Blades of Avernum and the editor before reinstalling a new version? Try that if you have not. If not, try to figure out what is corrupted. Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Thralni Posted December 29, 2005 Author Share Posted December 29, 2005 *look dissapointed* Nothing has changed with the graphics. they still don't work. And no, i didn't uninstall the editor before installing the new version. And how can i discover what was corrupt? Link to comment Share on other sites More sharing options...
Easygoing Eyebeast *i Posted December 29, 2005 Share Posted December 29, 2005 Apparently you did not understand, you SHOULD uninstall ALL Blades of Avernum files and reinstall them with the new version. Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Thralni Posted December 29, 2005 Author Share Posted December 29, 2005 aha, okay. I'll try it again. this will probably mean I also have to get a new registration code. Link to comment Share on other sites More sharing options...
Easygoing Eyebeast *i Posted December 29, 2005 Share Posted December 29, 2005 Possibly, but Jeff is pretty good about getting new registration codes out. Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Thralni Posted December 30, 2005 Author Share Posted December 30, 2005 Yes, he is. I just sent him an email (yesterday, actually), and I already got an email back. That's the part I DO like about Jeff, he does give new registration codes when really needed. What I don't like however, is that he isn't really keen on helping people with their problems. Link to comment Share on other sites More sharing options...
Recommended Posts