Jump to content


Photo

Continue()'s !!!


  • Please log in to reply
33 replies to this topic

#1 King Diamond

King Diamond

    Give Me Your Soul...Please

  • Modder
  • 1430 posts

Posted 26 July 2006 - 07:37 AM

Plz, ppl!

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 dragonian

dragonian
  • Validating
  • 503 posts

Posted 29 August 2006 - 06:19 PM

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?

Edited by dragonian, 29 August 2006 - 06:19 PM.


#3 pro5

pro5
  • Modder
  • 722 posts

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 dragonian

dragonian
  • Validating
  • 503 posts

Posted 30 August 2006 - 07:38 PM

and is there a possibility to add the continues to TP2 or they have to be added to the existing scripts?

#5 radish_hoedown

radish_hoedown
  • Member
  • 201 posts

Posted 31 August 2006 - 02:02 AM

that IS how to add it to the tp2, unless i'm mistaken?
this isn't dealt with in the tp2 internally, but the mods other files.

#6 NiGHTMARE

NiGHTMARE
  • Member
  • 2328 posts

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 cmorgan

cmorgan
  • Modder
  • 2301 posts

Posted 31 August 2006 - 05:44 AM

sample:
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 dragonian

dragonian
  • Validating
  • 503 posts

Posted 31 August 2006 - 06:50 PM

Ok thanks :)

#9 ronin

ronin
  • Modder
  • 2114 posts

Posted 03 September 2006 - 11:48 AM

Damn, there are a ton of mods that dont have a continue in the baf when they extend top.

edit *** removed examples i stand corrected

and i am still checking

ronin

Edited by ronin69hof, 04 September 2006 - 10:06 AM.


#10 cmorgan

cmorgan
  • Modder
  • 2301 posts

Posted 03 September 2006 - 02:13 PM

oh bother... I should check extensions of Baldur.bcs as well as area .bcs, right? Didn't extrapolate far enough...

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. Until I messed it up by trying to get fancy for solo players burying Gorion's body, at the start of the game, we never touched baldur.bcs; now we have a one-block addition. I will go put a Continue() on that right now :)

Edited by cmorgan, 04 September 2006 - 06:29 AM.


#11 seanas

seanas
  • Modder
  • 1906 posts

Posted 04 September 2006 - 02:25 AM

can i just reiterate KD's initial post:

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 :angry: )

"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 ronin

ronin
  • Modder
  • 2114 posts

Posted 04 September 2006 - 02:38 AM

Does it hurt anything if there is a Continue() in there that doesnt need to be there?

ronin

#13 seanas

seanas
  • Modder
  • 1906 posts

Posted 04 September 2006 - 03:20 AM

Does it hurt anything if there is a Continue() in there that doesnt need to be there?

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.

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 Kulyok

Kulyok
  • Modder
  • 2450 posts

Posted 04 September 2006 - 04:34 AM

Good point, thanks.

One question: what if my EXTEND_TOP blocks NEVER become true, until the player visits the area at least twice?

#15 cmorgan

cmorgan
  • Modder
  • 2301 posts

Posted 04 September 2006 - 06:29 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).

#16 erebusant

erebusant

    It takes a village...

  • Modder
  • 2109 posts

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. :P

It takes a village...


#17 ronin

ronin
  • Modder
  • 2114 posts

Posted 04 September 2006 - 10:15 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

Edited by ronin69hof, 04 September 2006 - 10:15 AM.


#18 erebusant

erebusant

    It takes a village...

  • Modder
  • 2109 posts

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 ronin

ronin
  • Modder
  • 2114 posts

Posted 04 September 2006 - 10:35 AM

So its not on every block preceding the OnCreation, just the one before it?

ronin

#20 King Diamond

King Diamond

    Give Me Your Soul...Please

  • Modder
  • 1430 posts

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