ホーム
ダウンロード
アプリ
素材
ドキュメント
ドキュメントトップ
最初のチュートリアル
GUIのチュートリアル
WMSのチュートリアル
コマンド一覧
コンフィグ一覧
よくある質問
English
Light
Dark
Auto
Light
Dark
Auto
wmsの具体例 をテンプレートにして作成 - Polaris Engine Wiki
Wikiトップ
編集
新規作成
複製
名称変更
アップロード
添付ファイル一覧
バックアップ
開始行:
WMSを使うと、様々なことが可能になりますが、非プログラマに...
そこで、こういう場合はこれを使う、というコピペ事例集をこ...
&br;
* メッセージウインドウ、フォント、横書きなどの初期化をす...
func main() {
s2_set_config("msgbox.tategaki", "0"); #横書き
s2_set_config("font.file", "VL-PGothic-Regular.ttf")...
s2_set_config("msgbox.bg.file", "msgbox-bg.png");
s2_set_config("msgbox.fg.file", "msgbox-fg.png");
s2_set_config("msgbox.x", "0"); #メッセ―ジボックス...
s2_set_config("msgbox.y", "457"); #メッセ―ジボック...
s2_set_config("msgbox.margin.left", "80"); #メッセ...
s2_set_config("msgbox.margin.right", "80"); #メッセ...
s2_set_config("msgbox.margin.top", "59"); #メッセー...
s2_set_config("sysmenu.hidden", "0"); #システムメニ...
s2_set_config("namebox.hidden", "0"); #名前ボックス...
s2_set_config("click.move", "0"); #クリックカーソル...
s2_set_config("click.x", "1170"); #クリックカーソル...
s2_set_config("click.y", "645"); #クリックカーソル...
s2_reflect_msgbox_and_namebox_config(); #メッセージ...
s2_reflect_font_config(); #フォント設定の変更
}
&br;
* 変数を取得し、計算した後、ゲーム内変数に書き込む [#x118...
func main() {
// 変数を取得する
a = s2_get_variable(0);
b = s2_get_variable(1);
c = s2_get_variable(2);
// 合計を計算する
sum = a + b + c;
// 変数100番に書き込む
s2_set_variable(100, sum);
}
* ゲーム内で現実の日時を取得 [#ne63d10e]
get-datetime.txt (wmsフォルダ) に以下のように記述します。
func main() {
// 日時を取得
now_y = s2_get_year();
now_mo = s2_get_month();
now_d = s2_get_day();
now_h = s2_get_hour();
now_mi = s2_get_minute();
now_s = s2_get_second();
now_w = s2_get_wday(); // 0=日、 1=月、 2=火……
// ゲーム内の変数$1と$2に、月と日にちの値を代入
s2_set_variable(1, now_mo);
s2_set_variable(2, now_d);
}
そして、例えばシナリオファイルで以下のようにすると、あら...
@wms get-datetime.txt
@if $1 == 4 april
@goto not_birthday
:april
@if $2 == 14 birthday
@goto not_birthday
:birthday
お誕生日おめでとう!
@goto common
:not_birthday
誕生日ではありません。
:common
# 以下略
また、時間帯によってメッセージを変えるなどに使えます。
終了行:
WMSを使うと、様々なことが可能になりますが、非プログラマに...
そこで、こういう場合はこれを使う、というコピペ事例集をこ...
&br;
* メッセージウインドウ、フォント、横書きなどの初期化をす...
func main() {
s2_set_config("msgbox.tategaki", "0"); #横書き
s2_set_config("font.file", "VL-PGothic-Regular.ttf")...
s2_set_config("msgbox.bg.file", "msgbox-bg.png");
s2_set_config("msgbox.fg.file", "msgbox-fg.png");
s2_set_config("msgbox.x", "0"); #メッセ―ジボックス...
s2_set_config("msgbox.y", "457"); #メッセ―ジボック...
s2_set_config("msgbox.margin.left", "80"); #メッセ...
s2_set_config("msgbox.margin.right", "80"); #メッセ...
s2_set_config("msgbox.margin.top", "59"); #メッセー...
s2_set_config("sysmenu.hidden", "0"); #システムメニ...
s2_set_config("namebox.hidden", "0"); #名前ボックス...
s2_set_config("click.move", "0"); #クリックカーソル...
s2_set_config("click.x", "1170"); #クリックカーソル...
s2_set_config("click.y", "645"); #クリックカーソル...
s2_reflect_msgbox_and_namebox_config(); #メッセージ...
s2_reflect_font_config(); #フォント設定の変更
}
&br;
* 変数を取得し、計算した後、ゲーム内変数に書き込む [#x118...
func main() {
// 変数を取得する
a = s2_get_variable(0);
b = s2_get_variable(1);
c = s2_get_variable(2);
// 合計を計算する
sum = a + b + c;
// 変数100番に書き込む
s2_set_variable(100, sum);
}
* ゲーム内で現実の日時を取得 [#ne63d10e]
get-datetime.txt (wmsフォルダ) に以下のように記述します。
func main() {
// 日時を取得
now_y = s2_get_year();
now_mo = s2_get_month();
now_d = s2_get_day();
now_h = s2_get_hour();
now_mi = s2_get_minute();
now_s = s2_get_second();
now_w = s2_get_wday(); // 0=日、 1=月、 2=火……
// ゲーム内の変数$1と$2に、月と日にちの値を代入
s2_set_variable(1, now_mo);
s2_set_variable(2, now_d);
}
そして、例えばシナリオファイルで以下のようにすると、あら...
@wms get-datetime.txt
@if $1 == 4 april
@goto not_birthday
:april
@if $2 == 14 birthday
@goto not_birthday
:birthday
お誕生日おめでとう!
@goto common
:not_birthday
誕生日ではありません。
:common
# 以下略
また、時間帯によってメッセージを変えるなどに使えます。
ページ名: