Thimblerig Posted October 15, 2014 Posted October 15, 2014 I'd like to set up a tp2 so that, when it detects which platform it's using, it records that in a Global (which my dialogue files can read...) eg. T1GameIs 1 = vanilla BG, T1GameIs 2 = BGT, T1GameIs 3 = EE... Is there an easy way to do that?
jastey Posted October 15, 2014 Posted October 15, 2014 I'd be interested, too. Until now, all I can think of is "Make a script that gets patched to an appropriate in-game script that sets the appropriate variable" (like for bg1re, for example).
Mike1072 Posted October 15, 2014 Posted October 15, 2014 An alternative solution to the problem: You could set up a WeiDU variable for each platform (GAMEISBGT, GAMEISTUTU, etc.) and initialize the value to True() if the current game matches that platform and False() otherwise. OUTER_TEXT_SPRINT GAMEISBGT ~False()~ OUTER_TEXT_SPRINT GAMEISTUTU ~False()~ // etc. ACTION_IF (GAME_IS ~bgt~) BEGIN OUTER_TEXT_SPRINT GAMEISBGT ~True()~ END ELSE ACTION_IF (GAME_IS ~tutu tutu_totsc~) BEGIN OUTER_TEXT_SPRINT GAMEISTUTU ~True()~ END // etc. After setting these variables, compiling dialogues with EVALUATE_BUFFER would let you use them in your triggers to make replies and states that are only active on particular platforms.
jastey Posted October 15, 2014 Posted October 15, 2014 Of course! I think I misunderstood the question completely. If you want to use different variable numbers for your .d-files upon instaling, using OUTER_SPRINT is the way to go. I'd try a hack like OUTER_SPRINT ~variable_value~ ~X~ With "X" being the different numbers you want for the different games. In the .d, you would use "Global("T1GameIs","GLOBAL",%variable_value%)" and COMPILE EVALUATE_BUFFER I'm at the wrong computer, but I could provide more code tonight if necessary.
CamDawg Posted October 15, 2014 Posted October 15, 2014 And in case you don't want the alternative, it's the same idea as Mike presented--you set a variable with GAME_IS, and then abuse EVALUATE_BUFFER to get it into a script: ACTION_IF (GAME_IS ~bgt~) BEGIN OUTER_SET game = 1 END ELSE ACTION_IF (GAME_IS ~tutu tutu_totsc~) BEGIN OUTER_SET game = 2 END ELSE ACTION_IF (GAME_IS ~bgee~) BEGIN OUTER_SET game = 3 END ELSE BEGIN // not bgt, tutu, or bgee; must be bg OUTER_SET game = 4 END <<<<<<<<...\inlined\foo.baf IF Global("T1GameIs","GLOBAL",0) THEN RESPONSE #100 SetGlobal("T1GameIs","GLOBAL",%game%) END >>>>>>>> EXTEND_BOTTOM ~baldur.bcs~ ~...\inlined\foo.baf~ EVALUATE_BUFFERThat initial ACTION_IF/GAME_IS tree can be as complicated or simple as you want.
Thimblerig Posted October 15, 2014 Author Posted October 15, 2014 Hmmm. That's very interesting. Thank you!
Thimblerig Posted October 16, 2014 Author Posted October 16, 2014 I ended up with a small handful of OUTER_SPRINT ~GAME_IS_EE~ ~True()~/~False~/~Monkeys!~ definitions along with the rest of the cross-platform variables: didn't take up much space, easy to read when I'm debugging files, and turns out all I needed was a very occasional True/False trigger. So that's okay. Thank you for your help.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.