The Black Wyrm Lair Forums
The Black Wyrm's Lair Terms of Use Help Search Members Calendar

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> TP2 - Conditionnal copy
aigleborgne
post Aug 25 2006, 06:59 AM
Post #1



Group Icon

Mod Developer
Posts: 210
Joined: 3-December 05




Hi,

I am not really confident in tp2 coding and still have troubles.

In short, there are 2 files, I will patch one of them, depending of a variable. I have try this code:

Part of Setup-Enhanced_Creatures.tp2:
INCLUDE ~Enhanced_Creatures/Setup-Enhanced_Creatures.tph~
OUTER_SET "component" = 4
LAUNCH_ACTION_MACRO ~PATCH_CREATURES~

Part of Setup-Enhanced_Creatures.tph:
DEFINE_ACTION_MACRO ~PATCH_CREATURES~ BEGIN
ACTION_IF ("%component%" = 3) BEGIN
COPY ~Enhanced_Creatures/JA#monst.2da~ ~override/JA#monst.2da~
ELSE
COPY ~Enhanced_Creatures/JA#npc.2da~ ~override/JA#npc.2da~
END

Or:

DEFINE_ACTION_MACRO ~PATCH_CREATURES~ BEGIN

ACTION_IF ("%component%" = 3) BEGIN
SPRINT open_file JA#monst.2da
ELSE
SPRINT open_file JA#npc.2da
END

COPY_EXISTING ~%open_file%~ ~override/open_file~

Neither of this work. ACTION_IF, PATCH_IF... I tried both. I don't know how to solve it.
Well, I know one way: open any file, so I can use patch_if, then open the 2nd with inner action.

If someone know the right way to do this, I would really appreciate and be very happy
Go to the top of the page
 
Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:



- Lo-Fi Version Time is now: 19th May 2024 - 06:17 AM