items not displayed in linux
Moderator: Forum Moderators
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.
items not displayed in linux
ok, i have added this code
all this does is dropping an item/symbol (and setting a variable) on the map.
the code works well in windows.
but a linux-user reported that the items do not get displayed.
linux is case-sensitive, i have checked that beforehand - so everything is right about the directory names and pathes (i guess) and also the files coins3.png, coins4.png and coins5.png
are located at ...images/misc/loot and do exist.
the Code:
-------------
in a newer version i changed the code to:
so i just added some "'s to the path+filename.
well, thats all what i could come up with.
atm, i dont know if the fix was successfull, waiting for feedback
if this fixes it, everything is alright.
if not:
what else wesnoth-related could cause the bug?
all this does is dropping an item/symbol (and setting a variable) on the map.
the code works well in windows.
but a linux-user reported that the items do not get displayed.
linux is case-sensitive, i have checked that beforehand - so everything is right about the directory names and pathes (i guess) and also the files coins3.png, coins4.png and coins5.png
are located at ...images/misc/loot and do exist.
the Code:
-------------
Code: Select all
#define COIN_SELECTION X Y
{RANDOM 1..100}#1-100
[if]
{SXCON random less_than_equal_to 30}
[then]
{RANDOM 3,4,4,5}#3 - 5
[set_variable]
name=coins$random|.{X}|{Y}
value=1
[/set_variable]
[item]
x={X}
y={Y}
image=misc\loot\coins$random|.png
[/item]
[/then]
[/if]
#enddef
in a newer version i changed the code to:
Code: Select all
#define COIN_SELECTION X Y
{RANDOM 1..100}#1-100
[if]
{SXCON random less_than_equal_to 30}
[then]
{RANDOM 3,4,4,5}#3 - 5
[set_variable]
name=coins$random|.{X}|{Y}
value=1
[/set_variable]
[item]
x={X}
y={Y}
image="misc\loot\coins$random|.png"
[/item]
[/then]
[/if]
#enddef
so i just added some "'s to the path+filename.
well, thats all what i could come up with.
atm, i dont know if the fix was successfull, waiting for feedback
if this fixes it, everything is alright.
if not:
what else wesnoth-related could cause the bug?
The best bet is your own, good Taste.
Re: items not displayed in linux
Linux (and every other operating system we support that isn’t Windows, for that matter) uses forward slash ‘/’ as path separator, not backslash ‘\’. The path in your
[item]
tag contains only backslashes. On Windows, both characters are interchangeable and have the same meaning in paths, so if you want to make sure your add-on works for everyone you should stick to forward slashes.Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
- ChaosRider
- Posts: 846
- Joined: April 15th, 2012, 1:15 pm
Re: items not displayed in linux
You could also change random 1-100 to random 1-10 and later less_than_equal_to=30 change to less_than_equal_to=3.
Spoiler:
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
-
- Inactive Developer
- Posts: 165
- Joined: February 4th, 2011, 6:19 am
- Contact:
Re: items not displayed in linux
Just a note: on 1.11, wmllint will turn backslashes to frontslashes in paths (or warn about them, if run in dryrun mode). If you're on 1.10, I did put out a wmllint++ version a long time ago that also did this, but that code was written right after I had gotten started with Python, and badly needs to be updated.
Ports:
Prudence (Josh Roby) | By the Sword (monochromatic) | The Eight of Cembulad (Lintana~ & WYRMY)
Resources:
UMC Timeline (Dec) | List of Unported UMC (Dec) | wmllint++ (Feb)
Prudence (Josh Roby) | By the Sword (monochromatic) | The Eight of Cembulad (Lintana~ & WYRMY)
Resources:
UMC Timeline (Dec) | List of Unported UMC (Dec) | wmllint++ (Feb)
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: items not displayed in linux
Everyone who manages to run wmllint probably knows it anyway. Too bad. (Actually, in order to run wmllint on windows properly I need to pass / in its arguments IIRC...)Groggy_Dice wrote:Just a note: on 1.11, wmllint will turn backslashes to frontslashes in paths (or warn about them, if run in dryrun mode). If you're on 1.10, I did put out a wmllint++ version a long time ago that also did this, but that code was written right after I had gotten started with Python, and badly needs to be updated.
In A Simple Campaign I mention the / vs \ problem however, and also the case sensitivity of non-Windows.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign