Wednesday, June 22, 2022

The NVL Maker (KiriKiri 吉里吉里2) : Particle.dll 粒子特效插件使用 為遊戲加入各種火光動畫效果

在日文網站發現一個在吉里吉里2做動畫特效的插件( Particle.dll ),可製作各種火光雷電特炫目效果。特意嘗試能否使用在The Nvl Maker繁體版中,實測完全可行。

只需要解決兩件事。

—下載那個插件(廢話。。。)

—解決範例文本字元編碼問題 (可使用免費的Notepad++)


詳細步驟如下 : 

1。下載並解壓 particle.zip

2。把scenario Folder內的文檔轉成UTF-16 LE BOM 編碼。(用Notepad++即可)

3。把image , others 內的檔案複製一份到NVL maker 專案(project)內Data Folder的
同名Folder 中。

4。把particle.dll 複製到NVL maker 專案(project)內plugin Folder中。

5。修改NVL maker 專案(Project)內Data Folder的startup.tjs,加上以下這句,去連結插件。

Plugins.link("plugin/particle.dll"); 
6。將步驟2改好編碼的first.ks改名為prelogue.ks,與particle.ks一同放到NVL maker 專案(project)內Data的scenario Folder 中。
(取代原有prelogue.ks前,請先備份原來的prelogue.ks)

7。啟動krkr.exe,在標題畫面按Start (或開始遊戲),直接看效果。

8。看完後可將prelogue.ks還原成原本檔案。 


日文網上還有其他附件圖片和定義asd可使用,都是很PRO的效果,可慢慢發掘。

作者也創作了個工具去寫效果定義檔,可課5000支持一下。



Wednesday, June 15, 2022

PowerShell Script : Convert UTF-8 text file into UTF-16 Unicode encoding file , salesforce dataloader export csv to UTF-16 Unicode SFDC 原生編碼字元轉換補遺

The native dataloader from Salesforce only export .csv file in UTF-8 encoding . And it is asked to exchange information with Therefore™ information management application which uses UTF-16 encoding data .

The pros and cons of UTF-8 and UTF-16 (Unicode) encoding can be found in here.
Storage and indexing speed etc. matters. 

The most easy way to do this is using powershell script to encode the .csv from Salesforce dataloader export to Unicode in mainly one line .PS script. Schedule this script into window task scheduler , done.

  

Get-content -encoding UTF8 $filename | Set-Content -encoding Unicode "$new_filename"

Script below shows how to convert multiple UTF-8 files in folder into UTF-16 files with error log tracking. 

Both UTF-8 and UTF-16 files will be available in the folder after conversion.
UTF-8 abc.csv will be cloned , and a UTF-16 abc_utf16.csv will be created in the same folder.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#Continue conversion even if one file failed , just log down the error.
$ErrorActionPreference="SilentlyContinue"
Stop-Transcript | out-null
$ErrorActionPreference = "Continue"
#-path of the log file
Start-Transcript -path "C:\ABCProject\log\utfLog.txt" -append
try {
#double bracket for path with space
#get all csv files inside that folder
get-childitem "C:\ABCProject\write\*.csv" | 

  foreach-object { 
    $name = $_.FullName;
    write-host "The file name" $name;
    $fname = $name.replace(".csv","_utf16.csv");
    write-host "The new file" $fname;
    get-content -encoding UTF8 $name  | Set-Content  -encoding Unicode  "$fname" 
}
 Stop-Transcript
 exit
}
catch {
  #log -message "Get-WmiObject cmdlet failed" -type "Error"
  write-host "Error found " $_.Exception.Message.ToString() -type "Error"

}

Tuesday, June 14, 2022

Salesforce Administration : 2022 Spring email about "Salesforce email verification" from support@salesforce.com SFDC Salesforce 電郵認證郵件是釣魚嗎?

Recently some of the users receiving email from support@salesforce.com with subject "Salesforce email verification". A link is inside that email , users worry it may be phishing email ,so they come to check .

Luckily, it is not a phishing email . From official announcementprior to the Summer '22 release , users may be asked to verify their email .


To get the list of user who may get the mentioned verification email ,s
ystem administrators may use SOQL below :

SELECT Name from User where id IN (SELECT UserId FROM TwoFactorMethodsInfo where HasUserVerifiedEmailAddress = false)


Error message
"sObject is not supported" may be shown if your account do NOT have Manage Multi-Factor Authentication in API permission.

To enable this permission

1.    Go to Setup -> Manage Users -> Permission Sets , click New to create a new permission set.

2.    Select "System Permissions" . 


3.    Click "Edit" , scroll down to items below ,and checked the box. Then save.

        -    Manage Multi-Factor Authentication in API
       -    Manage Multi-Factor Authentication in User Interface




4.    Add the permission set to a user account you use to run the SOQL by using "Assign" button.

5.    Click "Done" to save the setting.

6.    Run the SOQL again.





Next year SF migration plan : moving out customer account to AWS , and call SF data with service account

 👀 The most challenging part is about those function with user verification. My service cloud with MIAW chat , nearly redo due to the user ...