Connection failed:An existing connection was forcibly closed by the remote host

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
User avatar
Ravana
Forum Moderator
Posts: 2380
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by Ravana »

The version on addon server does not load, I had to define some macros to analyze it.

Code: Select all

#define LA_STANDARD_SIDE_STORE X
#warning unknown macro LA_STANDARD_SIDE_STORE
#enddef
#define LA_OPTION X
#warning unknown macro LA_OPTION
#arg name
#endarg
#enddef
#define LA_OPTION_IMAGE_SHOW_IF X Y
#arg name
#endarg
#arg side
#endarg
#warning unknown macro LA_OPTION_IMAGE_SHOW_IF
#enddef
#define LA_SPOILS_SHARE
#warning unknown macro LA_SPOILS_SHARE
#enddef
#define LA_SHOP_RESTOCK_COUNTER A B C
#warning unknown macro LA_SHOP_RESTOCK_COUNTER
#enddef
#define LA_ITEM_LOCATIONS_ADD A B C D E F G H I J K L
#warning unknown macro LA_ITEM_LOCATIONS_ADD
#enddef
#define LA_SPOILS_SPLIT_CHEST A B C
#warning unknown macro LA_SPOILS_SPLIT_CHEST
#enddef
#define UNIT_SPAWN A B C D
#warning unknown macro UNIT_SPAWN
#enddef
#define LA_TURN_EVENT A
#arg speaker
#endarg
#warning unknown macro LA_TURN_EVENT
#enddef
#define LA_OPEN_DOOR_MACRO A B C D E
#warning unknown macro LA_OPEN_DOOR_MACRO
#enddef
#define LA_MOVETO_WML A B C
#warning unknown macro LA_MOVETO_WML
#enddef
#define LA_OPTION_IMAGE A B C
#warning unknown macro LA_OPTION_IMAGE
#enddef
#define MOVETO_ACTION_WML_VARIABLE_ONLY A B C D E F
#warning unknown macro MOVETO_ACTION_WML_VARIABLE_ONLY
#enddef
Log

Code: Select all

Battle for Wesnoth v1.14.5+dev (0122a265c42-Modified)
Started on Thu Mar 12 21:01:33 2020

Automatically found a possible data directory at /home/USER/wesnoth/wesnoth-lobby
added 2 defines.
preprocessing common macros from 'data/core' ...
acquired 1665 'data/core' defines.
preprocessing specified resource: _main.cfg ...
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_STANDARD_SIDE_STORE"
at _main.cfg:11
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:50
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:37
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION"
at _main.cfg:14
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:124
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:37
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:126
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:37
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:136
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:37
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:146
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:37
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:157
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:37
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:167
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:37
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:177
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:37
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_SPOILS_SHARE"
at _main.cfg:26
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:38
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_SHOP_RESTOCK_COUNTER"
at _main.cfg:29
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:65
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_SHOP_RESTOCK_COUNTER"
at _main.cfg:29
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:66
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_SHOP_RESTOCK_COUNTER"
at _main.cfg:29
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:67
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_SHOP_RESTOCK_COUNTER"
at _main.cfg:29
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:68
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_ITEM_LOCATIONS_ADD"
at _main.cfg:32
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:83
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_ITEM_LOCATIONS_ADD"
at _main.cfg:32
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:86
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_SPOILS_SPLIT_CHEST"
at _main.cfg:35
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:109
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_TURN_EVENT"
at _main.cfg:41
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:210
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPEN_DOOR_MACRO"
at _main.cfg:46
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:232
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_MOVETO_WML"
at _main.cfg:49
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:233
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPEN_DOOR_MACRO"
at _main.cfg:46
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:254
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_MOVETO_WML"
at _main.cfg:49
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:255
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_MOVETO_WML"
at _main.cfg:49
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:298
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPEN_DOOR_MACRO"
at _main.cfg:46
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:325
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_MOVETO_WML"
at _main.cfg:49
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:327
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_MOVETO_WML"
at _main.cfg:49
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:347
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPEN_DOOR_MACRO"
at _main.cfg:46
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:364
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_MOVETO_WML"
at _main.cfg:49
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:365
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_MOVETO_WML"
at _main.cfg:49
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:372
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPEN_DOOR_MACRO"
at _main.cfg:46
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:384
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_MOVETO_WML"
at _main.cfg:49
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:386
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
20200312 21:01:33 warning preprocessor: #warning: "unknown macro MOVETO_ACTION_WML_VARIABLE_ONLY"
at _main.cfg:55
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/events.cfg:626
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:451
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
20200312 21:01:33 warning preprocessor: #warning: "unknown macro MOVETO_ACTION_WML_VARIABLE_ONLY"
at _main.cfg:55
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/events.cfg:626
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:453
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
20200312 21:01:33 warning preprocessor: #warning: "unknown macro MOVETO_ACTION_WML_VARIABLE_ONLY"
at _main.cfg:55
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/events.cfg:626
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:455
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
20200312 21:01:33 warning preprocessor: #warning: "unknown macro MOVETO_ACTION_WML_VARIABLE_ONLY"
at _main.cfg:55
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/events.cfg:626
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:457
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
20200312 21:01:33 warning preprocessor: #warning: "unknown macro MOVETO_ACTION_WML_VARIABLE_ONLY"
at _main.cfg:55
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/events.cfg:626
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:459
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
20200312 21:01:33 warning preprocessor: #warning: "unknown macro MOVETO_ACTION_WML_VARIABLE_ONLY"
at _main.cfg:55
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/events.cfg:626
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:461
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
20200312 21:01:33 warning preprocessor: #warning: "unknown macro MOVETO_ACTION_WML_VARIABLE_ONLY"
at _main.cfg:55
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/events.cfg:626
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:463
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
20200312 21:01:33 warning preprocessor: #warning: "unknown macro MOVETO_ACTION_WML_VARIABLE_ONLY"
at _main.cfg:55
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/events.cfg:626
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/maze.cfg:465
    included from _main.cfg:65
