64038 Commits

Author SHA1 Message Date
Charles Dang
dc53c90d6e tlobby_main: enable markup in chat log 2016-03-23 13:15:01 +11:00
Celtic Minstrel
43142630b6 XCode: Add readline to Copy Files phase 2016-03-22 21:39:04 -04:00
mattsc
5a82a36e89 Update Xcode project to include readline
This also requires the readline dylib and headers to be added to the
project directory
2016-03-22 18:31:42 -07:00
mattsc
7c4aec9cfe Micro AI test scenario: fix incorrect aspect name 2016-03-22 18:31:42 -07:00
Celtic Minstrel
e231540b73 Update changelog 2016-03-22 21:28:17 -04:00
Celtic Minstrel
f7f4bfe321 Don't warn about missing [default] when there should be none 2016-03-22 20:26:30 -04:00
Celtic Minstrel
8478cd604c Fix [goal] not falling back to default name= if engine= omitted 2016-03-22 20:23:23 -04:00
Celtic Minstrel
c7d1bd6ae4 Don't inject full RCA AI if ai_algorithm unspecified and a [stage] defined 2016-03-22 18:46:27 -04:00
Charles Dang
6158ca73b9 tlobby_main: implemented tab close buttons 2016-03-23 07:53:59 +11:00
Charles Dang
d79cdd50bc GUI2: added minimal Close button definition 2016-03-23 07:50:02 +11:00
Charles Dang
386762a6f2 GUI2: added code for minimal buttons (buttons sans background) 2016-03-23 07:49:11 +11:00
Charles Dang
e86cadfa72 Update CB project 2016-03-23 06:51:59 +11:00
Celtic Minstrel
620f7833b7 Update XCode project 2016-03-22 15:45:06 -04:00
Celtic Minstrel
ee80e66f95 Support delayed_variable_substitution= in [on_undo], [on_redo] 2016-03-22 15:35:16 -04:00
gfgtdf
0ac0981ffe remove unused cpp files. 2016-03-22 20:30:43 +01:00
gfgtdf
f759649349 fix assertion failues on remove_row() for horizontal listboxes 2016-03-22 20:30:43 +01:00
Charles Dang
bbc956998c Use a transient message for the 'cannot end turn yet' popup 2016-03-23 02:00:36 +11:00
Charles Dang
34a0b8197b Fixed compilation post-AI refactor 2016-03-23 01:57:35 +11:00
Celtic Minstrel
cd2151ac1f Remove extraneous error message in FormulaAI 2016-03-22 10:38:57 -04:00
Celtic Minstrel
2ed5e7815f MicroAIs: Fix those that honour the avoid aspect improperly
This affects the Hang Out and Fast MAIs.
2016-03-22 07:22:22 -07:00
Celtic Minstrel
b789391bfb Fix crash if a Lua avoid aspect returns an invalid value 2016-03-22 07:22:22 -07:00
Celtic Minstrel
895a326a70 Fix merging of default facets with composite values
Now the last [value] tag wins.
2016-03-22 07:22:22 -07:00
Celtic Minstrel
cb0fad078a WML unit tests for simple aspects 2016-03-22 07:22:22 -07:00
Celtic Minstrel
d00cc80076 Safeguard against accidentally registering an AI component twice 2016-03-22 07:22:22 -07:00
Celtic Minstrel
e97026b407 Double-register the recruitment_instructions aspect under the name recruitment.
This is now possible because the [value] tag in recruitment_instructions has become optional.
Thus, any valid old recruitment aspect is also a valid new recruitment_instructions aspect.
2016-03-22 07:22:22 -07:00
Celtic Minstrel
cde7041b5f Make all default components always have id "default_facet".
This is mainly so that they are easily identified in the AI components overview in the gamestate inspector,
but it can also be used with [modify_ai]. (It replaces the previous use of * for this.)
2016-03-22 07:22:22 -07:00
Celtic Minstrel
ef880c80c6 Allow adding and removing recruitment jobs (and limits) with [modify_ai]
Also some minor syntax simplifications:
- If no [recruit] tag is provided, a default is added (as if with importance=0 and no other attributes)
- [pattern] and [total] tags expand to [recruit] with the attribute of the same name set to yes
2016-03-22 07:22:22 -07:00
Celtic Minstrel
aa791cec19 Fix nested calls to AI action handlers clobbering the ai table
(For example, if a Lua candidate action queries a Lua aspect.)
2016-03-22 07:22:22 -07:00
Celtic Minstrel
3939d2a4f2 Check for code= before value= in Lua aspects 2016-03-22 07:22:22 -07:00
Celtic Minstrel
5954e3f2f4 [modify_ai]action=change now automatically inserts an id= key if not present
Also when changing an aspect, name= is inserted if not present.
2016-03-22 07:22:22 -07:00
Celtic Minstrel
155d7007c9 Produce error message when attempting to write to ai.aspects 2016-03-22 07:22:22 -07:00
Celtic Minstrel
c86b4ee5a9 Implement invalidate_on_tod_change for aspects 2016-03-22 07:22:22 -07:00
Celtic Minstrel
b4720562fa Generalize/fix some aspect stuff
- Facets no longer have to be standard aspects - they can be lua aspects or even a nested composite aspect
- Ensure aspect tags from simplified aspect contain name=composite_aspect (normally not a problem, but could be in some unusual cases)
- Merge default aspect tags instead of simply taking the first one
- Fix crash that occurred if a composite aspect somehow lacked a default (an unusual case, but not impossible)
- Fix Lua aspects
- Fix simple Lua aspects (with value= instead of code=) quoting numeric values
- Ensure Lua aspects always have name=lua_aspect and standard aspects always have name=standard_aspect
- A few additional [modify_ai] cases:
    - aspect[id].facet[*] matches the default facet; this facet can be changed but not deleted, and if it's composite, subfacets can be referenced
    - action=change works on aspects (with path=aspect[id]); requires the new aspect to have matching id= key
    - aspect[id].facet[id].facet[id] etc works in the case of more deeply nested aspects (or even aspect[id].facet[*].facet[id])
