Jump to content

How do I go up my .tp2 file without force erroring out ?


Jarno Mikkola

Recommended Posts

Well, as probably some of you know, I have updated the iiSpellSystemAdjustment mod a few times, and I this directly related to it.

Now the mod asks during the install a few values, which when returning a valid value will ask the next one... now this is not just once, but can be a lots of times, and I wanted to add yet another step that asks if the player if he/she wants the values that they end up with to be applied. The problem is that they cannot be returned to without a failure state.

 

Now I have this already all coded, with one but I would like to avoid the negative imput( heh ) to result to the forced error that does allow a reinsert of new values, but also reports it as an error in the weidu level. So how would you good people go about this, here's the important sections: Start, where we start ... it will print out the timers1-9 eventually:

DESIGNATED 10
BEGIN @1

PRINT @2
PRINT @3
ACTION_READLN function
OUTER_WHILE (!(IS_AN_INT %function%) || (%function% > 3) || (%function% < 1)) BEGIN
  PRINT @2
  PRINT @3
  ACTION_READLN function
END
...

And then the forced error with "n" input answer(, without quotes, dah):

ACTION_IF (IS_AN_INT %timer1% AND IS_AN_INT %timer2% AND IS_AN_INT %timer3% AND IS_AN_INT %timer4% AND IS_AN_INT %timer5% AND IS_AN_INT %timer6% AND IS_AN_INT %timer7% AND IS_AN_INT %timer8% AND IS_AN_INT %timer9%) THEN BEGIN
//here we have conditioned it so that timers are valid insert values to the following prints @13 ... and then we show them:
PRINT @13
//and then ask at @14 the: Are you sure you wish to use these ?
PRINT @14
ACTION_READLN answer
  OUTER_WHILE !(~%answer%~ STRING_COMPARE_CASE ~y~ || ~%answer%~ STRING_COMPARE_CASE ~n~) BEGIN
    PRINT @14
    ACTION_READLN answer
  END 

ACTION_IF (~%answer%~ STRING_COMPARE_CASE ~y~) THEN BEGIN 
FAIL @15 //this is where the forced failure comes in, yeah the STRING_COMPARE_CASE is actually gives a negated value, so the "n/N" use this line while the "y/Y" use the other...
END

ACTION_IF (~%answer%~ STRING_COMPARE_CASE ~n~) THEN BEGIN
PRINT @16
... //and here we proceed to the next step already.

So essentially, how do I combine these ?

So it's the "Are you sure you wish to use these values ?" in this picture:

85c77e8794c21131cc75207428a51ae4-capture

Link to comment

Take a look at the romance cheats component from Tweaks. It asks four or five yes or no questions, presents a summary, and asks for a final OK. If that final OK is not approved, it starts over with the questions.

 

 

// questions to set options
OUTER_SET "proceed" = 0
OUTER_SET "req_race" = 0
OUTER_SET "req_gender" = 0
OUTER_SET "multiple" = 0
OUTER_SET "no_kill" = 0
OUTER_SET "start_tob" = 0

OUTER_WHILE ("%proceed%" STRING_COMPARE_REGEXP "[Aa]") BEGIN
  OUTER_WHILE ("%req_race%" STRING_COMPARE_REGEXP "[AaBb]") BEGIN
    PRINT @318301
    ACTION_READLN req_race
  END
  OUTER_WHILE ("%req_gender%" STRING_COMPARE_REGEXP "[AaBb]") BEGIN
    PRINT @318303
    ACTION_READLN req_gender
  END
  OUTER_WHILE ("%multiple%" STRING_COMPARE_REGEXP "[AaBb]") BEGIN
    PRINT @318305
    ACTION_READLN multiple
  END
  ACTION_IF ("%multiple%" STRING_COMPARE_CASE "a" = 0) THEN BEGIN // only offer no kill if multi-romance selected
    OUTER_WHILE ("%no_kill%" STRING_COMPARE_REGEXP "[AaBb]") BEGIN
      PRINT @318307
      ACTION_READLN no_kill
    END
  END
  ACTION_IF GAME_IS ~tob bg2ee~ THEN BEGIN // tob
    OUTER_WHILE ("%start_tob%" STRING_COMPARE_REGEXP "[AaBb]") BEGIN
      PRINT @318311
      ACTION_READLN start_tob
    END
  END
  // print summary of options before proceeding
  PRINT @318309
  ACTION_IF ("%req_race%" STRING_COMPARE_CASE "a" = 0) THEN BEGIN
    PRINT @318302
  END
  ACTION_IF ("%req_gender%" STRING_COMPARE_CASE "a" = 0) THEN BEGIN
    PRINT @318304
  END
  ACTION_IF ("%multiple%" STRING_COMPARE_CASE "a" = 0) THEN BEGIN
    PRINT @318306
  END
  ACTION_IF ("%no_kill%" STRING_COMPARE_CASE "a" = 0) THEN BEGIN
    PRINT @318308
  END
  ACTION_IF ("%start_tob%" STRING_COMPARE_CASE "a" = 0) THEN BEGIN
    PRINT @318312
  END
  OUTER_WHILE ("%proceed%" STRING_COMPARE_REGEXP "[AaBb]") BEGIN
    PRINT @318310
    ACTION_READLN proceed
  END
  ACTION_IF ("%proceed%" STRING_COMPARE_CASE "b" = 0) THEN BEGIN
    OUTER_SET "proceed" = 0
    OUTER_SET "req_race" = 0
    OUTER_SET "req_gender" = 0
    OUTER_SET "multiple" = 0
    OUTER_SET "no_kill" = 0
    OUTER_SET "start_tob" = 0
  END
END
Link to comment

Archived

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

×
×
  • Create New...