20200312 21:01:33 warning preprocessor: Redefining macro LA_BEAST_MENU without explicit #undef at ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:1
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:25
    included from _main.cfg:66
previously defined at ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:1
    included from _main.cfg:62
20200312 21:01:33 warning preprocessor: Redefining macro LA_BEAST_TUTORIAL without explicit #undef at ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:38
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:25
    included from _main.cfg:66
previously defined at ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:38
    included from _main.cfg:62
20200312 21:01:33 warning preprocessor: Redefining macro LA_BEAST_KILL_COUNT without explicit #undef at ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:67
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:25
    included from _main.cfg:66
previously defined at ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:67
    included from _main.cfg:62
20200312 21:01:33 warning preprocessor: Redefining macro LA_BEAST_QUESTS_VARS_LIST without explicit #undef at ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:291
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:25
    included from _main.cfg:66
previously defined at ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:291
    included from _main.cfg:62
20200312 21:01:33 warning preprocessor: Redefining macro LA_BEAST_OPTIONS_CONDITIONAL without explicit #undef at ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:309
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:25
    included from _main.cfg:66
previously defined at ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:309
    included from _main.cfg:62
20200312 21:01:33 warning preprocessor: Redefining macro LA_BEAST_OPTIONS without explicit #undef at ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:345
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:25
    included from _main.cfg:66
previously defined at ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:345
    included from _main.cfg:62
20200312 21:01:33 warning preprocessor: Redefining macro LA_BEAST_KILLS_EVENT without explicit #undef at ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:392
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:25
    included from _main.cfg:66
previously defined at ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:392
    included from _main.cfg:62
20200312 21:01:33 warning preprocessor: Redefining macro LA_BEAST_RAIDS without explicit #undef at ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:1
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:26
    included from _main.cfg:66
previously defined at ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:1
    included from _main.cfg:62
20200312 21:01:33 warning preprocessor: Redefining macro LA_RAID_WARNING without explicit #undef at ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:151
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:26
    included from _main.cfg:66
previously defined at ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:151
    included from _main.cfg:62
20200312 21:01:33 warning preprocessor: Redefining macro LA_RAID_START without explicit #undef at ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:241
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:26
    included from _main.cfg:66
previously defined at ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:241
    included from _main.cfg:62
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_STANDARD_SIDE_STORE"
at _main.cfg:11
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:50
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:43
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION"
at _main.cfg:14
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:124
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:43
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:126
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:43
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:136
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:43
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:146
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:43
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:157
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:43
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:167
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:43
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE_SHOW_IF"
at _main.cfg:19
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:177
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/utils/dungeon/scoring.cfg:21
    included from _main.cfg:63
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:43
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_SPOILS_SHARE"
at _main.cfg:26
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:44
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
    included from ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:4
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:26
    included from _main.cfg:66
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:213
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
    included from ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:5
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:26
    included from _main.cfg:66
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:213
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
    included from ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:6
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:26
    included from _main.cfg:66
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:213
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
    included from ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:7
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:26
    included from _main.cfg:66
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:213
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
    included from ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:8
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:26
    included from _main.cfg:66
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:213
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
    included from ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:9
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:26
    included from _main.cfg:66
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:213
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
    included from ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:10
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:26
    included from _main.cfg:66
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:213
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
    included from ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:11
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:26
    included from _main.cfg:66
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:213
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
    included from ~add-ons/LA_RPG_Maps/utils/beast/raids.cfg:12
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:26
    included from _main.cfg:66
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:213
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro UNIT_SPAWN"
at _main.cfg:38
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_SHOP_RESTOCK_COUNTER"
at _main.cfg:29
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:270
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_SHOP_RESTOCK_COUNTER"
at _main.cfg:29
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:271
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_SHOP_RESTOCK_COUNTER"
at _main.cfg:29
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:272
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_SHOP_RESTOCK_COUNTER"
at _main.cfg:29
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:273
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
    included from ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:20
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:25
    included from _main.cfg:66
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:284
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
    included from ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:45
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:25
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
    included from ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:47
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:25
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
    included from ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:53
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:25
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
    included from ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:22
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:25
    included from _main.cfg:66
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:284
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
    included from ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:74
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:25
    included from _main.cfg:66
20200312 21:01:33 warning preprocessor: #warning: "unknown macro LA_OPTION_IMAGE"
at _main.cfg:52
    included from ~add-ons/LA_RPG_Maps/utils/beast/beast.cfg:25
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:25
    included from _main.cfg:66
    included from ~add-ons/LA_RPG_Maps/scenarios/4_villages.cfg:284
    included from _main.cfg:66
acquired 1752 total defines.
preprocessing finished. Took 407 ticks.
Output WML without these macros is 7031 lines, 162kB.

User avatar
LordAwsomeness
Posts: 189
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by LordAwsomeness »

Alright so ive been attempting to give the new code a test run using the concept you gave me:

First i create the macro to potentially save time (think of this as the race macro you made)

Code: Select all

#define LA_WEAPON_SET_VARIABLES_WEAPONS VAR IMAGE BASE_DAMAGE BASE_STRIKES TYPE DEFT DEXTERITY MAGIC STRENGTH NAME BUY SELL SKILL1 SKILL2 SKILL_1 SKILL_2 TIER WEILD CAPACITY HANDINESS CLASS CLASS_DES

			[{VAR}]
				damage_base={BASE_DAMAGE}
				strikes_base={BASE_STRIKES}
				damage_type={TYPE}
