View Single Post
  #681  
Old 23-03-2019, 19:41
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,074
Thanks: 1,814
Thanked 2,304 Times in 787 Posts
Cesar82 is on a distinguished road
ASIS - Valid Component

Quote:
Originally Posted by Schabik View Post
The extract part is OK, although I'm having problems with understanding the new code.

I have to run a program conditionally that targets in AC1 .forge.patch files.

The condition is that it only should run when Polish or Czech language is selected. How to check if Polish (for example component3.Name=cm:PL) is selected to run the program and run it if the condition is fulfilled?

In Beta6 or 7 it was easy, check if "IsComponentSelected('lang\PolishLang')" and then run program to patch the forge files but now it's not clear for me.
How to use by ID (ID is the number of the component represented by "#" in keys Component#.Name=):
Code:
  if IsComponentSelectedByID(3) then
    MsgBox('True', mbInformation, MB_OK)
  else
    MsgBox('False', mbInformation, MB_OK);
How to use by Name (Same name that you used in INI):
- If you have "Character Backslash" in the name you will check with dependence on "Level".
- If you do not have "Character Backslash" in the name you will only check on the components with "Component#.File" other than empty.
Code:
  if IsComponentSelectedByName('Game Components\') then 
    MsgBox('True', mbInformation, MB_OK)
  else
    MsgBox('False', mbInformation, MB_OK);
Code:
  if IsComponentSelectedByName('Game Components\Custom Name') then
    MsgBox('True', mbInformation, MB_OK)
  else
    MsgBox('False', mbInformation, MB_OK);
Code:
  if IsComponentSelectedByName('Game Components\cm:FR') then
    MsgBox('True', mbInformation, MB_OK)
  else
    MsgBox('False', mbInformation, MB_OK);
Attached Files
File Type: 7z 7.1.2.beta8.FIX (Valid Components).7z (21.2 KB, 16 views)

Last edited by Cesar82; 24-03-2019 at 16:29.
Reply With Quote
The Following 4 Users Say Thank You to Cesar82 For This Useful Post:
KaktoR (24-03-2019), mausschieber (24-03-2019), pakrat2k2 (24-03-2019), Titeuf (24-03-2019)