argent77 Posted January 26, 2013 Share Posted January 26, 2013 Hi, I'm currently working on a BG2 mod which introduces a creature which accompanies the party throughout the game. It behaves like a familiar, but I'm using the EA status CONTROLLED to control its actions. The side effect of my decision is, however, the creature isn't affected by the party's rest. For example, I am unable to restore its spell selection or innate abilities. So I have added a simple script block, using the PartyRested() trigger. The code block looks like that: IF Global("A7AfaaqSummoned", "GLOBAL", 1) Global("A7AfaaqGaseous", "GLOBAL", 0) InActiveArea("A7Afaaq") PartyRested() THEN RESPONSE #100 ActionOverride("A7Afaaq", Rest()) Continue() END The problem is that PartyRested() is very picky about where to trigger. It doesn't work in the creature's own scripts. At the moment I'm handling the block in the baldur.bcs, but I'd like to move it to a somewhat safer place. I've tried to put it into the dplayer3.bcs, which is the default script for Player1 (or any imported characters), but that script isn't executed at all, if Party AI isn't activated. Do you know of other places where the above code block may work or how to make the trigger work in the creature's own scripts? Link to comment
jastey Posted January 26, 2013 Share Posted January 26, 2013 Hm. PartyRested() is not relieble in the creature's script, but in principle, it is executed, if that sciprt block is executed first after the party's rest - so, not reliable. I would think that the baldur.bcs is your best choice, actually. What do you mean with "safer"? Maybe put it TOP (with a Continue())? Link to comment
argent77 Posted January 26, 2013 Author Share Posted January 26, 2013 Hm, I didn't know it had to be processed first. Maybe there is still hope it can be executed elsewhere. What do you mean with "safer"? Maybe put it TOP (with a Continue())? The baldur.bcs can be modified by every mod out there, so it could be - even if I put it on top - that the block isn't executed. I'd rather put it into one of my own scripts. Link to comment
jastey Posted January 26, 2013 Share Posted January 26, 2013 With first I meant that the trigger PartyRested() only gives true if the exact script block is executed after rest. If it is executed later, the trigger gives false. I don't know how the scripts are executed, so maybe if put in the very first place at the top of your NPC's script it works - not sure. Link to comment
argent77 Posted January 26, 2013 Author Share Posted January 26, 2013 Unfortunately there is more to it. After some more testing I've found out that the trigger PartyRested() will be ignored in a creature script as long as the creature is in the CONTROLLED state. After switching to FAMILIAR temporarily, it happily executed the code block. Link to comment
jastey Posted January 26, 2013 Share Posted January 26, 2013 Let me guess - there can obly be one creature flagged FAMILIAR at once in the game..? I am no help there, I am afraid. Seems the baldur.bcs is the best choice so far. Link to comment
argent77 Posted January 27, 2013 Author Share Posted January 27, 2013 Yes, I agree, the baldur.bcs is the best choice. You can have more than one familiar, however the implementation of it is a bit buggy. There are hard-coded strings which I can't suppress and a few more issues I still don't understand. For now I prefer the CONTROLLED type of creature. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.