items not displayed in linux

The place to post your WML questions and answers.

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.
Post Reply
Mabuse
Posts: 2239
Joined: November 6th, 2007, 1:38 pm

items not displayed in linux

Post by Mabuse »

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:
-------------

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.
User avatar
Iris
Site Administrator
Posts: 6798
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: items not displayed in linux

Post by Iris »

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.
Mabuse
Posts: 2239
Joined: November 6th, 2007, 1:38 pm

Re: items not displayed in linux

Post by Mabuse »

thank you for your answer :)
The best bet is your own, good Taste.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: items not displayed in linux

Post by ChaosRider »

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.
Groggy_Dice
Inactive Developer
Posts: 165
Joined: February 4th, 2011, 6:19 am
Contact:

Re: items not displayed in linux

Post by Groggy_Dice »

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)
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: items not displayed in linux

Post by Anonymissimus »

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.
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...)
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 startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Post Reply