Szturmowiec and his struggles with WML

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.
User avatar
Szturmowiec
Posts: 44
Joined: June 5th, 2017, 6:06 pm

Szturmowiec and his struggles with WML

Post by Szturmowiec »

Hello everyone,

Here's my thread describing all my problems faced while making my own scenarios.
The first question is: how can I trigger something (like displaying a message), when a particular map tile is discovered from the shroud?
That was the hell of a firefight. And the ammunition depleted so fast... I'm pinned down by those damned machine guns and don't know what to do next.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Szturmowiec and his struggles with WML

Post by zookeeper »

I think this ought to do it (untested):

Code: Select all

[event]
    name=enter_hex

    [filter]
        side=1
    [/filter]

    [filter_condition]
        [have_location]
            x,y=8,9
            [filter_vision]
                side=1
            [/filter_vision]
        [/have_location]
    [/filter_condition]

    [message]
        ...
    [/message]
[/event]
The [filter] block is there simply as an optimization; the visibility check is a bit heavy to perform on every hex of every move, so better to first limit the event to side 1 units only (or whatever you need).
User avatar
Szturmowiec
Posts: 44
Joined: June 5th, 2017, 6:06 pm

Re: Szturmowiec and his struggles with WML

Post by Szturmowiec »

Wow, it works, thank you so much for such a quick reply! :D
But that was not the end... It was just a beginning...
My next question is: in my scenario I'm using shroud and fog. The problem is that when something gest cowered by the fog after my units have left the area, a few tiles under the fog don't display correctly - there's a message "Image not found". Can someone explain to me what are the possible causes of this?
That was the hell of a firefight. And the ammunition depleted so fast... I'm pinned down by those damned machine guns and don't know what to do next.
Tad_Carlucci
Inactive Developer
Posts: 503
Joined: April 24th, 2016, 4:18 pm

Re: Szturmowiec and his struggles with WML

Post by Tad_Carlucci »

Might be able to optimize a bit further if you know the general area where side 1 might be moving. For example, if side 1 starts in the top-left corner and the target tile is in the bottom-right, you might filter for movement into a hex in the lower-right area on the assumption that no move in the other areas could possibly expose the hex you're interested in.
I forked real life and now I'm getting merge conflicts.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Szturmowiec and his struggles with WML

Post by zookeeper »

Szturmowiec wrote:My next question is: in my scenario I'm using shroud and fog. The problem is that when something gest cowered by the fog after my units have left the area, a few tiles under the fog don't display correctly - there's a message "Image not found". Can someone explain to me what are the possible causes of this?
No idea whatsoever. Doesn't make any sense the way you described it.
User avatar
Szturmowiec
Posts: 44
Joined: June 5th, 2017, 6:06 pm

Re: Szturmowiec and his struggles with WML

Post by Szturmowiec »

Well, I guess it's not actual anymore... I've just opened my scenario once more and the problem disappeared... Strange...
That was the hell of a firefight. And the ammunition depleted so fast... I'm pinned down by those damned machine guns and don't know what to do next.
User avatar
Szturmowiec
Posts: 44
Joined: June 5th, 2017, 6:06 pm

Re: Szturmowiec and his struggles with WML

Post by Szturmowiec »

Here comes another problem...
Could someone explain why this code:

Code: Select all

#ifdef EASY
		[gold]
			side=1
			amount=200
		[/gold]
#endif
#ifdef MEDIUM
		[gold]
			side=1
			amount=180
		[/gold]
#endif
#ifdef HARD
		[gold]
			side=1
			amount=160
		[/gold]
#endif
Sometimes work, but sometimes doesn't? Also in the other scenario I've got something very similar:

Code: Select all

[event]
		name=side 1 turn 18
#ifdef EASY
		[gold]
			side=4,5
			amount=200
		[/gold]
#endif
#ifdef MEDIUM
		[gold]
			side=4,5
			amount=220
		[/gold]
