Continue()'s !!!
#1
Posted 26 July 2006 - 07:37 AM
Pay special attention on adding Continue() to the end of all script blocks that are being added to the TOP of any existing area scripts.
Each EXTEND_TOP script blocks must end with Continue().
That will prevent a situation when newly added mod disable every previously added OnCreation()-based scripts.
(last update: 02-12-2008)
----------------------------------------------
SoS, v1.13
TDD, v1.12
TS-BP, v6.10
CtB, v1.11
RoT, v2.1
----------------------------------------------
BP Animations Scheme
#2
Posted 29 August 2006 - 06:19 PM
Edited by dragonian, 29 August 2006 - 06:19 PM.
#3
Posted 30 August 2006 - 12:58 AM
Is this the eddition of TP2 file or the ingame files installed after the mod? If TP2 coud any of you modders give me an example what to change in tp2?
EXTEND_TOP command is used in TP2, but Continue() must be added to the area scripts you're extending.
For example, for TP2 line:
EXTEND_TOP ~AR0602.BCS~ ~My_mod/Scripts/AR0602.BAF~
you must open your AR0602.BAF which contains script blocks to be added to the top of AR0602.BCS and make sure they all end with Continue().
#4
Posted 30 August 2006 - 07:38 PM
#5
Posted 31 August 2006 - 02:02 AM
this isn't dealt with in the tp2 internally, but the mods other files.
#6
Posted 31 August 2006 - 02:05 AM
and is there a possibility to add the continues to TP2 or they have to be added to the existing scripts?
EXTEND_TOP command is used in TP2, but Continue() must be added to the area scripts you're extending.
#7
Posted 31 August 2006 - 05:44 AM
In your .tp2, there should be a line to extend an area script like one of the following:
EXTEND_TOP ~_AR0300.bcs~ ~BG1NPC/Phase2/BAF/X#ELPRI.BAF~ //remember to add Continue(), because it goes before all other previous code EXTEND_BOTTOM ~_AR4800.bcs~ ~BG1NPC/Phase2/BAF/P#FW4800.BAF~ //this does not need continue, because it goes after all previously existing code
On the one that says EXTEND_TOP, and refers to an area script (not a player script, but one marked AR, or _AR if using Tutu), you need to find and open the related file (in this case, X#ELPRI.BAF, located in the subdirectory BG1NPC/Phase2/BAF/).
This file will probably look something like this:
IF InParty("eldoth") RealGlobalTimerExpired("EldPoetPri","GLOBAL") OR(2) Global("PRIELD","GLOBAL",1) Global("PRIELD","GLOBAL",2) THEN RESPONSE #100 SetGlobal("PRIELD","GLOBAL",3) END IF InParty("eldoth") Global("PRIELD","GLOBAL",3) THEN RESPONSE #100 ActionOverride("eldoth",StartDialogueNoSet(Player1)) END
This file would be edited to look like this:
IF InParty("eldoth") RealGlobalTimerExpired("EldPoetPri","GLOBAL") OR(2) Global("PRIELD","GLOBAL",1) Global("PRIELD","GLOBAL",2) THEN RESPONSE #100 SetGlobal("PRIELD","GLOBAL",3) Continue() //<<<<<This is added to make the Area script go on and find additional things to do END IF InParty("eldoth") Global("PRIELD","GLOBAL",3) THEN RESPONSE #100 ActionOverride("eldoth",StartDialogueNoSet(Player1)) Continue() //<<<<<This is added to make the Area script go on and find additional things to do END
#8
Posted 31 August 2006 - 06:50 PM
#9
Posted 03 September 2006 - 11:48 AM
edit *** removed examples i stand corrected
and i am still checking
ronin
Edited by ronin69hof, 04 September 2006 - 10:06 AM.
#10
Posted 03 September 2006 - 02:13 PM
next version of BG1NPC will have the three files where we add code to area scripts using EXTEND_TOP. Everywhere else we have always erred on the side of maximum compatability by using EXTEND_BOTTOM.
Edited by cmorgan, 04 September 2006 - 06:29 AM.
#11
Posted 04 September 2006 - 02:25 AM
you need Continue()s on:
1. script blocks added using EXTEND_TOP
2. to area scripts
3. that have OnCreation() blocks in them.
any script that doesn't meet all three criteria (eg: baldur.bcs, and area scripts without OnCreation() blocks) doesn't need a Continue().
(and i would have posted this earlier, but for the bloody IPS driver errors and forum timeouts )
"A simple test of the relative merits of science and religion is to compare lighting your house at night by prayer or electricity" - A. C. Grayling
"EFF files have saves, too." - CamDawg
|| this is radio seanas || BP Series v3 || seanas at work ||
#12
Posted 04 September 2006 - 02:38 AM
ronin
#13
Posted 04 September 2006 - 03:20 AM
yep: least worst situation is you generate game lag as the script engine continually checks a script it would otherwise have ended checking after the first valid state was returned true. think about the game lag that already kicks in the first time you enter an area in a heavily-modded BP - the engine is creating the modded creatures you've added, filling the containers with items you've added, etc.Does it hurt anything if there is a Continue() in there that doesnt need to be there?
the only time in the game you need multiple events to occur simultaneously is when you first enter an area, when you want the area to be populated correctly; otherwise events can happen sequentuially as intended. you don't, say, want a mage's combat script to cast all valid spells in the same action.
Edited by seanas, 04 September 2006 - 03:24 AM.
"A simple test of the relative merits of science and religion is to compare lighting your house at night by prayer or electricity" - A. C. Grayling
"EFF files have saves, too." - CamDawg
|| this is radio seanas || BP Series v3 || seanas at work ||
#14
Posted 04 September 2006 - 04:34 AM
One question: what if my EXTEND_TOP blocks NEVER become true, until the player visits the area at least twice?
IWD NPC, Xan, The Sellswords, Back to Brynnlaw, Assassinations, Dungeon Crawl, Reunion, Branwen, Coran, Tiax, Xan BG1 Friendship
BG1 NPC, Romantic Encounters
#15
Posted 04 September 2006 - 06:29 AM
Edited both post and worklog based on your comments above, seanas... my only question is how do we know that the area scripts in question will not be on top of a mod-added OnCreation()? I doubt we have any such code in Tutu area scripts (haven't looked hard though), but for BGT compatability that seems important...
the code above is actual BG1NPC stuff added to the Tutu-converted AR0300 (whatever that is in BGT).
#16
Posted 04 September 2006 - 07:07 AM
Follow up question...
Edited both post and worklog based on your comments above, seanas... my only question is how do we know that the area scripts in question will not be on top of a mod-added OnCreation()? I doubt we have any such code in Tutu area scripts (haven't looked hard though), but for BGT compatability that seems important...
the code above is actual BG1NPC stuff added to the Tutu-converted AR0300 (whatever that is in BGT).
I'm currently working my way slowly through 1st my Area.bcs's and then the rest of the .bcs's on my override directory, and am now up the the D's in my .bcs folder in NI, removing continue's from where they don't need to be, and adding them where they should be. I can already see a hell of a difference in the NEJ2 area's I've gone to. It might be awhile til I'm done.
It takes a village...
#17
Posted 04 September 2006 - 10:15 AM
IF InParty("BLAH") GlobalLT("BLAHSpawned","AR0300",5) OR(2) Global("BodhiJob","GLOBAL",1) Global("AranJob","GLOBAL",1) THEN RESPONSE #100 CreateCreature("BLAH",[1625.3234],7) IncrementGlobal("BLAHSpawned","AR0300",1) [b]// Do I need a continue here or not ?[/b] END IF OnCreation() Global("Reveal0300","AR0300",0) THEN RESPONSE #100 SetGlobal("Reveal0300","AR0300",1) Explore() Continue() END
Thanks
ronin
Edited by ronin69hof, 04 September 2006 - 10:15 AM.
#18
Posted 04 September 2006 - 10:32 AM
So, is the following area bcs example correct or would I need to add a "Continue()"
IF InParty("BLAH") GlobalLT("BLAHSpawned","AR0300",5) OR(2) Global("BodhiJob","GLOBAL",1) Global("AranJob","GLOBAL",1) THEN RESPONSE #100 CreateCreature("BLAH",[1625.3234],7) IncrementGlobal("BLAHSpawned","AR0300",1) [b]// Do I need a continue here or not ?[/b] END IF OnCreation() Global("Reveal0300","AR0300",0) THEN RESPONSE #100 SetGlobal("Reveal0300","AR0300",1) Explore() Continue() END
Thanks
ronin
Need a continue() at the end of the IF/THEN block preceeding the On Creation() Block
It takes a village...
#19
Posted 04 September 2006 - 10:35 AM
ronin
#20
Posted 04 September 2006 - 10:50 AM
So its not on every block preceding the OnCreation, just the one before it?
EVERY block before any OnCreation().
(last update: 02-12-2008)
----------------------------------------------
SoS, v1.13
TDD, v1.12
TS-BP, v6.10
CtB, v1.11
RoT, v2.1
----------------------------------------------
BP Animations Scheme