Is there a check and assume that there is to see if a file exists and if it does do not over write it?

TP2 Question
Started by Melkor, Oct 08 2003 04:55 PM
3 replies to this topic
#1
Posted 08 October 2003 - 04:55 PM
Chosen of Mystra Mod Forums Home to great BG and IWD mods
The Frozen North Forums IWD, NWN, KotOR discussion
The Frozen North Forums IWD, NWN, KotOR discussion
#2
Posted 08 October 2003 - 05:25 PM
In Sola tp2 Weimer uses this:
ACTION_IF NOT FILE_EXISTS ~override/action.ids~ THEN BEGIN
COPY ~solarom/ids/action.ids~ ~override/action.ids~
END
Would assume this is still a feature in newer versions, it is still in documentation:
ACTION_IF Predicate THEN BEGIN TP2 Action list END [ ELSE BEGIN TP2 Action list END ]
Though it looks like FILE_EXISTS_IN_GAME might be better predicate (says override and biffs searched)
Apparently zero content file is same as file does not exist (true for either predicate). Good!
ACTION_IF NOT FILE_EXISTS ~override/action.ids~ THEN BEGIN
COPY ~solarom/ids/action.ids~ ~override/action.ids~
END
Would assume this is still a feature in newer versions, it is still in documentation:
ACTION_IF Predicate THEN BEGIN TP2 Action list END [ ELSE BEGIN TP2 Action list END ]
Though it looks like FILE_EXISTS_IN_GAME might be better predicate (says override and biffs searched)
Apparently zero content file is same as file does not exist (true for either predicate). Good!

Minister of disinformation
Iltha Windspear
Working on Iltha Windspear Expansion. At left is Iltha, not me! I'm a guy. Who's Azrii you ask? She's the one who taught me it's a lot easier to fly with a basic storyline in hand as opposed to relying on my 'intuitive and ingenious' imagination.
Iltha Windspear
Working on Iltha Windspear Expansion. At left is Iltha, not me! I'm a guy. Who's Azrii you ask? She's the one who taught me it's a lot easier to fly with a basic storyline in hand as opposed to relying on my 'intuitive and ingenious' imagination.
#3
-jcompton-
Posted 09 October 2003 - 06:38 AM
Here's a situation where ANOME25D.BCS doesn't exist in TOB, but some mod might have introduced it... so if it's there, we just want to ADD our code, but if it's not there we'll CREATE it.
ACTION_IF
FILE_EXISTS ~override\anome25d.bcs~
THEN BEGIN
EXTEND_BOTTOM ~anome25d.bcs~ ~kelseytob\V2Scripts\j#ano25d.baf~
END
ELSE BEGIN
COMPILE ~KelseyToB\V2Scripts\J#Ano25D.baf~
END
ACTION_IF
FILE_EXISTS ~override\anome25d.bcs~
THEN BEGIN
EXTEND_BOTTOM ~anome25d.bcs~ ~kelseytob\V2Scripts\j#ano25d.baf~
END
ELSE BEGIN
COMPILE ~KelseyToB\V2Scripts\J#Ano25D.baf~
END
#4
Posted 10 October 2003 - 03:46 AM
Someone read my mind because my next question was along the same lines. Thanks B)Here's a situation where ANOME25D.BCS doesn't exist in TOB, but some mod might have introduced it... so if it's there, we just want to ADD our code, but if it's not there we'll CREATE it.
ACTION_IF
FILE_EXISTS ~override\anome25d.bcs~
THEN BEGIN
EXTEND_BOTTOM ~anome25d.bcs~ ~kelseytob\V2Scripts\j#ano25d.baf~
END
ELSE BEGIN
COMPILE ~KelseyToB\V2Scripts\J#Ano25D.baf~
END
Chosen of Mystra Mod Forums Home to great BG and IWD mods
The Frozen North Forums IWD, NWN, KotOR discussion
The Frozen North Forums IWD, NWN, KotOR discussion