lsass.exe Posted July 5, 2009 Posted July 5, 2009 Hi there I wrote a little pickpocket competition between my NPC and Zhurlong (the Halfling thief in the Burnning Wizard Inn in Beregost) and I’d like to end it with a thievery skill improvement for my NPC. I searched through the actions at IESDB but found nothing. Is it even possible? Or do I just look at the wrong place?
Avenger Posted July 5, 2009 Posted July 5, 2009 Apply a spell (ApplySpellRes action) with an increase to the pickpockets stat (Opcode 92). Use timing mode 9. I'm not sure if you got ApplySpellRes in bg1, it might be not obvious or outright unavailable. So, you might want to fall back to simple ApplySpell.
Icendoan Posted July 5, 2009 Posted July 5, 2009 If you use ApplySpell() remember to append your spell to Spells.IDS. Icen
plainab Posted July 5, 2009 Posted July 5, 2009 If you have totsc I believe you can add it to action.ids and can get it to work. If you have vanilla bg then it won't work at all. See here for a list of actions (and some tp2 code to add them via weidu) that can be added to and then used in totsc. List of addable actions @ BWL
lsass.exe Posted July 5, 2009 Author Posted July 5, 2009 Thanks for all your help! I totally forgot to mention, that I make a BGT-Mod. From the start to the end in one go. So I can use all the ToB scripting stuff. But first I will have to figure out, how to use that ApplySpellRes() thingy with optcodes and stuff. PS: I guess, I can raise DEX and stuff like that the the same way?
plainab Posted July 6, 2009 Posted July 6, 2009 Using the ApplySpellRes is fairly easy... In your dialog file at the relevant transition you'd have; DO ~ApplySpellRES("Spell_File_Name",Target)~ where Spell_File_Name is the 6-7 character file name without the extension and Target is who the spell will affect. So if your spell was ab_100.spl and your target was the last person who talked to the NPC then you would have DO ~ApplySpellRes("ab_100",LastTalkedToBy())~ . Of course none of that will work unless the spell you wish to use has been created. I would recommend using DLTCEP or NI for that. There are others better versed in spell creation than I, so it'll be best if I remain quiet in regards to making spells...
lsass.exe Posted July 6, 2009 Author Posted July 6, 2009 Thanks for your answer! After a little bit of thinking I figuered that out, but I was lost thereafter, because I thought I have to use this optcode (not to forget the timing mode 9) with ApplySpellRES(). (I'm not the sharpest knife in the drawer ) But I think I understand you. I have to create a spell which uses that optcode for raising the thievery abilites and then use that spell with ApplySpellRES() on my NPC, right?
Avenger Posted July 6, 2009 Posted July 6, 2009 yes, that's right IESDP documents the opcode fairly well
lsass.exe Posted July 6, 2009 Author Posted July 6, 2009 Thank you! Ok, creating spells... i didn't think I'd have to do that for my mod but how difficult can it be anyway... I guess I'm going to hit the tutorials this weekend and see what I can accomplish.
lsass.exe Posted July 7, 2009 Author Posted July 7, 2009 Well, I didn't find any tutorials in my quick search so I just startet to tinker with DLTCEP and it was surprisingly easy, even for my standards. And while I was at it, I made a new innate ability for the npc which works also without problems. But I'd like to display a string above the npcs head, when the ability is used. So I assigned the Optcode (139) which works wonderfully! (and made me really proud of myself ) With but one single flaw: The string isn't displayed in the game window but in the textbox. I searched the Optcodes but found nothing. How do I do this? Is it even possible? And one more question: I added my optcode string to the extended effects and DLTCEP wrote it automatically in my tlk. Which is not a very clever solution. How can use a string that is read from my tp2 during installation?
Avenger Posted July 7, 2009 Posted July 7, 2009 Sadly there is no other display string opcode. And i'm happy you say you could use DLTCEP easily. I bet you are ahead of some old modders You can export the spell into tp2 format. (or tbg format).
erik Posted July 7, 2009 Posted July 7, 2009 With but one single flaw: The string isn't displayed in the game window but in the textbox. I searched the Optcodes but found nothing. How do I do this? Is it even possible? Detect your spell being cast and do DisplayStringHead from the npc script, I guess. Or simply do them in sequence
Avenger Posted July 7, 2009 Posted July 7, 2009 With but one single flaw: The string isn't displayed in the game window but in the textbox. I searched the Optcodes but found nothing. How do I do this? Is it even possible? Detect your spell being cast and do DisplayStringHead from the npc script, I guess. Or simply do them in sequence Ahh, i forgot you have an npc with its own special script. You can either try the spellcast() stuff, or set a local variable by the spell. (187 store local variable effect) - i would use the spell's name as the variable name Then in the script would be something like this: if global("spinxxx","local",1) then response #100 setglobal("spinxxx","local",0) displaystringhead(myself,~) end
lsass.exe Posted July 7, 2009 Author Posted July 7, 2009 Thanks for the DLTCEP tip. I'd never found that on my own. I bet you are ahead of some old modders No no no, don't flatter me. My head may be big and round but it's also very empty. I used some basic logic thinking (or what I consider to be logic) and trial and error but that doesn't mean I actually know what I am doing... ^^ Anyway, back to the string. Could I solve this via the NPCs script? Since he is the only one having that innate, I could check if it was used and then display the string in the game window over his head. Is that going to work? Or would the string be printed even ten rounds after the innate was used? The text is not essentiell for the whole thing, it would just add massive amounts of RP-flavour. But therefore it has to be printed in the game window, since nobody reads the textbox and there allready is the message that the innate was casted... EDIT: I shouldn't answer the phone before sending my reply... So, my script thinking wasn't total bullcrap. What a relief. Thanks a lot, guys. I'll try that until my fingers are bleeding or the stuff works!
Avenger Posted July 7, 2009 Posted July 7, 2009 If the local variable doesn't work, you can try the global variable effect too (265). Balthazar (of ToB) uses this in some of its innates (like lunar stance: balth02).
Recommended Posts
Archived
This topic is now archived and is closed to further replies.