The script is meant to make the henchman (“giraudchild”) start a conversation at that particular spot. I don’t want to use the default henchman interjection scripts because this conversation has an additional condition (“card_dead” - the henchman reacts to the death of another person). So I figured it would be simplest to make a separate trigger and script and conversation and whatnot.
The script goes as follows:
void main()
{
object oPC = GetEnteringObject();
object oWorld = GetModule();
object oGir = GetObjectByTag("giraudchild");
if (!GetIsPC(oPC)) return;
if (GetIsInCombat(oPC)) return;
int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
if (DoOnce==TRUE) return;
if (GetLocalInt(oWorld, "card_dead")== 1)
{
AssignCommand(oGir, ActionStartConversation(oPC, "gir_lyd"));
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
}
}
This is pretty much a copy of another script I use to trigger a conversation elsewhere, and the other one works fine. This one doesn’t and I really don’t understand why. The condition is met, the gir_lyd conversation file exists, the henchman tag doesn’t have a typo in it, the script compiles fine. What am I missing (and how stupid a thing is it)???
How far are oPC and oGyr? I know that some conversations stop abruptly when the line to speak is assigned to a character who is too far away from the main speaker.
The other thing worth checking is if “speaker tag” in the gir_lyd conversation file is set (in case it is set, it has to be to giraudchild I guess).
Just trying to help here, the local int “card_dead” is run where and how? Just wonder if you perhaps have forgotten somehow to set that local int somewhere? If you haven’t then it should indeed work. I can see no wrong with your script.
The speaker tag is not set (runs from [OWNER]). It is true that henchmen getting stuck behind and thus not there for their part of conversation is a major problem, but for testing new scripts I always make sure they’re close by. There’s also no additional conditions on the conversation’s first line, either (I’ve just checked).
As for the card_dead int, normally it’s run from a separate quest which is a bit involved, where the “card” person may or may not die. So for the purposes of testing this bit, I use the SetVarModInt command in Debug Mode, and it works fine. I know it works fine, because in the very same area as this damn trigger, right before the trigger, there is a separate encounter with a person who appears to talk to the PC if Card is dead. That creature also spawns by checking the “card_dead” module int, and it spawns in just fine.
For a moment I thought that the additional creature, the one that spawns to talk to you, is the problem here, because after that conversation, the creature walks through the trigger to exit the area. But that can’t be it, because a) that’s what the GetIsPC bit is for and b) the conversation fails to launch if you kill the creature instead (and thus it doesn’t walk through the trigger), either.
I’m at the end of my damn tether here, and this bit is kinda important, because it’s really out of character for that henchman not to react to people coming at you panting for revenge.
Again just brainstorming, but in my second module (although for NWN2) I had problems with a script firing when using GetObjectByTag. It very rarely happens but still…Maybe you could try with GetNearestObjectByTag instead to see if that does anything? Also maybe you could do some debug testing to see where the problem lies? Maybe with SendMessageToPC to see if each thing in the script is checked and so on?
In a fit of utter desperation I threw the trigger out, painted a new one, recompiled the script and re-baked the module.
It worked. O_o
I’m gonna leave it for now and implement some other stuff, after which I’ll do a longer test run, playing the game normally. We’ll see what it says then.
This stuff will be the death of me.
Thank you very much for your help, it may yet be very necessary. We’ll see.
I know exactly how you feel. I’ve just played through my new module for the first time from start to finish (it will probably be months before I release it, since it has to undergo a lot of beta testing first), and gosh how many bugs there were. It gets pretty frustrating at times making modules. I feel like I have to test every single thing (in most cases) 15 times before everything works as it should. It’s weird.
I get this a lot with some triggers using the same script and settings and it’s very annoying. It happens when you’ve already been over the trigger without the conditions being met then when they are met it wont work. I always set the triggers to 0 on everything except multi use which is 1 but don’t even know if this makes a difference as the script’s in the on enter bit.
Mostly it does work and some triggers just wont work ever ! One thing I don’t use is a do once in the script I just ga_destroy the trigger on the last line of the conversation, that way it definitely will never happen again.
I usually do both. I have an irrational, borderline-OCD discomfort about triggers just laying about unnecessarily.
I often go for months without touching the toolset, but still, my released module took me seven years. And this one is actually older than the released one. “Months” sounds super fast. Best of luck!
FWIW I have found that triggers tend to only work when they appear as a 2D rectangle and not as a 3D box. Another thing that often (but not always) makes them not work is when you can only see part of the trigger above ground. Hope that’s useful.
ClearAllActions is always good to use in a script as long as you don’t want animations to follow. Then it can mess with things in my experience (at least in NWN2). I’ve had a feeling that animations are way more stable in NWN1 than NWN2, but maybe that’s just my imagination.
QuenGalad… I think the toolset creates modules and OCD ! The amount of times I go back to check something I’ve already checked but forgot about checking because I did something else is not amusing !
QuenGalad, andgalf… Months, seven years, that’s luxury ! I’m at the moment fixing bugs and redoing a module I made over ten years ago !
Tarot-Redhand… My triggers get a full flattening with the space bar every time I see them and they deserve it !
I think this whole summer I’ve worked on my module almost every day, that’s why I have made the progress I’ve made. But it can be really tiresome. It’s good, like you do, to take breaks from the toolset. For me this is my third module I’m working on, and maybe the last I’ll ever do. For me it’s taken about a year for each module, but with my first one there were quite a lot of bugs when I released it, and there are bugs still that I can’t fix. Still, the reason it’s gone that fast for me is because I only use prefab areas (I edit them a bit of course) and that has saved me a lot of time.
Well, Tsongo, for me I have just given up with trying to correct any more bugs for my first module. I just don’t have the will or strength to do so anymore. I may let the player down by this, but I feel I have to move on.
By the way,@Tsongo, I can’t remember there ever being any bugs in your modules. I always found them very solid, at least as far as I can remember.
andgalf… I’m pleased to hear you found my mods solid, it’s not so much bugs as things that don’t work properly or are confusing and some monsters that you really need to know how to hit them to win a fight which isn’t fair.
I even found an interior area that probably nobody’s ever been to because the door was static, plot and locked ! I must’ve locked it up with the area contents feature at the same time as all the other doors in the area so they didn’t light up.
It took me a year and a half to make my first mod, one year for the second and two for the third then I had a massive toolset break but returned this year to correct the first one which really needs it and deserves a polish. It’s taken a while to remember what I used to know how to do !
Back to the original topic one of my triggers never worked ! So got moved to another area where it’s much happier and you must’ve passed the conditions.