Jump to content

Continue() : How is it processed in a BG1 AI script ?


Gom Jabbar

Recommended Posts

Sorry for such a basic question, but can you explain how Continue() is processed in a BG1 AI script ?

If the following script is applied to one of PCs in BG1 (standard install Version 1.1.4315 without any mod)

 

// Block1
IF
See([ANYONE])
THEN
RESPONSE #100
	DisplayString(Myself,1001)
	Continue()
END
// Block2
IF
True()
THEN
RESPONSE #100
	DisplayString(Myself,1002)
END
//Block3
IF
True()
THEN
RESPONSE #100
	DisplayString(Myself,1003)
END

I get String 1001 then String 1002 and finally String 1003 and that sequence loops as long as the script is active.

I thought the Block3 'd never been executed because the Block2 is always true. I expected Block2 to be parsed after executing Block1(because of continue()) and then the script restarts. But it seems that the Continue() action makes the script execute every next block with a valid trigger until the last one before restarting.

 

Can you confirm that Continue() works in that way for BG1 ? Do I get the same behavior if that AI script runs in BG2 or BG1:TotSC ?

Link to comment
I'm shocked. :p

All the more strange since the game uses Continue() in its own scripts for NPC !

 

I noticed this as I was trying and making a thief a little smarter for fun. I’m not very experienced in scripting but making an advanced AI for BG1 sounds like a challenge because of many restrictions (unmanageable ModaleStales, a lot of missing functions, matters to handle inventory, etc ).

If the Continue() bug is confirmed, it’s a severe limitation on the scripts for BG1 :p

Link to comment

BG1 works as reported. (displays all 3 if the first block has continue, displays only the first, if the continue was removed).

BG2 works as expected. (displays only 1001/1002 with continue in first block)

 

Doh, this means, i have to add some external compatibility flag to simulate this difference.

Link to comment
Guest Guest_Marupal_*
Doh, this means, i have to add some external compatibility flag to simulate this difference.

Ouch! That seems like an awful lot of work just to duplicate a bug. It seems more than likely that this was something that slipped by the BG1 team because none of the scripts in BG1 fell prey to any ill effects from this flaw. I haven't seen any mention of problems from this with the BGT group. I'd be willing to go through the scripts in the original game files to see if it even makes a difference. I'd be willing to bet a few others would as well to save you the effort of simulating errors.

Link to comment

Yeah, it would be good to know if any of the official BG1 scripts depend on this bug. Probably not, and i hope no one 'uses' it. On 'use' i mean even involuntary dependence. I know the Dragonlance TC was dependent on some quirks due to sloppy coding which was made obvious by gemrb :)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...