Odd thing happening in a fight

Doh! Place yer bets!

1 Like

As my brother isnā€™t that familiar with NWN or D&D, I doubt he even knows how to do that, honestly. :slightly_smiling_face:

I copied your script, compiled it and ran it ingame. I had forgotten how to do debug_mode but found 4760ā€™s notes telling how to do it on a keyboard like mine (it doesnā€™t work like on american computers).
Anyway, went into debug mode, ran the script before entering the area and it said that everyone
" is not immortal." When I entered the swamp area where the fights area, and where Loreen canā€™t be damaged, it still said, when running the script, that everyone was not immortal.

Maybe I should try while in the fight perhaps? Iā€™ll see if that can be done.

This is how it looks ingame. Loreen doesnā€™t take damage, and at the same time Iā€™m running the debug script proving she is not immortal. Soā€¦whatā€™s going on?

Maybe I could try something like this?

void main()
{
	string sPlot = " is NOT set to plot."; 	
	object oPC = GetFirstPC(FALSE);
	object oFM = GetFirstFactionMember(oPC, FALSE);

	while (GetIsObjectValid(oFM))
	{	
		if (GetPlotFlag(oFM)) sPlot = " IS set to plot.";
		
		SendMessageToPC(oPC, GetName(oFM) + sPlot); 
		oFM =  GetNextFactionMember(oFM, FALSE);
	}
}

Yes, try this. As ā€œPlotā€ is the key one I would suspect. (Plot stops all damage.)

The other (immortal) is more to do with taking damage but not dying.

Ok. NOW it got really interesting, and quite bizarre. In the area before going to the swamp, all the companions were actually set to plot! But then when entering the area, it said they werenā€™t set to plot anymore. In other words travusā€™ script did what I wanted to. Then I started the fights again, and low and behold, Loreen takes damage again! But she didnā€™t do that before!! This is so weird.

But at least weā€™re getting somewhere now. Maybeā€¦could it be that the OnClientEnter script, doesnā€™t always have the chance to fire? As I said I am using travusā€™ script right now. Maybe if I did a 0.2 sec delay on that?

Iā€™ll try this savegame again, and if Loreen doesnā€™t take damage, like before Iā€™ll run this plot_check script.

Edit: LOL! Without doing anything (not doing the dely, just leaving travusā€™ script as is), now I canā€™t recreate the ā€œis NOT set to plotā€. Alright, maybe I should just leave it like this, and maybe apply it in the areas on the OnClientEnter where thereā€™s fighting going on.

1 Like

As I say, it is the plot flag as I suspected from the start. And the script that @travus supplied (and I would have also done) should be the way to go.

As I said above, you need to consider applying this script/function for every area to be sure. I think the game engine may ā€œplotā€ PCs upon entering to avoid them being killed prematurely. However, it may be getting ā€œstuckā€ - especially when walking straight into a battle.

Did a bit of testing again, and with my brotherā€™s savegame itā€™s absolutely clear that all the companions are set to plot when in the area before the swamp. So maybe thereā€™s something that happens there. Thereā€™s quite a bit of fights going on in the area before too.

Yes, I get what you mean. With the duel battles, that you helped me with, I noticed clearly that when a new enemy is spawned in, for the first second Taik doesnā€™t take damage, but then he does, so there itā€™s not a problem. It may be the gameā€™s way of preventing bad things from happening.

I think that was also my conclusion - and a reason why I had to delay ā€œplotā€ fixing until the game had determined everyone was ready to go. i.e. The plot flag appears to stay ā€œsetā€ upon entering an area to prevent untimely death - but I have witnessed it get stuck, especially if a battle is going on. i.e. It is probably better / safer design to make sure there is no battle going on (or is targeted as an enemy) as a player enters an area by at least two heartbeats.

For the record, that was how I ā€œfixedā€ the issue with my own plot issues. I had to leave at least 2 heartbeats (iirc) before I could work with it - Sadly, I cannot recall more details, but I am recalling bits of info as we continue this discussion.

Re Your post below, let me know how you get on - Will be back in a few hours.

I donā€™t think thereā€™s any area I have where a fight starts right awayā€¦oh, wait, there is one, actually, and in that area I have a ClientEnter scriptā€¦I think. Iā€™ll look into it.

But then I shouldnā€™t do a delay on travusā€™ script?

I have now updated all OnEnter scripts. Not all areas had these, but those that didnā€™t have it, doesnā€™t have fights, so I think it should be no problem now. At least thereā€™s a check for immortality quite often, so if the bug reappears thereā€™s a great chance it goes away again. Iā€™ve sent the updated Campaigns folder to my brother. Gotta say, Lance, itā€™s quite nice to be able to do it like this. He wonā€™t need to restart from the beginning now. :sunglasses:
I did no delays on the scriptsā€¦If there still are problems, I might go back and add some small delays to them. Donā€™t know how long those delays are supposed to be exactly, for it to be effective in the game.

1 Like

@andgalf

Itā€™s good to hear you are getting to grips with and benefiting from the campaign structure way of doing things.

There is one thing I would like to mention, which I donā€™t think affects you, but is worth informing you about as well ā€¦

If you use and update a homebrew include library (which I donā€™t think you have anyway), then bear in mind you would need to recompile all scripts that used your updated/fixed include script and then include all affected scripts within the campaign update. However, I donā€™t think this affects you, as I believe you keep your functions within your scripts locally.

If that did not make sense, donā€™t worry, as it likely has no bearing to you anyway.

I know we have spoken about this before, so Iā€™m quite aware of this, actually. Thanks for reminding me, though.

Yes, I mostly have my include functions locally, but there are instances where itā€™s not like this. But as I said, I am well aware of this.

My brother have played some more since I gave him the update, he had backed to a previous save to change a few things (buy other armor and whatnot) , but he told me that now when getting to the area before the swamp (donā€™t believe he has reentered the swamp yet) everybody takes damage, so for the moment this seems to have worked. Hopefully he wonā€™t encounter any more nasty bugsā€¦but it really is easier to fix things, and above all test things, now that I have my adventure as a campaign.

2 Likes