Campaign won't start
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: Campaign won't start
I did that but the ai does not go back to its starting position.
Re: Campaign won't start
Could you do a move unit like code but the ai only does that like when it has enough moves to do that?
Re: Campaign won't start
Is the leader of a side the one that can recruit?
Re: Campaign won't start
Yes.
Actually, it is even possible to have multiple leaders; but you're right that each leader (and only the leader(s)) is able to recruit units (if you allow him to do so, of course).
Crend
Actually, it is even possible to have multiple leaders; but you're right that each leader (and only the leader(s)) is able to recruit units (if you allow him to do so, of course).
Crend
UMC Story Images — Story images for your campaign!
Re: Campaign won't start
He is on 1.8 though.Crendgrim wrote:it is even possible to have multiple leaders

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
- Elvish_Hunter
- Posts: 1600
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: Campaign won't start
Actually, on 1.8 I had one scenario of TSoG with two leaders. Support for multiple leaders was enabled during the 1.7 development cycle.SkyOne wrote:He is on 1.8 though.

Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
Re: Campaign won't start
So if I had Sir Boris (who can't recruit because otherwise he won't attack) would not obey leader goals? If so, how could I get the ai to move him to get a new lance?
And just to be inquisitive, if there is more than one leader, will the ai move all the leaders the the leader goal or just one?
And just to be inquisitive, if there is more than one leader, will the ai move all the leaders the the leader goal or just one?
Re: Campaign won't start
Uh-oh, you are right.Elvish_Hunter wrote:Actually, on 1.8 I had one scenario of TSoG with two leaders. Support for multiple leaders was enabled during the 1.7 development cycle.SkyOne wrote:He is on 1.8 though.
My memory was that having two leaders in the same side got a defeated condition. It was probably on before 1.7.15... (I just tested it on 1.7.15.)
Excuse me, Crendgrim.
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
Re: Campaign won't start
I tried and the macro is but Sir Boris still doesn't go to the starting position. 
Code: Select all
[event]
name=attacker hits
first_time_only=no
[filter]
id=Sir_Boris
[/filter]
[filter_attack]
name=lance
[/filter_attack]
[set_variable]
name=lanceb
rand="0..2"
[/set_variable]
[if]
[variable]
name=lanceb
greater_than=0
[/variable]
[then]
[object]
silent=yes
[effect]
apply_to=remove_attacks
type=pierce
[/effect]
[/object]
[message]
id=Sir_Boris
message=_"Aw, my lance has snapped."
[/message]
[store_unit] #to stop the unit attack
[filter]
id=Sir_Boris
[/filter]
variable=stored_sir_boris
kill=yes
[/store_unit]
[unstore_unit]
variable=stored_sir_boris
[/unstore_unit]
[modify_side]
side=2
{TARGET_LOCATION_J 2 18 5 -100.0}
[/modify_side]
[/then]
[else]
[/else]
[/if]
[/event]
Code: Select all
#define TARGET_LOCATION_J X Y VALUE VALUE_AGGESSION
[goal]
name=target_location
[criteria]
x={X}
y={Y}
[/criteria]
value={VALUE}
[/goal]
[aspect]
id=aggression
[facet]
id="always"
value={VALUE}
[/facet]
[/aspect]
#enddef

Re: Campaign won't start
Can
Crend
[url=http://wiki.wesnoth.org/DirectActionsWML#.5Bmodify_side.5D][modify_side][/url]
have the subtags goal
or aspect
? No. So, look again at the wiki how it should be done.Crend
UMC Story Images — Story images for your campaign!
Re: Campaign won't start
How can you have a non-leader (one for all units) than? All that is there is leader goal and Sir Boris isn't a leader.
Re: Campaign won't start
I have no idea whether this works, but I would try to use
Crend
[modify_unit]
and set goto_x=
and goto_y=
to the location where Sir Boris should return to.Crend
UMC Story Images — Story images for your campaign!
Re: Campaign won't start
Would actuly start the event or can't you use vars in event names?
Code: Select all
[event]
name=side 2 turn $turnattack
- Pentarctagon
- Project Manager
- Posts: 5730
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Campaign won't start
Test it out yourself. You should post for help if you can't figure something out, not for every question you have.
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
Re: Campaign won't start
I did try it out and it doesn't work. I came up with this but it doesn't work either. What it's supposed to do is at the start of side 2 turn check if the lanceb var is greater than 0 (which if it is, it means that Sir Boris's lance has snapped) and if it is, then move him to 2,18 and set his moves to 0.
Code: Select all
[event]
name=attacker hits
first_time_only=no
[filter]
id=Sir_Boris
[/filter]
[filter_attack]
name=lance
[/filter_attack]
[set_variable]
name=lanceb
rand="0..2"
[/set_variable]
[if]
[variable]
name=lanceb
greater_than=0
[/variable]
[then]
[object]
silent=yes
[effect]
apply_to=remove_attacks
type=pierce
[/effect]
[/object]
[message]
id=Sir_Boris
message=_"Aw, my lance has snapped."
[/message]
[store_unit] #to stop the unit attack
[filter]
id=Sir_Boris
[/filter]
variable=stored_sir_boris
kill=yes
[/store_unit]
[unstore_unit]
variable=stored_sir_boris
[/unstore_unit]
[clear_variable]
name=stored_sir_boris
[/clear_variable]
[/then]
[else]
[/else]
[/if]
[/event]
[event]
name=side 2 turn refresh
first_time_only=no
[if]
[variable]
name=lanceb
greater_than=0
[/variable]
[than]
{MOVE_UNIT (id=Sir_Boris) 2 18}
[store_unit]
[filter]
id=Sir_Boris
[/filter]
variable=stored_sir_boris
[/store_unit]
[set_variable]
name=stored_sir_boris.moves
value=0
[/set_variable]
[unstore_unit]
variable=stored_sir_boris
[/unstore_unit]
[clear_variable]
name=stored_sir_boris
[/clear_variable]
[/than]
[/if]
[/event]