Wake of Gods Forum | Форум Во Имя Богов

Full Version: Ваши вопросы по ERM-скриптам
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625
Berserker, thanks! Now I understand.

Although I wish I read about OB:T earlier...
Archer30, right, OB:T is safe too, forgotten.
Hi! Is it possible to use SN:W variables or name variables in json? Do I have to use normal v, x, y variables for integers?

Tried with %i(jsonkey) %(name:y), %(name), no luck, just got the text instead of the value I need.
Nope. It's strongly not recommended to use any variables in json. It's a temporary deprecated feature for old mods.
Pass named parameters to json instead.

!!SN:T^key^/?(translation:z)/^parameter1_name^/^parameter1_value^/.../.../^parameterN_name^/^parameterN_value^;

in json value: "You know, parameter_1 value is @parameter1_value@".

Code:
Version 2.6.2
------------------------
[+] Added localization support for ERM scripts. All Lang\*.json files are loaded and merged into single dictionary of key => value pairs with language data.
Json files must be saved in UTF-8 encoding with preferably Unix line endings (#10 = 0x0A). The format is the following:

{
  "unique global key": "translation",
  "another key": "another translation"
}

During file loading text is converted from UTF-8 (Unicode, i.e Russian, Polish, Chinese and any other language is supported) into ANSI-encoding, used by player's operational system, ex. Windows-1251.
Thus you may ship the translation, other people may open and edit it without loss and characters, not representable on particular PC, will be replaced with "?".

Real example:

{
  "eqs.this_day_savegame_name": "@day@_@player@",
  "eqs.end_turn_autosave_name": "@day@_@player@_End",
  "eqs.quicksave_name":         "@day@_@player@_Quick",
  "eqs.saved_msg":              "Saved!",
  "eqs.quicksaved_msg":         "Quicksaved!"
}

It's recommended to prefix each key with string, unique for mod or author, like "pm." for "Phoenix Mod".

Translations may have parameters in the form of "@parameter name@". Those parameters are replaced with actual values during translation.
New ERM command !!SN:T is used to translate strings by key.
!!SN:T(key)/?(z-variable to place result to)/(parameter name 1)/(parameter value 1)/(parameter name 2)/(parameter value 2)...;

Example:

!!OW:R-1/6/?y1; y1 - player's gold amount
!!SN:T^test.gold_amount_report^/?z2/^gold^/y1;
!!IF:M^%Z2^; prints "You have 12850 gold left. Not bad!"

my test.json:

{
  "test.gold_amount_report": "You have @gold@ gold left. Not bad!"
}
Berserker, thanks! I thought json was advanced? Besides json, we have only erm/ert to use. They both have some disadvantages that I wouldn't consider using 102
What do you mean "advanced"? Json is data format, while translated string value supports arbitrary substituted parameters, which is widely used practice. In all languages we do not interpret variables inside translated string. We pass any variable as named parameter instead. Thus we can change the code freely without touching the translation and nice versa.

SN:T..../^param_name^/i^some_var^/^param_name2^/s^some_var^;
Здравствуйте..

Не знаю, стоит ли спрашивать подсказки или помощи, так как очевидно, что ответа не дождусь, как мне уже здесь сказали, что здесь, словно в сказке «золотая рыбка» с лимитом желаний Bad
Но всё равно попробую спросить, может какая-нибудь добрая душа поможет разобраться:

1. Как заставить появиться в гильдии магов во всех городах заклинание «Гром титанов», если это вообще возможно?
Это !#SS57:H0/65 H1/65 H2/80 H3/65 H4/65 H5/65 H6/65 H7/65 H8/65; работает только для установки шанса появления, а вот чтобы эта магия сама появилась в городских гильдиях – не знаю что тут надо сделать!

Может как-то через эту команду делается: !!CAx/y/z:G4/57/3; - тут переменная не понятная мне и ошибка всегда выходит, а магия не появляется!

2. Как можно посчитать кол-во захваченных замков, например у красного игрока?
Я пробовал, таким образом, но здесь какая-то бессмыслица выходит!
Скрипт
Достоверен ли этот расчёт или есть проще и правильнее?

Ещё конечно найти бы человечка, который потом помог бы один скрипт написать за оплату!

Заранее благодарю?
(09.06.2021 18:46)fatsawhorse Wrote: [ -> ]1. Как заставить появиться в гильдии магов во всех городах заклинание «Гром титанов», если это вообще возможно?

Оно запрещено к появлению в гильдии магов.

(09.06.2021 18:46)fatsawhorse Wrote: [ -> ]2. Как можно посчитать кол-во захваченных замков, например у красного игрока?

Просто считываешь значение из Структура_игрока.Количество_городов. Считать все города с помощью ERM вовсе необязательно.
Здравствуйте XEPOMAHT

Quote:Оно запрещено к появлению в гильдии магов.
- честно, я не знал.. Жаль.. Bad Спасибо за ответ.

Quote:Просто считываешь значение из Структура_игрока.Количество_городов. Считать все города с помощью ERM вовсе необязательно.
- был бы рад чуть подробнее уточнить это..?
(09.06.2021 20:44)fatsawhorse Wrote: [ -> ]
Quote:Просто считываешь значение из Структура_игрока.Количество_городов. Считать все города с помощью ERM вовсе необязательно.
- был бы рад чуть подробнее уточнить это..?

В хелпе найдите и прочитайте о команде !!OW:W#1/$1
Quote:В хелпе найдите и прочитайте о команде !!OW:W#1/$1
- понял.. Спасибо..
Quote:What do you mean "advanced"?

Berserker, by that, I mean...modern and recommended? In ERA 3 we no longer use x y v or even w variables, we use names variables since names are much better in readiness. I thought json was part of your "upgrade" plan. Json is naturally better than ert/erm for strings. But with name variables, I still have to write extra erm lines. 102

____


New question:

Can someone help with the UN:C addresses for the name and description of the building Ballista Yard (Stronghold) please?
You have to explicitly pass named values to translation, right.
Здравствуйте, подскажите пожалуйста как редактировать заклинания в Heroes 3 era? Через MMArchive (sptraits.txt) или с помощью скриптов.
Что именно менять?
Pages: 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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625
Reference URL's