[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.
Re: Question about [move_unit]
I think easiest way to do it is with [store_unit]side=2 kill=no and then with {FOREACH} move 1 kill 1 {NEXT}
- Paulomat4
- Moderator Emeritus
- Posts: 730
- Joined: October 16th, 2012, 3:32 pm
- Location: Wesmere library, probably summoning Zhangor
Re: Question about [move_unit]
Thank you, and thanks to Adamant14 who helped me per PM.
This is the working result.
You guys are great
This is the working result.
Code: Select all
[store_unit]
[filter]
side=2
[/filter]
variable=movers
kill=no
[/store_unit]
{FOREACH movers i}
[move_unit]
id=$movers[$i].id
to_x=44
to_y=12
[/move_unit]
[kill]
id=$movers[$i].id
animate=no
[/kill]
{NEXT i}
{CLEAR_VARIABLE movers}
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
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Question about [move_unit]
more elegant: use [move_unit]side=2 fire_event=yes and make an [event]name=moveto for said coordinates which [kill]s the unit with id=$unit.id.
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
- Paulomat4
- Moderator Emeritus
- Posts: 730
- Joined: October 16th, 2012, 3:32 pm
- Location: Wesmere library, probably summoning Zhangor
Re: Question about [move_unit]
I feel silly now. I should have thought of that.more elegant: use [move_unit]side=2 fire_event=yes and make an [event]name=moveto for said coordinates which [kill]s the unit with id=$unit.id.
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
Getting a Lua error without even using Lua???
I get this ingame error message:
The thing is, that i don't understand Lua, and i don't use it.
It doesn't happens in other scenarios than this.
when trying this scenario:
Code: Select all
[scenario]
id=06_woodchoppers
next_scenario=null
name= _ "Woodchoppers"
map_data="{~add-ons/Rise_of_the_second_sun/maps/06_woodchoppers.map}"
{TURNS 32 26 20}
victory_when_enemies_defeated=no
{DUSK}
{FIRST_WATCH}
{SECOND_WATCH}
{DAWN}
{MORNING}
{AFTERNOON}
{MOOD_HUSHED}
[story]
[part]
story= _ ""
background=story/waterfall.png
[/part]
[part]
story= _ ""
background=story/forestgate.png
[/part]
[part]
story= _ ""
background=story/map.png
[/part]
[/story]
{BIGMAP_WOODCHOPPERS}
[side]
side=1
controller=human
team_name=1
user_team_name= _ "Aethen's representants"
type=Elvish Thunderer
id=Fiannon
name= _ "Fiannon"
profile=portraits/Fiannon.png
canrecruit=yes
recruit=Elvish Fighter,Elvish Archer,Elvish Shaman,Elvish Scout
{GOLD 150 100 50}
{INCOME 2 0 -2}
{FLAG_VARIANT long}
[/side]
[side]
side=2
controller=ai
team_name=2
user_team_name= _ "Elvish Ghosts"
no_leader=yes
recruit=Elvish Warrior Spirit
{GOLD 250 350 450}
{INCOME 5 10 15}
{FLAG_VARIANT ragged}
[ai]
village_value=0
[avoid]
x,y=2-4,22-24
radius=9
[/avoid]
[/ai]
[/side]
[side]
side=3
controller=ai
team_name=3
user_team_name= _ "Bandits"
no_leader=yes
#ifdef EASY
recruit=Ruffian,Thug
#endif
#ifdef NORMAL
recruit=Ruffian,Thug,Poacher
#endif
#ifdef HARD
recruit=Footpad,Thief,Poacher,Thug
#endif
[ai]
{ATTACK_DEPTH 4 5 6}
#ifdef EASY
recruitment_pattern=fighter
#endif
#ifdef NORMAL
recruitment_pattern=fighter,fighter,archer
#endif
#ifdef HARD
recruitment_pattern=scout,fighter,archer,archer
#endif
village_value=0
[avoid]
x,y=2-4,22-24
radius=9
[/avoid]
[/ai]
{GOLD 250 350 450}
{INCOME 5 10 15}
{FLAG_VARIANT ragged}
[/side]
[side]
side=4
controller=ai
team_name=1
user_team_name= _ "Guarrison of Aldril"
type=Lieutenant
id=Raief
name= _ "Raief"
profile=portraits/Raief.png
canrecruit=yes
{GOLD 100 100 100}
{INCOME 0 0 0}
{FLAG_VARIANT loyalist}
{STARTING_VILLAGES 10 11}
{STARTING_VILLAGES 12 11}
{STARTING_VILLAGES 11 13}
{STARTING_VILLAGES 8 12}
{STARTING_VILLAGES 6 13}
{STARTING_VILLAGES 7 15}
{STARTING_VILLAGES 8 15}
{STARTING_VILLAGES 5 15}
{STARTING_VILLAGES 4 16}
{STARTING_VILLAGES 7 17}
{STARTING_VILLAGES 9 18}
{STARTING_VILLAGES 11 19}
{STARTING_VILLAGES 13 20}
{STARTING_VILLAGES 14 18}
{STARTING_VILLAGES 15 17}
{STARTING_VILLAGES 13 16}
{STARTING_VILLAGES 17 17}
{STARTING_VILLAGES 19 16}
{STARTING_VILLAGES 18 13}
[ai]
{MICRO_AI_GUARDIAN}
[/ai]
[/side]
[event]
name=prestart
[time_area]
x=5
y=22
radius=2
{MORNING}
{AFTERNOON}
{AFTERNOON}
{DUSK}
{DAWN}
{MORNING}
[/time_area]
[item]
x=5
y=22
image=scenery/lighthouse.png
halo=halo/lighthouse-aura.png
[/item]
[item]
x=7
y=15
image=scenery/shop-sign.png~RC(magenta>purple)
[/item]
[item]
x=4
y=18
image=scenery/transport-galleon-se.png~RC(magenta>purple)
[/item]
[item]
x=7
y=19
image=scenery/galleon-se.png~RC(magenta>purple)
[/item]
[item]
x=9
y=20
image=scenery/transport-galleon-se.png~RC(magenta>purple)
[/item]
{PLACE_IMAGE (scenery/anvil.png) 9 16}
{PLACE_IMAGE (scenery/log.png) 52 23}
{PLACE_IMAGE (scenery/log.png) 54 21}
{PLACE_IMAGE (scenery/log.png) 58 22}
{PLACE_IMAGE (scenery/log.png) 58 25}
{PLACE_IMAGE (scenery/logs.png) 55 24}
{PLACE_IMAGE (scenery/boat-se.png) 11 21}
{PLACE_IMAGE (scenery/hay.png) 4 7}
{PLACE_IMAGE (scenery/signpost.png) 48 33}
[unit]
type=Spearmen
id=guard1
side=4
x=13
y=21
[/unit]
[micro_ai]
side=4
ai_type=guardian_unit
action=add
guardian_type=return_guardian
id=guard1
return_x,return_y=13,21
[/micro_ai]
[unit]
type=Spearmen
id=guard2
side=4
x=16
y=19
[/unit]
[micro_ai]
side=4
ai_type=guardian_unit
action=add
guardian_type=return_guardian
id=guard2
return_x,return_y=16,19
[/micro_ai]
[unit]
type=Spearmen
id=guard3
side=4
x=18
y=17
[/unit]
[micro_ai]
side=4
ai_type=guardian_unit
action=add
guardian_type=return_guardian
id=guard3
return_x,return_y=18,17
[/micro_ai]
[unit]
type=Spearmen
id=guard4
side=4
x=20
y=16
[/unit]
[micro_ai]
side=4
ai_type=guardian_unit
action=add
guardian_type=return_guardian
id=guard4
return_x,return_y=20,16
[/micro_ai]
[unit]
type=Spearmen
id=guard5
side=4
x=19
y=13
[/unit]
[micro_ai]
side=4
ai_type=guardian_unit
action=add
guardian_type=return_guardian
id=guard5
return_x,return_y=19,13
[/micro_ai]
[unit]
type=Spearmen
id=guard6
side=4
x=16
y=11
[/unit]
[micro_ai]
side=4
ai_type=guardian_unit
action=add
guardian_type=return_guardian
id=guard6
return_x,return_y=16,11
[/micro_ai]
{GENERIC_UNIT 4 (Spearman) 12 10}
[unit]
type=Spearmen
id=guard7
side=4
x=12
y=10
[/unit]
[micro_ai]
side=4
ai_type=guardian_unit
action=add
guardian_type=return_guardian
id=guard7
return_x,return_y=12,10
[/micro_ai]
[unit]
type=Spearmen
id=guard8
side=4
x=10
y=10
[/unit]
[micro_ai]
side=4
ai_type=guardian_unit
action=add
guardian_type=return_guardian
id=guard8
return_x,return_y=10,10
[/micro_ai]
[unit]
type=Spearmen
id=guard9
side=4
x=7
y=12
[/unit]
[micro_ai]
side=4
ai_type=guardian_unit
action=add
guardian_type=return_guardian
id=guard9
return_x,return_y=7,12
[/micro_ai]
[unit]
type=Spearmen
id=guard10
side=4
x=4
y=13
[/unit]
[micro_ai]
side=4
ai_type=guardian_unit
action=add
guardian_type=return_guardian
id=guard10
return_x,return_y=4,13
[/micro_ai]
[unit]
type=Spearmen
id=guard11
side=4
x=3
y=16
[/unit]
[micro_ai]
side=4
ai_type=guardian_unit
action=add
guardian_type=return_guardian
id=guard11
return_x,return_y=3,16
[/micro_ai]
[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]
[/event]
[event]
name=moveto
first_time_only=yes
[filter]
x=48
y=33
[/filter]
[message]
image=portraits/signpost.png
message= _ "Direction NE: Aldril
Direction NW: woodchoppers lodge
Direction SW: Midlands"
[/message]
[/event]
[/scenario]
It doesn't happens in other scenarios than 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
Re: Getting a Lua error without even using Lua???
Paulomat4 wrote:I get this ingame error message:when trying this scenario:
The thing is, that i don't understand Lua, and i don't use it.
It doesn't happens in other scenarios than this.
well the message says that there is no unittype called "Spearmen" wich is correct unless you have added such a unit.
since a lot of wml is handeled by lua, there are sometimes wml errors that appear as lua errors.
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.
- Paulomat4
- Moderator Emeritus
- Posts: 730
- Joined: October 16th, 2012, 3:32 pm
- Location: Wesmere library, probably summoning Zhangor
Re: Getting a Lua error without even using Lua???
well, i schould be the standard spearmen, which is already include in the game.
Okay, i see now, it should be spearman. Quite a silly question.
But why doesn't it shows an unknown unit type error?
now I get this lua error:
Okay, i see now, it should be spearman. Quite a silly question.
But why doesn't it shows an unknown unit type error?
now I get this lua error:
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: Getting a Lua error without even using Lua???
have you stated you game in debug mode or changed the debug mode during the game?Paulomat4 wrote: now I get this lua error:
really don't know what that means but it seems to be related to the AI.
to find yout wich part causes that error you could remove all the AI stuff and readd it successively and test it to find out wich one causes that error.
i think "mattsc" knows more about the AI system.
but the message said "Unknown unit type"...Paulomat4 wrote: But why doesn't it shows an unknown unit type 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: Getting a Lua error without even using Lua???
Yes, mattsc is the AI expert, you can pm him for instance.
AFAIK the Lua AI debug functionality are a few features (1 function at least) which can be called by lua code in order to emit debugging information. However, you shouldn't get it when not doing something with Lua AI or when not calling that function. Perhaps it's a bug in the engine.
And you *are* using Lua no matter what, since large parts of the wml action engine are implemented in Lua nowadays, that's why you get that "unknown unit type" Lua error. You probably only need to look at and understand the first line (the error message), as long as it's an error caused by wml. If you think you aren't using Lua, it is.
AFAIK the Lua AI debug functionality are a few features (1 function at least) which can be called by lua code in order to emit debugging information. However, you shouldn't get it when not doing something with Lua AI or when not calling that function. Perhaps it's a bug in the engine.
And you *are* using Lua no matter what, since large parts of the wml action engine are implemented in Lua nowadays, that's why you get that "unknown unit type" Lua error. You probably only need to look at and understand the first line (the error message), as long as it's an error caused by wml. If you think you aren't using Lua, it is.
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
- Paulomat4
- Moderator Emeritus
- Posts: 730
- Joined: October 16th, 2012, 3:32 pm
- Location: Wesmere library, probably summoning Zhangor
Re: Getting a Lua error without even using Lua???
Sorry, i referred to the typical unknown unit error, which appears when loading a scenario. But i guess, it appears after loading the scenario because the false spearman unit are created in a prestart event, which is loaded after the scenario. That confused me, sorry.but the message said "Unknown unit type"...
Yeah, most time when testing scenario's i load the game with debug mode already opened, because I already had it opened. As far as i know i haven't changed anything to debug mode, and the error appears also when starting the scenario without debug mode.have you stated you game in debug mode or changed the debug mode during the game?
Yeah, i know, but what i meant was when using Lua active.And you *are* using Lua no matter what...
after investigated a bit more and after clicking end turn even more Lua errors appear. I'll pm mattsc. Hopefully he knows what to do.
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:Lua Errors, placing multihex images
I still don't have an answer from mattsc, but he haven't online, so i don't give up the hope. In the meantime, if anyone has an idea, why i get these errors, please tell me
On another front, i want to place an image on the screen. The problem is, that the image is bigger than 72x72 px and so i can't use image= within an [item] tag. But i can't use halo= neither, because it would place the image on top of the unit. The wiki didn't really help, anyone an idea?
On another front, i want to place an image on the screen. The problem is, that the image is bigger than 72x72 px and so i can't use image= within an [item] tag. But i can't use halo= neither, because it would place the image on top of the unit. The wiki didn't really help, anyone an idea?
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: Re:Lua Errors, placing multihex images
You may need to use terrain graphics, rather than [item]. Look at the "great tree" terrain & terrain-graphics for an example.Paulomat4 wrote:On another front, i want to place an image on the screen. The problem is, that the image is bigger than 72x72 px and so i can't use image= within an [item] tag. But i can't use halo= neither, because it would place the image on top of the unit. The wiki didn't really help, anyone an idea?
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
Re: Re:Lua Errors, placing multihex images
I, too, recommend to install a custom terrain for the matter.doofus-01 wrote:You may need to use terrain graphics, rather than [item]. Look at the "great tree" terrain & terrain-graphics for an example.Paulomat4 wrote:On another front, i want to place an image on the screen. The problem is, that the image is bigger than 72x72 px and so i can't use image= within an [item] tag. But i can't use halo= neither, because it would place the image on top of the unit. The wiki didn't really help, anyone an idea?
You can also refer doofus-01's campaigns for it. There are some amazing multi-hex terrains in them.
(if your image is on a hex, using a terrain-overlay (Xx^Yy) is easier.)
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
- 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
Okay, so that's what i got until now:
my terrain.cfg:
my terrain-graphics.cfg
The supposed tile is even marked ingame with the right name (elvish watchtower)
but it doesn't shows the right image (still only the base image) And is also marked as unwalkable.
Edit: Okay, i found the error because of the unwalkable terrain. Still the image i wanted it to have isn't there.
my terrain.cfg:
Code: Select all
[terrain_type]
symbol_image=../terrain/watchtower-elven.png
id=elven_watchtower
name= _ "Elven Watchtower"
string=^Cvw
aliasof=^Cv
editor_group=Rotss
hidden=yes
[/terrain_type]
Code: Select all
# scenery overlay
{OVERLAY *^Cvw ../terrain/watchtower-elven.png}
but it doesn't shows the right image (still only the base image) And is also marked as unwalkable.
Edit: Okay, i found the error because of the unwalkable terrain. Still the image i wanted it to have isn't there.
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: Re:Lua Errors, placing multihex images
For terrains, I think:should be:
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.
Code: Select all
{OVERLAY *^Cvw ../terrain/watchtower-elven.png}
Code: Select all
{OVERLAY *^Cvw watchtower-elven}
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server