#				range={RANGE}
#				variation={VARIATION}
				deft={DEFT}
				dexterity={DEXTERITY}
				magic={MAGIC}
				strength={STRENGTH}
				name={NAME}
				buy={BUY}
				sell={SELL}
				requirement1=$la_weapons.{CLASS}.requirement1.name
				requirement2=$la_weapons.{CLASS}.requirement2.name
				[requirement1]
					des=$la_weapons.{CLASS}.requirement1.des
				[/requirement1]
				[requirement2]
					des=$la_weapons.{CLASS}.requirement2.des
				[/requirement2]
				image=attacks/{IMAGE}.png
				tier={TIER}
				weild={WEILD}
				capacity={CAPACITY}
				handiness={HANDINESS}
				id={VAR}
				class={CLASS}
				[class]
					des={CLASS_DES}
				[/class]
			[/{VAR}]
			#{SKILL1}
			#{SKILL2}
			#{SKILL_1}
			#{SKILL_2}
#enddef
Next I create the actual weapon variables (this is created at the start or prestart event of the scenario):

Code: Select all

	[set_variables]
	name="la_weapon_data"
	[literal]
		[la_weapons]
			{LA_WEAPON_SET_VARIABLES_WEAPONS test_weapon_1 "spear" 5 2 pierce 1 1 1 1 "Tier 1 Test Weapon (Spear)" 20 10 strength.level none "strength" "none" 5 1 1 "One-Handed" mechanical_ranged "Mechanical Ranged"}
			{LA_WEAPON_SET_VARIABLES_WEAPONS test_weapon_2 "pike" 10 2 pierce 1 1 1 1 "Tier 2 Test Weapon (Pike)" 20 10 strength.level none "strength" "none" 5 1 1 "One-Handed" mechanical_ranged "Mechanical Ranged"}
		[/la_weapons]
	[/literal]
	[/set_variables]
Finally i create the option itself:

Code: Select all

#NEW TESTING FOREACH OPTION MODE. All of the variables have been set above, so now its just learning how to make use of this instead.
#define LA_DISPLAY_ITEM_OPTION_FOREACH
[foreach]
array=la_weapons
[do]
	[if]
		{VARIABLE_CONDITIONAL la_inventory[$side_number].$this_item.id greater_than_equal_to 1}
#		{VARIABLE_CONDITIONAL this_item.id equals 1}
		[then]
			[message]
				[option]
					label="equip weapon"
					image=$this_item.image
					[command]
						[message]
							message="good ole weapon :)"
						[/message]
					[/command]
				[/option]
			[/message]
		[/then]
	[/if]
[/do]
[/foreach]
#{CLEAR_VARIABLE la_weapons}
#enddef

	[message]
	speaker=narrator
	message= _ {LA_HERO_INVENTORY_STATS_MESSAGE}
	{LA_OPTION_IMAGE "Back" "icons/check.png" ({VARIABLE finished.weapons.ranged yes})}
{LA_DISPLAY_ITEM_OPTION_FOREACH}
	[/message]
now ive already put the code into play and the options are not appearing :/
the options should be appearing below, but it only has the back option.
wesnoth_test.PNG
The variables are set as shown below: the items are in the player's inventory variables as shown below so the variables should technically be working I believe.
wesnoth_foreach_not_showing_up.PNG
How come it isn't showing up?
Last edited by LordAwsomeness on March 12th, 2020, 8:10 pm, edited 1 time in total.
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA

User avatar
LordAwsomeness
Posts: 189
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by LordAwsomeness »

Ravana wrote:
March 12th, 2020, 7:09 pm
The version on addon server does not load, I had to define some macros to analyze it.
The Version on the addons server is dependent on the mother addon. I removed the mother addon last night because I didn't want anybody to download the version 0.3.5a. I needed to get somebody to send me a copy of the working version 0.3.4a before they downloaded and lost copies of it forever so I just removed my addon altogether for the moment. I couldn't risk losing the working version until I had an archived copy.

And by working, I dont mean that version 0.3.5a was broken as it could still be ran as a local game, however it couldn't be run on the multiplayer servers so that's why I needed the previous version 0.3.4a because it still worked with multiplayer, but I forgot to archive it. :doh:
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA

User avatar
Pentarctagon
Forum Administrator
Posts: 4248
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by Pentarctagon »

Running:

Code: Select all

#define LA_WEAPON_SET_VARIABLES_WEAPONS VAR IMAGE BASE_DAMAGE BASE_STRIKES TYPE DEFT DEXTERITY MAGIC STRENGTH NAME BUY SELL SKILL1 SKILL2 SKILL_1 SKILL_2 TIER WEILD CAPACITY HANDINESS CLASS CLASS_DES
[{VAR}]
  damage_base={BASE_DAMAGE}
  strikes_base={BASE_STRIKES}
  damage_type={TYPE}
  #				range={RANGE}
  #				variation={VARIATION}
  deft={DEFT}
  dexterity={DEXTERITY}
  magic={MAGIC}
  strength={STRENGTH}
  name={NAME}
  buy={BUY}
  sell={SELL}
  requirement1=$la_weapons.{CLASS}.requirement1.name
  requirement2=$la_weapons.{CLASS}.requirement2.name
  [requirement1]
    des=$la_weapons.{CLASS}.requirement1.des
  [/requirement1]
  [requirement2]
    des=$la_weapons.{CLASS}.requirement2.des
  [/requirement2]
  image=attacks/{IMAGE}.png
  tier={TIER}
  weild={WEILD}
  capacity={CAPACITY}
  handiness={HANDINESS}
  id={VAR}
  class={CLASS}
  [class]
    des={CLASS_DES}
  [/class]