#endif
#ifdef HARD
		[gold]
			side=4,5
			amount=250
		[/gold]
#endif
	[/event]
And it refuses to work at all. The gold is simply not added. Why?
That was the hell of a firefight. And the ammunition depleted so fast... I'm pinned down by those damned machine guns and don't know what to do next.
User avatar
skeptical_troll
Posts: 498
Joined: August 31st, 2015, 11:06 pm

Re: Szturmowiec and his struggles with WML

Post by skeptical_troll »

one reason could be that typically difficulty levels are EASY,NORMAL,HARD, there is no 'MEDIUM'. So I'm not surprised if it doesn't work in that case.
User avatar
Szturmowiec
Posts: 44
Joined: June 5th, 2017, 6:06 pm

Re: Szturmowiec and his struggles with WML

Post by Szturmowiec »

Hm, such a stupid mistake... That would explain a lot...
That was the hell of a firefight. And the ammunition depleted so fast... I'm pinned down by those damned machine guns and don't know what to do next.
User avatar
Heindal
Posts: 1344
Joined: August 11th, 2011, 9:25 pm
Location: Germany, Karlsruhe
Contact:

Re: Szturmowiec and his struggles with WML

Post by Heindal »

As far as I know you can define difficulties in the main.cfg such as "difficulties=EASY,HARD,NIGHTMARE" and so on.
So you might define MEDIUM as well.
The future belongs to those, who believe in the beauty of their dreams.
Developer of: Trapped, Five Fates, Strange Legacy, Epical, UR Epic Era
Dungeonmasters of Wesnoth, Wild Peasants vs Devouring Corpses, Dwarf Dwarfson Dwarvenminer
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Szturmowiec and his struggles with WML

Post by zookeeper »

Heindal wrote:As far as I know you can define difficulties in the main.cfg such as "difficulties=EASY,HARD,NIGHTMARE" and so on.
So you might define MEDIUM as well.
Sure, but if you have to pick between whether you use NORMAL and MEDIUM, then you should choose NORMAL because it's the standard one. Just like you should choose HARD instead of, say, DIFFICULT.
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: Szturmowiec and his struggles with WML

Post by Bitron »

What zookeeper said, plus, keep in mind that they are relative to the actual difficulty.
"Normal" is usually meant as "exactly how the author wants it to be" and easy/hard are variations of that level for players who are not experienced enough or those who find "normal" too easy.
User avatar
Szturmowiec
Posts: 44
Joined: June 5th, 2017, 6:06 pm

Re: Szturmowiec and his struggles with WML

Post by Szturmowiec »

hi everyone,

Just another question. After finishing my exams I wanted to celebrate it via uploading my campaign to 1.13 server, but it doesn't work. I simply copied it from the 1.12 add-ons folder and I can launch it through the game, but in the add-ons section there isn't any button to upload it. Please help.
That was the hell of a firefight. And the ammunition depleted so fast... I'm pinned down by those damned machine guns and don't know what to do next.
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Szturmowiec and his struggles with WML

Post by Pentarctagon »

Szturmowiec wrote:hi everyone,

Just another question. After finishing my exams I wanted to celebrate it via uploading my campaign to 1.13 server, but it doesn't work. I simply copied it from the 1.12 add-ons folder and I can launch it through the game, but in the add-ons section there isn't any button to upload it. Please help.
There should be a shield with a up arrow on it next to your add-on. That will upload it to the add-on server.
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
Szturmowiec
Posts: 44
Joined: June 5th, 2017, 6:06 pm

Re: Szturmowiec and his struggles with WML

Post by Szturmowiec »

Oh yeah, I'm so blind... Just moved into 1.13 (since it was described as better for campaign developers) and expected same separate buttons as in 1.12...
That was the hell of a firefight. And the ammunition depleted so fast... I'm pinned down by those damned machine guns and don't know what to do next.
Post Reply