[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: Re:Lua Errors, placing multihex images
Thanks, now everything works as expected.should beCode: Select all
{OVERLAY *^Cvw watchtower-elven}
This wasn't my goal, since its for decoration purposes only.Anyway, as your image is a watchtower, creating its unit is another way, like the Orcish Watchtower on SotBE. You can add a weapon(s) in the case.
Thank for your help!
I still have the Lua errors, thought
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
[move_unit] to a certain kind of terrain, no coordinates
I want to move a unit to the next hex of a certain terrain type.
I looked at [move_unit] in the wiki but apparently it can only be coordinates.
I thought i found a workaround but it doesn't seem to work. It shows the error
<Invalid WML found> invalid coordinate in [move_unit]
Anybody an idea?
I looked at [move_unit] in the wiki but apparently it can only be coordinates.
I thought i found a workaround but it doesn't seem to work. It shows the error
<Invalid WML found> invalid coordinate in [move_unit]
Anybody an idea?
Code: Select all
[store_locations]
[filter]
x=$x1
y=$y1
radius=20
terrain=*^Fet,*^Fetd
[/filter]
variable=great_trees_to_teleport
[/store_locations]
[move_unit]
to_x=great_trees_to_teleport.x
to_y=great_trees_to_teleport.y
[/move_unit]
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: [move_unit] to a certain kind of terrain, no coordinates
Replace this:
By this:
If something is not specifically made to accept variable names as arguments, you have to write the $ symbol before the variable name if using a variable, otherwise the variable name is regarded as an argument instead of its content, and because its name is not a number...
Code: Select all
to_x=great_trees_to_teleport.x
to_y=great_trees_to_teleport.y
Code: Select all
to_x=$great_trees_to_teleport.x
to_y=$great_trees_to_teleport.y
- Paulomat4
- Moderator Emeritus
- Posts: 730
- Joined: October 16th, 2012, 3:32 pm
- Location: Wesmere library, probably summoning Zhangor
Re: [move_unit] to a certain kind of terrain, no coordinates
(blushing for shame ) I feel so silly. Thanks. I should have checked that myself.Dugi wrote:Replace this:By this:Code: Select all
to_x=great_trees_to_teleport.x to_y=great_trees_to_teleport.y
If something is not specifically made to accept variable names as arguments, you have to write the $ symbol before the variable name if using a variable, otherwise the variable name is regarded as an argument instead of its content, and because its name is not a number...Code: Select all
to_x=$great_trees_to_teleport.x to_y=$great_trees_to_teleport.y
I corrected it but then wesnoth crashes and gives me this error. I'm using bfw 1.11.6 on windows.
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: [move_unit] to a certain kind of terrain, no coordinates
terrain is not an unit attribute so it can't be used in a SUF. Move it outside of the filter block (along with radius).
Code: Select all
[store_locations]
terrain=*^Fet*
[and]
[filter]
x,y=$x1,$y1
[/filter]
radius=20
[/and]
variable=great_trees_to_teleport
[/store_locations]
Re: [move_unit] to a certain kind of terrain, no coordinates
You are right that the standardLocationFilter in [store_locations] doesn't use a [filter] tag, unlike [store_unit]. But your code is pretty strange, using way too many tags without any reason, especially the [and] tag that causes the filter to run twice and look for intersections and the [filter] tag that makes the game also filter for a unit.
This could do the same without any problems:
This could do the same without any problems:
Code: Select all
[store_locations]
terrain=*^Fet*
x,y=$x1,$y1
radius=20
variable=great_trees_to_teleport
[/store_locations]
- Paulomat4
- Moderator Emeritus
- Posts: 730
- Joined: October 16th, 2012, 3:32 pm
- Location: Wesmere library, probably summoning Zhangor
Re: [move_unit] to a certain kind of terrain, no coordinates
well, i didn't believed i'd ever say that, but dugi's one doesn't work. Again it shows the error
<Invalid WML found> invalid coordinate in [move_unit]
trewe's one works perfectly though.
<Invalid WML found> invalid coordinate in [move_unit]
trewe's one works perfectly though.
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
wesnoth crashing after event
okay, soduring the execution of either this event
or this event:
wesnoth crashes repeatedly and gives this error message:
anyone an idea what could cause that? I heard somewhere, that wesnoth should not completely crash, from wml errors, but i'm not sure where
this would be line 492 which is mentioned in the error message:
Code: Select all
[event]
name=last_breath
[filter]
id=Maeblie
[/filter]
[message]
speaker=Maeblie
message= _ "Ha, think you can get me? You're thinking wrong!"
[/message]
[move_unit]
id=Maeblie
to_x=56
to_y=19
[/move_unit]
[animate_unit]
flag=pre_teleport
[filter]
id=Maeblie
[/filter]
[/animate_unit]
[kill]
animate=no
fire_event=no
id=Maeblie
[/kill]
[/event]
Code: Select all
[event]
name=last_breath
[filter]
id=Maeblie
[/filter]
[message]
speaker=Maeblie
message= _ "Ha, think you can get me? You're thinking wrong!"
[/message][store_locations]
terrain=*^Fet*
[and]
[filter]
x,y=$x1,$y1
[/filter]
radius=20
[/and]
variable=great_trees_to_teleport
[/store_locations]
[move_unit]
id=Maeblie
to_x=$great_trees_to_teleport.x
to_y=$great_trees_to_teleport.y
[/move_unit]
[animate_unit]
flag=pre_teleport
[filter]
id=Maeblie
[/filter]
[/animate_unit]
[kill]
animate=no
fire_event=no
id=Maeblie
[/kill]
{CLEAR_VARIABLE great_trees_to_teleport}
[/event]
this would be line 492 which is mentioned in the error message:
Code: Select all
[micro_ai]
side=4
ai_type=guardian_unit
action=add
---> guardian_type=coward
id=Raief
distance=7
seek_x,seek_y=8,15
[/micro_ai]
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: wesnoth crashing after event
first of all the message points to line 492 of unit_map.hpp wich is part of the core and not part of you addon source.
i know nothing about that part of the source but some other informaiosn are always helpful:
1) does that problem appears with other versions of wesnoth (10.6, or 11.5 for example) as well?
2) could you make a very simple addon that replicates this error?
i know nothing about that part of the source but some other informaiosn are always helpful:
1) does that problem appears with other versions of wesnoth (10.6, or 11.5 for example) as well?
2) could you make a very simple addon that replicates this error?
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.
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: wesnoth crashing after event
Doesn't matter where, it is correct. Assertions failures as here are always such bugs. So, the way to go is to make a reproduction addon as gfgtdf says and report the issue. This may also get you a workaround in the process (for as long as the issue stays unfixed).anyone an idea what could cause that? I heard somewhere, that wesnoth should not completely crash, from wml errors, but i'm not sure where
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
Re: wesnoth crashing after event
Your location filter most likely returns an array (or do you have only one great tree on the map?). You may specify the index of the tree the unit should move to, 0 for the first match. Without this the variable would be threatened as simple scalars.Paulomat4 wrote:anyone an idea what could cause that? I heard somewhere, that wesnoth should not completely crash, from wml errors, but i'm not sure where
Code: Select all
# move to the first tree found
x,y=$great_trees_to_teleport[0].x,great_trees_to_teleport[0].y
# or, for example
# move to a random tree in range
{RANDOM 1..$great_trees_to_teleport.length}
{VARIABLE_OP random sub 1}
x,y=$great_trees_to_teleport[$random].x,great_trees_to_teleport[random].y
Re: wesnoth crashing after event
You would be in the best position to narrow down the cause, since you are able to reproduce the crash. An example of something you could do is try trimming stuff out of your events. Does it still crash when you remove the [kill] tag? If you remove the [filter] (and change "id=Maeblie" to "id=$unit.id")? Try to get the event as simple as possible so others don't end up following red herrings.Paulomat4 wrote:anyone an idea what could cause that?
Then (getting back to gfgtdf's advice) try putting the simplified event into an addon consisting of a single scenario, something along the lines of:
Code: Select all
[scenario]
id=01_Assertion_Failure
name=_"Assertion Failure"
next_scenario=null
map_data="usage=map
border_size=1
Gg , Gg , Gg , Gg
Gg , 1 Gg , 2 Gg , Gg
Gg , Gg , Gg , Gg
Gg , Gg , Gg , Gg
"
turns=10
{DEFAULT_SCHEDULE}
[side]
side=1
controller=human
type=Ancient Lich # Has a good number of magical attacks, so will often trigger the event.
canrecruit=yes
[/side]
[side]
side=2
controller=ai
type=Walking Corpse
canrecruit=yes
hitpoints=1
[/side]
# ##################################
[event]
# Fill in your simplified event here.
[/event]
[/scenario]
- Paulomat4
- Moderator Emeritus
- Posts: 730
- Joined: October 16th, 2012, 3:32 pm
- Location: Wesmere library, probably summoning Zhangor
Re: wesnoth crashing after event
I'm still on this, i just hadn't really time to work on it.
Ok, so i tried filtering which part of the wml caused that error, and removed them one for one. It's actually the [kill] tag. without it, it worked good. I then changed the id=Maeblie to id=$unit.id and then the [kill] tag worked fine without an error. I still hadn't time do make a new add-on,which replicates it, but i'll do think of doing it.You would be in the best position to narrow down the cause, since you are able to reproduce the crash. An example of something you could do is try trimming stuff out of your events. Does it still crash when you remove the [kill] tag? If you remove the [filter] (and change "id=Maeblie" to "id=$unit.id")? Try to get the event as simple as possible so others don't end up following red herrings.
Then (getting back to gfgtdf's advice) try putting the simplified event into an add-on consisting of a single scenario, something along the lines of:
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
Re: wesnoth crashing after event, Moving unkown units back
Okay this is another thing i'm working on.
The code move all units to a certain location. After this (and some talking) I'd like to move them back where they come from. How would I do this? I know that i would need to store the location they come from somehow and after this move them back. The problem is that i don't know how to store the locations as they would not be x1,y1 or x2,y2 and there's no other standard location filter who include's coordinates as far as i know. http://wiki.wesnoth.org/StandardLocationFilter
EDIT:solved
The code move all units to a certain location. After this (and some talking) I'd like to move them back where they come from. How would I do this? I know that i would need to store the location they come from somehow and after this move them back. The problem is that i don't know how to store the locations as they would not be x1,y1 or x2,y2 and there's no other standard location filter who include's coordinates as far as i know. http://wiki.wesnoth.org/StandardLocationFilter
Code: Select all
{FOREACH moving_guards i}
[move_unit]
id=$moving_guards[$i].id
to_x=17
to_y=16
[/move_unit]
{NEXT i}
{CLEAR_VARIABLE moving_guards}
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
Firing event all x turns
Okay, so it has been quite some tie since I posted in this topic, i guess i'm getting a bit more used to wml
I am now trying to fire an event all x turns. for example all 2 turns. How would I do this?
I am now trying to fire an event all x turns. for example all 2 turns. How would I do this?
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