[/{VAR}]
#{SKILL1}
#{SKILL2}
#{SKILL_1}
#{SKILL_2}
#enddef

[modification]
  id=testmod
  name="testmod"
  description=""

    [event]
      name="start"
      
	    [set_variables]
	      name="la_weapon_data"
	      [literal]
		      [la_weapons]
			      {LA_WEAPON_SET_VARIABLES_WEAPONS test_weapon_1 "spear" 5 2 pierce 1 1 1 1 "Tier 1 Test Weapon (Spear)" 20 10 strength.level none "strength" "none" 5 1 1 "One-Handed" mechanical_ranged "Mechanical Ranged"}
			      {LA_WEAPON_SET_VARIABLES_WEAPONS test_weapon_2 "pike" 10 2 pierce 1 1 1 1 "Tier 2 Test Weapon (Pike)" 20 10 strength.level none "strength" "none" 5 1 1 "One-Handed" mechanical_ranged "Mechanical Ranged"}
		      [/la_weapons]
	      [/literal]
	    [/set_variables]
    [/event]

[/modification]
Results in:

Code: Select all

[la_weapons]
	[test_weapon_1]
		buy=20
		capacity=1
		class="mechanical_ranged"
		damage_base=5
		damage_type="pierce"
		deft=1
		dexterity=1
		handiness="One-Handed"
		id="test_weapon_1"
		image="attacks/spear.png"
		magic=1
		name="Tier 1 Test Weapon (Spear)"
		requirement1="$la_weapons.mechanical_ranged.requirement1.name"
		requirement2="$la_weapons.mechanical_ranged.requirement2.name"
		sell=10
		strength=1
		strikes_base=2
		tier=5
		weild=1
		[requirement1]
			des="$la_weapons.mechanical_ranged.requirement1.des"
		[/requirement1]
		[requirement2]
			des="$la_weapons.mechanical_ranged.requirement2.des"
		[/requirement2]
		[class]
			des="Mechanical Ranged"
		[/class]
	[/test_weapon_1]
	[test_weapon_2]
		buy=20
		capacity=1
		class="mechanical_ranged"
		damage_base=10
		damage_type="pierce"
		deft=1
		dexterity=1
		handiness="One-Handed"
		id="test_weapon_2"
		image="attacks/pike.png"
		magic=1
		name="Tier 2 Test Weapon (Pike)"
		requirement1="$la_weapons.mechanical_ranged.requirement1.name"
		requirement2="$la_weapons.mechanical_ranged.requirement2.name"
		sell=10
		strength=1
		strikes_base=2
		tier=5
		weild=1
		[requirement1]
			des="$la_weapons.mechanical_ranged.requirement1.des"
		[/requirement1]
		[requirement2]
			des="$la_weapons.mechanical_ranged.requirement2.des"
		[/requirement2]
		[class]
			des="Mechanical Ranged"
		[/class]
	[/test_weapon_2]
[/la_weapons]
So I expect you'd want [value] rather than [literal], if nothing else. Otherwise I'd guess that problem is happening elsewhere in your code, seeing as the la_weapon_data variable doesn't appear anywhere in the code you provided for where the options are created.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

User avatar
LordAwsomeness
Posts: 189
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by LordAwsomeness »

Pentarctagon wrote:
March 12th, 2020, 8:16 pm
So I expect you'd want [value] rather than [literal], if nothing else. Otherwise I'd guess that problem is happening elsewhere in your code, seeing as the la_weapon_data variable doesn't appear anywhere in the code you provided for where the options are created.
Hmm I made some changes while you were probably responding, however it only shows this one option while it should be showing 2 :hmm:
wesnoth_showing_one_option.PNG
here is the current code that is at least displaying one of the options:

Code: Select all


#define LA_DISPLAY_ITEM_OPTION_FOREACH
[foreach]
array=la_weapon_data.la_weapons
[do]
#	[if]
#		{VARIABLE_CONDITIONAL la_inventory[$side_number].$this_item.id greater_than_equal_to 1}
#		{VARIABLE_CONDITIONAL this_item.id equals 1} 
		{VARIABLE_CONDITIONAL LA_RPG_Era equals yes}
		[then]
			[message]
				[option]
					label="equip weapon"
					image=$this_item.image
					[command]
						[message]
							message="good ole weapon :)"
						[/message]
					[/command]
				[/option]
			[/message]
		[/then]
#	[/if]
[/do]
[/foreach]
#{CLEAR_VARIABLE la_weapons}
#enddef
All i changed was the [message] coming before the [foreach] and made it come after instead. however I figured the way it works is it fetches all of the variables that fall under the 'array=la_weapon_data.la_weapons'. I must be misunderstanding something about how it works.
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA

gfgtdf
Developer
Posts: 1260
Joined: February 10th, 2013, 2:25 pm

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by gfgtdf »

LordAwsomeness wrote:
March 12th, 2020, 6:15 pm
Thank you so much for giving me literal examples with an explanation! This is by far the easiest way for me to learn so I genuinely appreciate it!
Im trying to study lua and it doesn't make too much sense to be completely honest. how would I make code that is similar to what you did above in lua?
Also how would I make the code above have multiple variables that need to be met rather than just race? say it needs the this_unit's race, level, and something else like another variable that isn't directly tied to the individual unit itself?
would it simply be:

Code: Select all

[foreach]
array=race_data.race
[do]
	[if]
		[variable]
			name="$this_item.id"
			equals="$unit.race"
		[/variable]
		[variable]
			name="$unit.level"
			equals="2"
		[/variable]
		[variable]
			name="$dog_has_been_walked"
			equals="yes"
		[/variable]
		[then]
			[message]