2016-03-22 07:22:22 -07:00
Celtic Minstrel
597ab40a2c Fix Lua AI component return values being lost 2016-03-22 07:22:22 -07:00
Celtic Minstrel
c49fc8a72b Fix wesnoth.debug_ai()
(Also change some internal variable names)
2016-03-22 07:22:22 -07:00
Celtic Minstrel
1d7c1c74f6 Improve backwards compatibility for Lua AI
This changes the following:
- Fixes the experimental AI, without changing any of its code except for that in the [engine] tag
- Returns a dummy self from the dummy Lua engine, so that external CAs are more easily switched to using [params]
- Changes the order in which parameters are passed to AI component code. The order is now:
        state/self,    params,    data
2016-03-22 07:22:22 -07:00
Celtic Minstrel
e2cbe50781 Allow external Lua CAs to use [params] instead of {exec,eval}_parms 2016-03-22 07:22:22 -07:00
Celtic Minstrel
d0e3bc6a70 Change syntax of fallback stage
I've done this avoid giving the illusion that it merely loads another composite AI definition by its ID.
It can, of course, still be used to do so, if that's really what you want, but normally it should not be needed.
2016-03-22 07:22:22 -07:00
Celtic Minstrel
7c9e24aa29 Remove several deprecated recruitment-related aspects
- number_of_possible_recruits_to_force_recruit
- recruitment_ignore_bad_combat
- recruitment_ignore_bad_movement
2016-03-22 07:22:22 -07:00
Celtic Minstrel
ca8cb3bd6a Remove the deprecated recruitment stage, candidate action, and aspect 2016-03-22 07:22:22 -07:00
Celtic Minstrel
6972d5170f Add ai.aspects table which provides access to all aspects
The advantage of this over the get_* functions is that it will automatically
update whenever new aspects are added.

It doesn't support the deprecated recruitement aspect.
2016-03-22 07:22:22 -07:00
Celtic Minstrel
f8f5557eb0 Huge refactor of Lua AI engine
This commit potentially breaks any Lua AI customization, except for external Lua candidate actions.
In practice, though, Lua aspects and goals will probably continue to work for the most part.

- The ai table now has a read_only attribute.
  If true, functions that change the game state will be missing from the table.
  The read_only attribute is false in CA execution and in stages.
  It is true everywhere else.
- Every Lua AI component now supports a [args] subtag.
  The contents of this tag are passed as parameters to the component code.
  This data is immutable; components cannot alter its contents.
  (External Lua candidate actions do not receive this data.)
- Accessing the persistent engine data is now supported in all Lua components.

When calling a Lua component, the Lua engine now passes two parameters:
1. The contents of the [args] tag in the specific component.
2. The contents of the [data] tag in the Lua [engine].

The return value of the [engine] code, if any, is stored for later used.
It will be passed as the third parameter to any other Lua component.
This data can be changed, but will not be saved.
The default engine does not return any such data.
2016-03-22 07:22:22 -07:00
Celtic Minstrel
56a99175da Fix main_loop stage being duplicated in MP 2016-03-22 07:22:22 -07:00
Celtic Minstrel
f545fbcbe8 Remove deprecated [goal]name=protect_my_unit 2016-03-22 07:22:22 -07:00
Celtic Minstrel
bcbba6dde3 Change ID of Idle AI 2016-03-22 07:22:22 -07:00
Celtic Minstrel
4f710ea805 Allow Lua goals to set target types as descriptive strings instead of opaque integer values 2016-03-22 07:22:22 -07:00
Celtic Minstrel
b04cca2b30 Special handling for [recruitment] tag in AI config 2016-03-22 07:22:22 -07:00
Celtic Minstrel
f57343d6f1 Minor simplification of AI config parsing 2016-03-22 07:22:22 -07:00
Celtic Minstrel
08b11139a1 Log useful error messages (and don't crash) when creating a goal with the wrong engine 2016-03-22 07:22:22 -07:00
Celtic Minstrel
852a25593e Split gamestate inspector AI config up by component type 2016-03-22 07:22:22 -07:00