Help with scenario
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.
-
- Posts: 7
- Joined: July 31st, 2017, 8:29 am
Help with scenario
Hi,
I'm trying to make a scenario. I've spent three days of it, I'm at the third scenario right now (1 escape, 1 intermission, 1 real battle), but I have two problems, what I can't solve on my own:
1. At the intermission, I renamed the main leader. During that dialog, it was perfect, the ID, etc went through smoothly, but when I declared her in the next scenario, it had 0 experience point. Also, my 'if' doesn't seem to work here (I tried to use it in a modify_unit also)
and in the next scenario:
2. It's not really a problem, but can I face an unit to a direction without animate_unit? Because In the first few moment, I have a peasant and he is always lifting his hat...
Thanks for the help!
I'm trying to make a scenario. I've spent three days of it, I'm at the third scenario right now (1 escape, 1 intermission, 1 real battle), but I have two problems, what I can't solve on my own:
1. At the intermission, I renamed the main leader. During that dialog, it was perfect, the ID, etc went through smoothly, but when I declared her in the next scenario, it had 0 experience point. Also, my 'if' doesn't seem to work here (I tried to use it in a modify_unit also)
Code: Select all
[store_unit]
variable=leader_store
[filter]
id=leader
[/filter]
kill=yes
[/store_unit]
[set_variable]
name = leader_store.name
value= _ "new name"
[/set_variable]
[set_variable]
name = leader_store.id
value=new_name
[/set_variable]
[unstore_unit]
variable=leader_store
[/unstore_unit]
{CLEAR_VARIABLE leader_store}
Code: Select all
[side]
type=Lesser Frostmage
id=new_name
name=_ "new name"
canrecruit=yes
recruit=Mage,Peasant,Spearman,Bowman
side=1
[if]
[variable]
name=new_name.experience
lower_than=30
[/variable]
[then]
[set_variable]
name=new_name.experience
value=30
[/set_variable]
[/then]
[/if]
color=teal
controller=human
team_name=mages
user_team_name=_"Mages"
[/side]
Code: Select all
[animate_unit]
[filter]
id=unit
[/filter]
[facing]
x,y=5,14
[/facing]
[/animate_unit]
Re: Help with scenario
Changing unit id is usually bad idea, code often assumes it is constant.
ActionWML is not mentioned in https://wiki.wesnoth.org/SideWML, so there is no reason why [if] should work there.
Unit has key facing, so should be possible to change with normal unit change tags.
ActionWML is not mentioned in https://wiki.wesnoth.org/SideWML, so there is no reason why [if] should work there.
Unit has key facing, so should be possible to change with normal unit change tags.
- skeptical_troll
- Posts: 500
- Joined: August 31st, 2015, 11:06 pm
Re: Help with scenario
Beside what Ravana said, the persistent side is looked for by the id of the leader, so if it is different from the previous scenario it will just start a new side with a fresh leader (you check the recall list to see if this is the case). Just modify the name and not the id and everything will be easier.
-
- Posts: 7
- Joined: July 31st, 2017, 8:29 am
Re: Help with scenario
Thanks for both of you. I could do what I wanted there.
-
- Posts: 7
- Joined: July 31st, 2017, 8:29 am
Re: Help with scenario..again
Hello,
I have an other question: can I set an area somehow in event:moveto to set a zone when side 1 enters, triggers it. I tried it with radius, but it doesn't seem to work.
Thanks again
I have an other question: can I set an area somehow in event:moveto to set a zone when side 1 enters, triggers it. I tried it with radius, but it doesn't seem to work.
Code: Select all
[event]
name=moveto
first_time_only=yes
[filter]
side=1
[filter_location]
x,y=24,4
radius=4
[or]
x,y=28,9
radius=4
[/or]
[or]
x,y=34,9
radius=4
[/or]
[/filter_location]
[/filter]
[message]
side2 message here
[/message]
[gold]
amount=100
side=2
[/gold]
[/event]
-
- Inactive Developer
- Posts: 503
- Joined: April 24th, 2016, 4:18 pm
Re: Help with scenario
I wasted a day, one time, fighting with radius. It works, but it's finicky. I swore "never again" and suggest just specifying each tile explicitly.
Somewhere I saw a comment that radius was slow, too. I never checked that but expect, when compared to an explicit list, it obviously would be.
Somewhere I saw a comment that radius was slow, too. I never checked that but expect, when compared to an explicit list, it obviously would be.
I forked real life and now I'm getting merge conflicts.
Re: Help with scenario
What your location filter asks for:
Any location that's (within 4 hexes of (24,4 or (any location within 4 hexes of 28,9 or (any location within 4 hexes of 34,9)))).
And that's because radius is applied last, after [or]/[and]/[not].
Any location that's (within 4 hexes of (24,4 or (any location within 4 hexes of 28,9 or (any location within 4 hexes of 34,9)))).
And that's because radius is applied last, after [or]/[and]/[not].
-
- Posts: 7
- Joined: July 31st, 2017, 8:29 am
Re: Help with scenario
Thanks, I combined the two comments, and result is working:zookeeper wrote:What your location filter asks for:
Any location that's (within 4 hexes of (24,4 or (any location within 4 hexes of 28,9 or (any location within 4 hexes of 34,9)))).
And that's because radius is applied last, after [or]/[and]/[not].
Code: Select all
[filter]
side=1
[filter_location]
x=24,28,34
y=4,9,9
radius=4
[/filter_location]
[/filter]