I don't know, it really depends on your code, best is to learn what all these tags (foreach, if, inset_tag) etc do exactly and figure this out yourself. As i said before: the approach with the [message] insde the [foreach] was specific to the example code i wrote above, for you addon you will have to figure out what to do, and if you don't want to use lua you probably have to to use [insert_tag] at some point.
LordAwsomeness wrote:
March 12th, 2020, 6:15 pm
Also would I still be able to use pango markup language tools in this (referring to <span color='#00ffcc'> Text in that color </span>')
yes
LordAwsomeness wrote:
March 12th, 2020, 6:15 pm
EDIT: also would using [set_variables] be better than using:

Code: Select all

	{VARIABLE la_hero[$side_number].magic.runic.aura1.cooldown 0}
	{VARIABLE la_hero[$side_number].magic.runic.aura1.cooldown.max 6}
	{VARIABLE la_hero[$side_number].magic.runic.aura1.cost 8}
	{VARIABLE la_hero[$side_number].magic.runic.aura2.cooldown 0}
	{VARIABLE la_hero[$side_number].magic.runic.aura2.cooldown.max 6}
	{VARIABLE la_hero[$side_number].magic.runic.aura2.cost 8}
	{VARIABLE la_hero[$side_number].magic.runic.aura3.cooldown 0}
	{VARIABLE la_hero[$side_number].magic.runic.aura3.cooldown.max 6}
	{VARIABLE la_hero[$side_number].magic.runic.aura3.cost 8}
	{VARIABLE la_hero[$side_number].magic.runic.aura4.cooldown 0}
	{VARIABLE la_hero[$side_number].magic.runic.aura4.cooldown.max 6}
	{VARIABLE la_hero[$side_number].magic.runic.aura4.cost 8}
	{VARIABLE la_hero[$side_number].magic.runic.forge1.cooldown 0}
	{VARIABLE la_hero[$side_number].magic.runic.forge1.cooldown.max 4}
	{VARIABLE la_hero[$side_number].magic.runic.forge1.cost 5}
	{VARIABLE la_hero[$side_number].magic.runic.forge2.cooldown 0}
	{VARIABLE la_hero[$side_number].magic.runic.forge2.cooldown.max 4}
	{VARIABLE la_hero[$side_number].magic.runic.forge2.cost 5}
	{VARIABLE la_hero[$side_number].magic.runic.forge3.cooldown 0}
	{VARIABLE la_hero[$side_number].magic.runic.forge3.cooldown.max 4}
	{VARIABLE la_hero[$side_number].magic.runic.forge3.cost 5}
	{VARIABLE la_hero[$side_number].magic.runic.forge4.cooldown 0}
	{VARIABLE la_hero[$side_number].magic.runic.forge4.cooldown.max 4}
	{VARIABLE la_hero[$side_number].magic.runic.forge4.cost 5}
	{VARIABLE la_hero[$side_number].magic.runic.thornmail.cost 4}
	{VARIABLE la_hero[$side_number].magic.runic.thornmail.cooldown 0}
	{VARIABLE la_hero[$side_number].magic.runic.thornmail.cooldown.max 4}
I know they both have the same end result but I just want to know if its better to do it one way or another (like does [set_variables] have less of a negative impact than {VARIABLE}?)
While using [set_variables here wouldn't give you a noticable speed improvement, i still think it makes your code a bit easier to read. But suhc things are always a bit of personal preference.


Also i wouldnt use cooldown as both the naem of a wml node and an attribute (meaing ot using cooldown.max and a name when cooldown is already set as a number)
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

User avatar
LordAwsomeness
Posts: 189
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by LordAwsomeness »

gfgtdf wrote:
March 12th, 2020, 8:35 pm
Also i wouldnt use cooldown as both the naem of a wml node and an attribute (meaing ot using cooldown.max and a name when cooldown is already set as a number)
Simply for organization issues?

Also I tried swapping out [literal] for [value] instead and it gave me this:
<Invalid WML found> [variable] not supported
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA

gfgtdf
Developer
Posts: 1260
Joined: February 10th, 2013, 2:25 pm

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by gfgtdf »

LordAwsomeness wrote:
March 12th, 2020, 8:43 pm
Simply for organization issues?
because it might cause problems, some parts of the wesnoth might assume that you don't do this and give errors later.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

User avatar
LordAwsomeness
Posts: 189
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by LordAwsomeness »

gfgtdf wrote:
March 12th, 2020, 8:51 pm

because it might cause problems, some parts of the wesnoth might assume that you don't do this and give errors later.

gotcha. also whats the point of me making this code if I have to create individual [option]'s for each weapon all over again. I thought that the way this method worked is the foreach creates an option for each of the arrays under that variable? How is this method actually supposed to work?
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA

gfgtdf
Developer
Posts: 1260
Joined: February 10th, 2013, 2:25 pm

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by gfgtdf »

LordAwsomeness wrote:
March 12th, 2020, 8:57 pm
gfgtdf wrote:
March 12th, 2020, 8:51 pm

because it might cause problems, some parts of the wesnoth might assume that you don't do this and give errors later.

gotcha. also whats the point of me making this code if I have to create individual [option]'s for each weapon all over again. I thought that the way this method worked is the foreach creates an option for each of the arrays under that variable? How is this method actually supposed to work?
Okay, ... as i said before it really depends on your addon and on what exactly you want to do but the general template looks like this:

you use [insert_tag]:

Code: Select all

Step1 define your data:
[set_variables]
name=data
[value]
	## THIS PART MUST BE SMALL, YOU CAN USE MACROS BUT KEEP IT TO THE "RAW DATA"
	whaeever
[/value]
[/set_variables]

Step2: generate the options: wml code, no macros, convert the "data" list to the "option_list" which contains what the [option]s should contain, filter out item not shown.
[foreach]
array=data
[do]
	... [if], [then][convert] [whaeever]
	[set_variable]
		mode=append
		name=option_list
		[value]
			label= "Eqqip" + "$this_item.name" + "To the unit"
			image="whatever"
			[command]
				more wml code
			[/command]
		[/value]
	[/set_variable]
[/do]
[/foreach]
Step3: show the message, again no macros
[message]
	label="fancy message"
	[insert_tag]
		name=option
		variable=option_list
	[/insert_tag]
[/message]
Step4: dont forget to clena the variables otherwise you'll end up with big data in savefiles instead
{CLEAR_VARIABLE option_list}
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

User avatar
Pentarctagon
Forum Administrator
Posts: 4248
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by Pentarctagon »

LordAwsomeness wrote:
March 12th, 2020, 8:32 pm
Pentarctagon wrote:
March 12th, 2020, 8:16 pm
So I expect you'd want [value] rather than [literal], if nothing else. Otherwise I'd guess that problem is happening elsewhere in your code, seeing as the la_weapon_data variable doesn't appear anywhere in the code you provided for where the options are created.
Hmm I made some changes while you were probably responding, however it only shows this one option while it should be showing 2 :hmm:
wesnoth_showing_one_option.PNG

here is the current code that is at least displaying one of the options:

Code: Select all


#define LA_DISPLAY_ITEM_OPTION_FOREACH
[foreach]
array=la_weapon_data.la_weapons
[do]
#	[if]
#		{VARIABLE_CONDITIONAL la_inventory[$side_number].$this_item.id greater_than_equal_to 1}
#		{VARIABLE_CONDITIONAL this_item.id equals 1} 
		{VARIABLE_CONDITIONAL LA_RPG_Era equals yes}
		[then]
			[message]
				[option]
					label="equip weapon"
					image=$this_item.image
					[command]
						[message]
							message="good ole weapon :)"
						[/message]
					[/command]
				[/option]
			[/message]
		[/then]
#	[/if]
[/do]
[/foreach]
#{CLEAR_VARIABLE la_weapons}
#enddef
All i changed was the [message] coming before the [foreach] and made it come after instead. however I figured the way it works is it fetches all of the variables that fall under the 'array=la_weapon_data.la_weapons'. I must be misunderstanding something about how it works.
Displaying one option at a time is what I'd expect - for each element the [foreach] goes through, there's only a single [option] under the first [message] tag.

edit-
Perhaps you want something more like this?
(untested)

Code: Select all

[foreach]
    array=la_weapon_data.la_weapons
    [do]
        [set_variables]
            name=options_example
            mode=append
            [value]
                label="equip weapon"
                image=$this_item.image
                [command]
                    [message]
                        message="good ole weapon :)"
                    [/message]
                [/command]
            [/value]
        [/set_variables]
    [/do]
[/foreach]

[message]
    [insert_tag]
        name=option
        variable=options_example
    [/insert_tag]
[/message]
{CLEAR_VARIABLE options_example}
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

User avatar
LordAwsomeness
Posts: 189
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by LordAwsomeness »

gfgtdf wrote:
March 12th, 2020, 9:11 pm
LordAwsomeness wrote:
March 12th, 2020, 8:57 pm
gfgtdf wrote:
March 12th, 2020, 8:51 pm

because it might cause problems, some parts of the wesnoth might assume that you don't do this and give errors later.

gotcha. also whats the point of me making this code if I have to create individual [option]'s for each weapon all over again. I thought that the way this method worked is the foreach creates an option for each of the arrays under that variable? How is this method actually supposed to work?
Okay, ... as i said before it really depends on your addon and on what exactly you want to do but the general template looks like this:

you use [insert_tag]:

Code: Select all

Step1 define your data:
[set_variables]
name=data
[value]
	## THIS PART MUST BE SMALL, YOU CAN USE MACROS BUT KEEP IT TO THE "RAW DATA"
	whaeever
[/value]
[/set_variables]

Step2: generate the options: wml code, no macros, convert the "data" list to the "option_list" which contains what the [option]s should contain, filter out item not shown.
[foreach]
array=data
[do]
	... [if], [then][convert] [whaeever]
	[set_variable]
		mode=append
		name=option_list
		[value]
			label= "Eqqip" + "$this_item.name" + "To the unit"
			image="whatever"
			[command]
				more wml code
			[/command]
		[/value]
	[/set_variable]
[/do]
[/foreach]
Step3: show the message, again no macros
[message]
	label="fancy message"
	[insert_tag]
		name=option
		variable=option_list
	[/insert_tag]
[/message]
Step4: dont forget to clena the variables otherwise you'll end up with big data in savefiles instead
{CLEAR_VARIABLE option_list}
There's a little issue im running into when I try and do it this way (even though I believe this will be the right way to do it):
unless I do [foreach] array=la_weapon_data.la_weapons.test_weapon_1 then it wont read a weapon as $this_item, meaning that if I try and do this:

Code: Select all

			[message]
				[option]
					label="equip $this_item.name"
					image=$this_item.image
					[command]
						[message]
							message="good ole weapon :)"
						[/message]
					[/command]
				[/option]
			[/message]
it keeps showing up like this in game:

Code: Select all

			[message]
				[option]
					label="equip"
					image=(doesn't show any image since it doesn't read $this_item)
					[command]
						[message]
							message="good ole weapon :)"
						[/message]
					[/command]
				[/option]
			[/message]
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA

User avatar
LordAwsomeness
Posts: 189
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by LordAwsomeness »

Pentarctagon wrote:
March 12th, 2020, 9:33 pm
LordAwsomeness wrote:
March 12th, 2020, 8:32 pm
Pentarctagon wrote:
March 12th, 2020, 8:16 pm
So I expect you'd want [value] rather than [literal], if nothing else. Otherwise I'd guess that problem is happening elsewhere in your code, seeing as the la_weapon_data variable doesn't appear anywhere in the code you provided for where the options are created.
Hmm I made some changes while you were probably responding, however it only shows this one option while it should be showing 2 :hmm:
wesnoth_showing_one_option.PNG

here is the current code that is at least displaying one of the options:

Code: Select all


#define LA_DISPLAY_ITEM_OPTION_FOREACH
[foreach]
array=la_weapon_data.la_weapons
[do]
#	[if]
#		{VARIABLE_CONDITIONAL la_inventory[$side_number].$this_item.id greater_than_equal_to 1}
#		{VARIABLE_CONDITIONAL this_item.id equals 1} 
		{VARIABLE_CONDITIONAL LA_RPG_Era equals yes}
		[then]
			[message]
				[option]
					label="equip weapon"
					image=$this_item.image
					[command]
						[message]
							message="good ole weapon :)"
						[/message]
					[/command]
				[/option]
			[/message]
		[/then]
#	[/if]
[/do]
[/foreach]
#{CLEAR_VARIABLE la_weapons}
#enddef
All i changed was the [message] coming before the [foreach] and made it come after instead. however I figured the way it works is it fetches all of the variables that fall under the 'array=la_weapon_data.la_weapons'. I must be misunderstanding something about how it works.
Displaying one option at a time is what I'd expect - for each element the [foreach] goes through, there's only a single [option] under the first [message] tag.

edit-
Perhaps you want something more like this?
(untested)

Code: Select all

[foreach]
    array=la_weapon_data.la_weapons
    [do]
        [set_variables]
            name=options_example
            mode=append
            [value]
                label="equip weapon"
                image=$this_item.image
                [command]
                    [message]
                        message="good ole weapon :)"
                    [/message]
                [/command]
            [/value]
        [/set_variables]
    [/do]
[/foreach]

[message]
    [insert_tag]
        name=option
        variable=options_example
    [/insert_tag]
[/message]
{CLEAR_VARIABLE options_example}
This is great! Thank you both so much! I think were on the idea that I was thinking of now. Because the whole purpose of doing this is to shrink the amount of work the preprocessor has to do so that the multiplayer servers allow for my addon to be played so that people can play together. Im assuming this code is on the verge of creating options for each of the variables that I create. and just a refresher, this is the variable code im working with from the start event:

Code: Select all

	[set_variables]
	name="la_weapon_data"
	[value]
		[la_weapons]
			{LA_WEAPON_SET_VARIABLES_WEAPONS test_weapon_1 "spear" 5 2 pierce 1 1 1 1 "Tier 1 Test Weapon (Spear)" 20 10 strength.level none "strength" "none" 5 1 1 "One-Handed" mechanical_ranged "Mechanical Ranged"}
			{LA_WEAPON_SET_VARIABLES_WEAPONS test_weapon_2 "pike" 10 2 pierce 1 1 1 1 "Tier 2 Test Weapon (Pike)" 20 10 strength.level none "strength" "none" 5 1 1 "One-Handed" mechanical_ranged "Mechanical Ranged"}
		[/la_weapons]
	[/value]
	[/set_variables]
	
	
#define LA_WEAPON_SET_VARIABLES_WEAPONS VAR IMAGE BASE_DAMAGE BASE_STRIKES TYPE DEFT DEXTERITY MAGIC STRENGTH NAME BUY SELL SKILL1 SKILL2 SKILL_1 SKILL_2 TIER WEILD CAPACITY HANDINESS CLASS CLASS_DES

			[{VAR}]
				damage_base={BASE_DAMAGE}
				strikes_base={BASE_STRIKES}
				damage_type={TYPE}
#				range={RANGE}
#				variation={VARIATION}
				deft={DEFT}
				dexterity={DEXTERITY}
				magic={MAGIC}
				strength={STRENGTH}
				name={NAME}
				buy={BUY}
				sell={SELL}
				requirement1=$la_weapons.{CLASS}.requirement1.name
				requirement2=$la_weapons.{CLASS}.requirement2.name
				[requirement1]
					des=$la_weapons.{CLASS}.requirement1.des
				[/requirement1]
				[requirement2]
					des=$la_weapons.{CLASS}.requirement2.des
				[/requirement2]
				image=attacks/{IMAGE}.png
				tier={TIER}
				weild={WEILD}
				capacity={CAPACITY}
				handiness={HANDINESS}
				id={VAR}
				class={CLASS}
				[class]
					des={CLASS_DES}
				[/class]
			[/{VAR}]
			#{SKILL1}
			#{SKILL2}
			#{SKILL_1}
			#{SKILL_2}
#enddef
Essentially im trying to convert this code below into a code that doesn't have to be repeated so many times by macros because this was the major issue I was dealing with that caused preprocessor overloads: (NOTE: this code was 16 options long, I have condensed it to 1 option just to give an example. In my code I use this macro that had 16 options for EACH weapon and my addon utilizes around 40 unique weapons x 5 because there are 5 tiers of every weapon = a total of 200 weapons x 16 = 3200 options that the preprocessor had to go through on just these alone.) (that doesn't even include all of the other macros that I used this similar format with). With the preprocessor issues I trimmed it down from 16 options to the bare minimum of 3 options that are actually needed to make the equip and unequip functions work properly. Let me restate because this is so long winded: the objective is to create a new option format that changes everything to load off of variables so that there are only the 16 options, not the 3200 options that I continuously replicate through macros. I hope that clarifies what my goal is because I know that I can sometimes be vague with how I state what my objective is :doh:

Code: Select all

#define LA_DISPLAY_ITEM_OPTION IMAGE ITEM_VARIABLE MINIMUM_ITEM_COUNT TYPE RANGE VARIATION

#first: has and can equip
#todo: make the item show up differently if it is already equipped
#{IMAGE}

{LA_OPTION_IMAGE_SHOW_IF $la_weapons.{ITEM_VARIABLE}.image "($la_inventory[$side_number].{ITEM_VARIABLE})     <span color='#00FF00' weight='bold'>$la_weapons.{ITEM_VARIABLE}.name $la_weapons.{ITEM_VARIABLE}.damage_base-$la_weapons.{ITEM_VARIABLE}.strikes_base ($la_weapons.{ITEM_VARIABLE}.damage_type)</span>
<span size='xx-small'>Weapon Class: $la_weapons.{ITEM_VARIABLE}.class.des</span>
<span color='#808080' size='xx-small'>DEFTNESS: $la_hero[$side_number].deft.level/$la_weapons.{ITEM_VARIABLE}.deft </span>
<span color='#808080' size='xx-small'>DEXTERITY: $la_hero[$side_number].dexterity.level/$la_weapons.{ITEM_VARIABLE}.dexterity </span>
<span color='#808080' size='xx-small'>MAGIC: $la_hero[$side_number].magic.level/$la_weapons.{ITEM_VARIABLE}.magic </span>
<span color='#808080' size='xx-small'>STRENGTH: $la_hero[$side_number].strength.level/$la_weapons.{ITEM_VARIABLE}.strength </span>" (
[not]
{VARIABLE_CONDITIONAL la_inventory[$side_number].equipped_{RANGE} equals {ITEM_VARIABLE}}
[/not]
{VARIABLE_CONDITIONAL la_inventory[$side_number].{ITEM_VARIABLE} greater_than_equal_to {MINIMUM_ITEM_COUNT}}
{VARIABLE_CONDITIONAL la_hero[$side_number].deft.level greater_than_equal_to $la_weapons.{ITEM_VARIABLE}.deft}
{VARIABLE_CONDITIONAL la_hero[$side_number].dexterity.level greater_than_equal_to $la_weapons.{ITEM_VARIABLE}.dexterity}
{VARIABLE_CONDITIONAL la_hero[$side_number].magic.level greater_than_equal_to $la_weapons.{ITEM_VARIABLE}.magic}
{VARIABLE_CONDITIONAL la_hero[$side_number].strength.level greater_than_equal_to $la_weapons.{ITEM_VARIABLE}.strength}
) ({LA_WEAPON_MATH {ITEM_VARIABLE} $la_weapons.{ITEM_VARIABLE}.skill1 la_weapons.{ITEM_VARIABLE}.skill2}
{VARIABLE la_inventory[$side_number].equipped_{RANGE} {ITEM_VARIABLE}}
{LA_EQUIP_ITEM $la_weapons.{ITEM_VARIABLE}.id ($la_weapons.{ITEM_VARIABLE}.name) ($la_weapons.{ITEM_VARIABLE}.image) $la_weapons.{ITEM_VARIABLE}.damage_type {RANGE} $la_weapons[$side_number].{ITEM_VARIABLE}.damage $la_weapons[$side_number].{ITEM_VARIABLE}.strikes {VARIATION}}
)}

