[remove_shroud] and [terrain] question
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.
- Paulomat4
- Moderator Emeritus
- Posts: 730
- Joined: October 16th, 2012, 3:32 pm
- Location: Wesmere library, probably summoning Zhangor
Re: Transfer selection from editor to wml
Okay, thank you. That what I'll do then.No, I don't think so. Probably the easiest thing to do is to break your area up into three or four ranges that cover everything with nothing extra. Then use [filter_location] with an [or] statement for each range.
Creator of Dawn of Thunder and Global Unitmarkers
"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
Re: Transfer selection from editor to wml
Why don't you use the editor's "area" feature and filter for the id of the area?
"Wesnoth has many strong points but team and users management are certainly not in them." -- pyrophorus
- Paulomat4
- Moderator Emeritus
- Posts: 730
- Joined: October 16th, 2012, 3:32 pm
- Location: Wesmere library, probably summoning Zhangor
Unexpected characters at line start error
Hello guys,
I haven't run into any unsolvable wml errors for quite some time until recently. I was trying to include the fire elemental from rise of the elementalist, adding the missing unit macros step by step. Unfortunately I'm getting the following error and I'm clueless on what it is supposed to mean.
Unexpected characters at line start
at ~add-ons\\dawn_of_thunder\\units\\elementals\\Fire_Elemental.cfg:19
included from ~add-ons\\dawn_of_thunder\\_main.cfg:53
here's the elementals.cfg file:
I've checked the file but can't find any unexpected character. Any idea someone?
I haven't run into any unsolvable wml errors for quite some time until recently. I was trying to include the fire elemental from rise of the elementalist, adding the missing unit macros step by step. Unfortunately I'm getting the following error and I'm clueless on what it is supposed to mean.
Unexpected characters at line start
at ~add-ons\\dawn_of_thunder\\units\\elementals\\Fire_Elemental.cfg:19
included from ~add-ons\\dawn_of_thunder\\_main.cfg:53
here's the elementals.cfg file:
Spoiler:
Creator of Dawn of Thunder and Global Unitmarkers
"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
Re: Unexpected characters at line start error
The error message says to check Fire_Elemental.cfg at line number 19.
Are you sure you posted the right file here?
Are you sure you posted the right file here?
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: Unexpected characters at line start error
Whether it's the right or wrong file, that #textdomain line sure shouldn't be like that...
- Paulomat4
- Moderator Emeritus
- Posts: 730
- Joined: October 16th, 2012, 3:32 pm
- Location: Wesmere library, probably summoning Zhangor
Re: Unexpected characters at line start error
right, sry. here it is:The error message says to check Fire_Elemental.cfg at line number 19.
Spoiler:
You're absolutely right. I currently haven't made my campaign translatable so I figured it didn't matter.that #textdomain line sure shouldn't be like that
Creator of Dawn of Thunder and Global Unitmarkers
"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
Re: Unexpected characters at line start error
...and you checked those macros to make sure that calling them there that way won't result in unexpected characters at line start? Because it seems pretty clear that's the problem.
- Paulomat4
- Moderator Emeritus
- Posts: 730
- Joined: October 16th, 2012, 3:32 pm
- Location: Wesmere library, probably summoning Zhangor
Re: Unexpected characters at line start error
yup. I don't see anything wrong with them, maybe you could explain...and you checked those macros to make sure that calling them there that way won't result in unexpected characters at line start?
here are the two custom macros that are called.
Code: Select all
#define SPECIAL_NOTES_FIRE_HEALING HP
_" This unit regenerates {HP} HP per turn when on lava terrain."
#enddef
#define SPECIAL_NOTES_WOOD_HEALING
_" This unit regenerates 8 HP per turn by absorbing energy from burning forests. Any time this unit starts a turn on a dry forrest (non-snow), it burns the trees, leaving none left."
#enddef
Creator of Dawn of Thunder and Global Unitmarkers
"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
Re: Unexpected characters at line start error
Here you can see that it adds unquoted \n to description, so what follows is indeed unexpected.
- Pentarctagon
- Project Manager
- Posts: 5565
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Unexpected characters at line start error
You can also check <wesnoth install>/data/core/macros/special-notes.cfg for comparison.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
- Paulomat4
- Moderator Emeritus
- Posts: 730
- Joined: October 16th, 2012, 3:32 pm
- Location: Wesmere library, probably summoning Zhangor
Re: Unexpected characters at line start error
Thanks, i figured it out I didn't eben think about this possibility before. You can always learn something new with wesnoth.
Creator of Dawn of Thunder and Global Unitmarkers
"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
- Paulomat4
- Moderator Emeritus
- Posts: 730
- Joined: October 16th, 2012, 3:32 pm
- Location: Wesmere library, probably summoning Zhangor
[allow_undo] in moveto events
Could someone maybe clarify for me hoe [allow_undo] works?
I've been working on this event which randomly spawns a crab on a moveto event.
The Problem is that it is now impossible to undo a move on sandy terrain, even though I added [allow_undo]. How can I do this, at least if no unit is spawned?
I've been working on this event which randomly spawns a crab on a moveto event.
Code: Select all
[event]
name=moveto
first_time_only=no
[filter]
side=1,2,3,4,5
[filter_location]
terrain=D*^*, Hd, D*
[/filter_location]
[/filter]
[set_variable]
name=spawnlevel
rand=0,1,2,3
[/set_variable]
[if]
{VARIABLE_CONDITIONAL spawnlevel equals 1}
[then]
[unit]
type="Crab"
x,y=$x1,$y1
side=6
find_vacant=yes
[/unit]
[/then]
[/if]
[if]
{VARIABLE_CONDITIONAL spawnlevel equals 2}
[then]
[unit]
type="Overgrown Crab"
x,y=$x1,$y1
side=6
find_vacant=yes
[/unit]
[/then]
[/if]
[if]
{VARIABLE_CONDITIONAL spawnlevel equals 3}
[then]
[unit]
type="Giant Crab"
x,y=$x1,$y1
side=6
find_vacant=yes
[/unit]
[/then]
[/if]
[allow_undo]
[/allow_undo]
[/event]
Creator of Dawn of Thunder and Global Unitmarkers
"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
Re: [allow_undo] in moveto events
You can't. Requiring a random variable ([set_varialbe] rand=) is in internal change of the gamestate that cannot be undone without causing OOS. The game engine detects this and ignores your [allow_undo]The Problem is that it is now impossible to undo a move on sandy terrain, even though I added [allow_undo]. How can I do this, at least if no unit is spawned?
EDIT: this means you can make it undoable if you don't use rand= to determine whether a unit is spawned, you coudl for example make the unit spawned only depend on the turn and the coodinate, like:
Code: Select all
[set_variable]
name=spawnlevel
value="$(($x1 + $1y + $turn_number + $turn_number +side_number) % 4)"
[/set_variable]
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.
Re: [allow_undo] in moveto events
Probably better to pick the ambush points in advance. I think there's an HttT scenario that does that, which you could look at for an example.
At one point there was a nice PseudoRandom algorithm on the wiki. But since someone deleted the page in 2008 it appears that I can no longer view it in the history.
At one point there was a nice PseudoRandom algorithm on the wiki. But since someone deleted the page in 2008 it appears that I can no longer view it in the history.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: [allow_undo] in moveto events
I dont se how this could help here, if he used that instead of of rand= in his code he'd get OOS if the actions was undone since the wml-implemented pseudo random counter would have changed. If he generated them in advance (in prestart event) he could also use rand= .Sapient wrote: At one point there was a nice PseudoRandom algorithm on the wiki. But since someone deleted the page in 2008 it appears that I can no longer view it in the history.
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.