Request for AI tag
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.
Request for AI tag
I'm working on a scenario in which I want to specify a defeat condition using a moveto tag. I want the player to defend a specific hex against the AI opponent.
It seems like the current AI WML won't let me set a hex for the AI to try to move a unit into, which seems like a funciton that a lot of people might want.
I can set a [leader_goal], and the AI leader will go for the hex in question- but I don't want the enemy to stop recruiting or to expose its leader. Is there a way around this with current WML?
If not, is there a way I can request a straightforward [goal] tag that'd take unit filter and value keys? There's already precedent for a location having a value, in the [protect_location] tag.
It seems like the current AI WML won't let me set a hex for the AI to try to move a unit into, which seems like a funciton that a lot of people might want.
I can set a [leader_goal], and the AI leader will go for the hex in question- but I don't want the enemy to stop recruiting or to expose its leader. Is there a way around this with current WML?
If not, is there a way I can request a straightforward [goal] tag that'd take unit filter and value keys? There's already precedent for a location having a value, in the [protect_location] tag.
If you're using 1.1.2a or newer (I think these don't require newer than 1.1.2a, but I'm not 100% sure), you can use a name=ai turn event which sets the target for AI units by setting each unit's goto_x and goto_y unit variables to point to the coordinates you want. The problem is, that then they will pretty blindly attempt to move there and don't assess the situation in any way. However, with a little bit of extra work you could make it so that a unit has only, say, 50% chance of doing that, or that 50% of the AI's unit's will be set to try that. I think with some work you could get the AI to behave in a pretty good way.
Of course, a simple [goal] tag would be great, too, as the above kind of approach is quite messy and difficult.
Of course, a simple [goal] tag would be great, too, as the above kind of approach is quite messy and difficult.
I just read in another thread that Casual User implemented a [target] tag that specified a hex as a target instead of a unit. If that works, it'd be the ideal solution to my problem. I'll try it and see what happens.
If it works, the Wiki should be updated to reflect that [target] will take an x,y key as well as a unit filter.
I am, sadly, stuck with 1.0.2 - there's no SVN build for Mac OS 10.2.8, and I know dick about compiling my own stuff. I'd still be willing to give it a try and see what I learn from it, but I read somewhere that I need a compiling tool that only runs in 10.3+, so I'm pretty much out of luck.
If it works, the Wiki should be updated to reflect that [target] will take an x,y key as well as a unit filter.
I am, sadly, stuck with 1.0.2 - there's no SVN build for Mac OS 10.2.8, and I know dick about compiling my own stuff. I'd still be willing to give it a try and see what I learn from it, but I read somewhere that I need a compiling tool that only runs in 10.3+, so I'm pretty much out of luck.
- Casual User
- Posts: 475
- Joined: March 11th, 2005, 5:05 pm
- Ken_Oh
- Moderator Emeritus
- Posts: 2178
- Joined: February 6th, 2006, 4:03 am
- Location: Baltimore, Maryland, USA
Hey, I just bumped this to ask if anything works yet to move a leader around. I've tried [leader_goal], [leader_target] and [target] but haven't gotten any results.
I've looked at all the other threads that I could find through search but it's all confusing me.
EDIT:
zookeeper in irc helped me out with this one. Here's what seems to be the final verdict.
This will continually move a unit with the description Jimmy towards x/y 20/25. You might want to make a modification so that the unit modification it doesn't happen on each ai side's turn, but this work good enough for me.
I've looked at all the other threads that I could find through search but it's all confusing me.
EDIT:
zookeeper in irc helped me out with this one. Here's what seems to be the final verdict.
Code: Select all
[event]
name=ai turn
first_time_only=no
{MODIFY_UNIT description=Jimmy goto_x 20}
{MODIFY_UNIT description=Jimmy goto_y 25}
[/event]