note that this code has adapted and changed a lot over the last year and a half so there will be a couple of things that are #commented because I dont need them anymore since I defined them in the weapon variables (such as the {IMAGE}) but I had so many macros relying on it that I didn't want to change it yet.
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA

User avatar
LordAwsomeness
Posts: 189
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by LordAwsomeness »

I surrender. I cant do this in wml. Im attempting to learn Lua and its actually making a small amount of sense for once. I just fiddled around with

Code: Select all

function wml_actions.narrate(cfg)
	local cfg = cfg.__literal
	cfg.speaker = "narrator"
	if not cfg.image then cfg.image = "wesnoth-icon.png" end
	wml_actions.message( cfg )
end
and made a dumb little thing:

Code: Select all

function wml_actions.player1(cfg)
	local cfg = cfg.__literal
	cfg.canrecruit = "yes"
	cfg.side = "1"
	if not cfg.image then cfg.image = "wesnoth-icon.png" end
	wml_actions.message( cfg )
end
just to figure out how things work a bit.
I want to make my options and macros in lua and fix my code once and for all. Could one of you get me started with a sample of lua showing me how to make an option that checks for show_if conditions have been met? I want to do this right, and I learn quickest by punching in somebody elses code, seeing how it works, and then modifying it until I have what I want. Thank you both so much for all of your help up to this point, im so sorry if ive been frustrating to work with due to my lack of knowledge on some aspects of wml and coding in general. I really appreciate all of the help you both have given me today :)
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA

User avatar
Ravana
Forum Moderator
Posts: 2380
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Connection failed:An existing connection was forcibly closed by the remote host

Post by Ravana »

Instead of show_if, it is generally possible to use normal if - to not insert the options into message if condition is not true.

I do not currently have any good examples, but this is somewhat fitting. https://github.com/ProditorMagnus/Agele ... s.lua#L142 If it would be inside function/wml_action, then the line could be for example

Code: Select all

-- local T = wml.tag -- I use such shortcut
if cfg.something then 
    table.insert(message, T.option{
        --option content
    })
end

Post Reply