Jump to content

Q: IF blocks and Game Start Detection


lroumen

Recommended Posts

Hi everybody,

 

I'm scripting some occurrences for the player which is level dependent.

 

A problem arises when considering that a player has just started BG1, SOA or TOB, because they all trip from the start. If I start in BG1 I would like all occurrences to trigger, however, if I start in SOA, a portion of them should be skipped and if I start in TOB, a large amount should be skipped. Also, if people import characters of higher levels than default, I would like to skip a few scenes dependent on the level.

 

To do that I have envisioned that I can set a global to the value of the character level upon character creation and by setting that before the level dependent occurrences, those blocks will effectively be skipped (with a check for that global using GlobalLT/GT or something).

 

However, how can one easily accomplish such a thing? I was thinking of using blocks like those below, but so far I have not been able to find it in any weidu tutorial (or I simply did not recognise the code I saw as such).

 

A) if a == b

IF

Global1 == Global2

THEN RESPONSE #100 DoThis() END

 

B) if True, set global a to value of the level of player X

IF

True()

THEN RESPONSE #100

SetGlobal("bla","GLOBAL",Level(PlayerX))

END

 

I can fix my problem by using a lot of repetitive blocks, but that is not very handy. Typos are easily made in such a case. So if I could use blocks like A and B, it would greatly help me.

 

 

I was also wondering what people normally do to check whether the player has started the game in BG1, SOA or TOB. Probably an AreaCheck and ChapterCheck? How would that be done?

 

 

Thanks in advance for the replies or interest.

Link to comment

Unfortunately the BG2 scripting language is somewhat limited and the scripting language of BG1 is downright barren. You can compare the values of global variables with the GlobalsEqual, GlobalsGT and GlobalsLT triggers (explained here) in BG2, but you can't set a variable to the level of PlayerX like that.

Link to comment
I was also wondering what people normally do to check whether the player has started the game in BG1, SOA or TOB. Probably an AreaCheck and ChapterCheck? How would that be done?
I too have this up a head... but the common way for BGT game, is to check for chapter number and if the ENDOFBG1 is 0, 1 or 2. 0 is Candlekeep, 1 is TotSC start, while 2 is SoA.
Link to comment

Hi Wisp and Jarno.

 

Thank you for the replies. I have been thinking on how to incorporate it and I think I've got it now using the GlobalsEqual.

I'm currently using a bunch of helper-globals to overcome these kind of scripting problems, but after a while it becomes rather messy to keep track of everything. In the end it means the code may not be very robust.

I'm not sure it will be robust when using GlobalsEqual etc either though.

Maybe I have to do something a little smarter.

 

I'm grateful for the link to the chapter blocks. That will certainly help me in the future.

Link to comment

Archived

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

×
×
  • Create New...