modify ai tag help please!
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.
modify ai tag help please!
Hi all,
The trick to the scenario we're working on is for the player's ally (side 2) to delay helping the player until an event is fired. We succeeded in keeping side 2 motionless:
The [avoid] tag pretty much disallows side 2's units from moving anywhere on the map (71x31 is the size of the map).
That works to keep side 2 from moving, but it's been trouble getting them to mobilize. Essentially, after a certain event is fired, I want the ai tag above to go away, allowing side 2 to do some damage. Suggestions?
Thanks as always,
J-bros
The trick to the scenario we're working on is for the player's ally (side 2) to delay helping the player until an event is fired. We succeeded in keeping side 2 motionless:
Code: Select all
[side]
side=2
controller=ai
user_team_name= _ "Rodriguez"
team_name=team1
type=TG Highwayman
id=Rodriguez
name= _ "Rodriguez"
unrenamable=yes
{GOLD 0 0 0}
{INCOME 0 0 0}
recruit=TG Ruffian,TG Thug,TG Addict,TG Wrestler
[ai]
[avoid]
x=1-71
y=1-31
[/avoid]
[/ai]
[/side]
That works to keep side 2 from moving, but it's been trouble getting them to mobilize. Essentially, after a certain event is fired, I want the ai tag above to go away, allowing side 2 to do some damage. Suggestions?
Thanks as always,
J-bros
- Elvish_Hunter
- Posts: 1575
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: modify ai tag help please!
Use the [modify_ai] tag in that event: http://wiki.wesnoth.org/DirectActionsWM ... dify_ai.5D
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: modify ai tag help please!
There are a number of other ways you can do this too, depending on what exactly you want. You could set
Or, you could have an event
and you make sure that 'some condition' is met at the beginning, and not met after you mobilize the side. In this case, units will not move, but they will attack enemy units that move next to them.
controller=null
for Side 2 either from the beginning (in which case I think you need to create the leader of the side manually) or in the prestart or start event. In this case, units will not do anything (not even defend themselves when attacked) and the side will not show up in the statistics either. You then change it to controller=ai
for mobilizing the side.Or, you could have an event
Code: Select all
[event]
name=side 2 turn refresh
first_time_only=no
[if]
some condition
[then]
{MODIFY_UNIT side=2 moves 0}
[/then]
[/if]
[/event]
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
Re: modify ai tag help please!
Thanks you guys!
I took mattsc's second suggestion and it works perfectly.
J-bros
I took mattsc's second suggestion and it works perfectly.
J-bros