- Replace ScriptInterface::RegisterFunction with
ScriptFunction::Register
- Mostly removing unused cmpPrivate*
- Some usage introduces specific getters (mapgenerator, AIWorker,
XmppClient,...)
- Several passthrough functions are simply removed in favour of calling
the original, reducing duplication
- Make use of ScriptRequest/ScriptInterface capabilities where
relevant.
- Make JSI_* headers only expose necessary functions, lightening them
considerably and reducing duplication
- Reuse namespaces in JSI_* implementations directly, reducing visual
noise there
Follows f3aedf88a6
Differential Revision: https://code.wildfiregames.com/D3626
This was SVN commit r24983.
- HandleValue needed to explicitly pass UndefinedHandleValue for
'default' arguments.
- Allow passing ScriptInterface as first argument.
- Statically check that a getter is provided for object methods instead
of crashing at runtime
- A few stylistic improvements
Differential Revision: https://code.wildfiregames.com/D3625
This was SVN commit r24981.
Introduce a LOS_TILE_SIZE, to replace usage of TERRITORY_TILE_SIZE in
the LOS code.
This makes it possible to change the resolution of LOS/Terrain without
affecting the other component.
Additional refactoring:
- LosTile has been renamed LosRegion (it's more comparable to the
hierarchical pathfinder regions/spatial subdivisions)
- LosState explicitly refers to "los vertices" instead of terrain
vertices.
Refs #5566
Differential Revision: https://code.wildfiregames.com/D3076
This was SVN commit r24980.
This implements necessary tooling to create a simple SP campaign.
The architecture is intended to be easily extensible in the future.
'Campaign Run' contains the metadata of a campaign, e.g. maps
played/won. It's saved in the user folder under
saves/campaigns/*.0adcampaign
Campaign templates are JSON files in campaigns/
Campaigns can specify which Menu interface they will use. This is
intended to allow more complex layouts/presentation.
For now, a simple list interface is provided. This allows making
campaigns without any fancy art required (and effectively mimics AoE1's
campaign interface).
The behaviour on game end is also intended to be extensible, supporting
things such as carrying over units between scenarios - for now, it
simply records won games.
GameSetup is not available for now - scenarios are triggered with the
settings defined in the map/default settings. Improving on this requires
refactoring the gamesetup further.
The load/save game page has been extended slightly to support
showing/hiding campaign games (campaign gamed are saved under saves/
directly, there is no strong motivation to do otherwise at this point)
Closes#4387
Differential Revision: https://code.wildfiregames.com/D11
This was SVN commit r24979.
Fixes d038b3c4f2, by partially reverting it.
If the new order is rejected, PushOrder() will call FinishOrder. If
there are no more orders on the queue, this calls SetNextState("idle"),
with the intention os switching the unit to IDLE. However, this only
works from within an FSM call, and thus does nothing if a new command
gets rejected.
The problem is that this.order/this.orderQueue is already replaced by
the point the order is rejected when called via ReplaceOrder. Ideally,
this would not happen (but doing so isn't trivial).
The current code avoids having 2 different ways to reject an order, thus
isn't a complete revert of d038b3c4f2. It triggers an IDLE re-entry that
wasn't there before if the unit is IDLE when it receives the rejected
order, which at the moment basically never happens.
Refs #5771 (reopened)
Reported by: gameboy
Comments by: Freagarach, Angen
Differential Revision: https://code.wildfiregames.com/D3618
This was SVN commit r24978.
All modern browsers block ajax request to local file.
This changes extract.pl to generate a single HTML file with data
embedded.
This is now the default behaviour, --to-json to export, --from-json to
load exported.
Patch by: nwtour
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3621
This was SVN commit r24975.
Since slaughter kills animals in one strike since 3d61c227f3, domestic
animals can now be set to flee when attacked by anything else than
slaughter, like area damage or stray missiles.
Original patch by: @elexis
Differential revision: D193
Comments by: @mimo, @wraitii
This was SVN commit r24973.
The new methods:
- aren't included in ScriptInterface.h directly, lightening that header
- don't use boost CPP
- don't need argument types or number or constness to be specified
- can work with object methods somewhat transparently
- support optional cmptPrivate (allowing removal of many UNUSED macro)
- support optional const ScriptRequest&, which is safer.
This first diff changes only some of the JSI files & the component
manager. Further diffs will update other files and finally delete the
current code.
Differential Revision: https://code.wildfiregames.com/D2818
This was SVN commit r24969.
Improve the explicitedness of the following error.
Reviewed By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3614
This was SVN commit r24967.
- Adds a function to generate a 'debug' catalog. This prepends 'X_X '
to strings, to make it obvious in-game which are translated and which
aren't, while still remaining usable.
- cleans up the code and formats to PEP8 properly (except for line
lengths).
Differential Revision: https://code.wildfiregames.com/D3617
This was SVN commit r24966.
Allows entities to change their resource amount over time, possibly with
some constraint.
This is a not-so-bare minimum, but can certainly be improved and/or
extended later.
Part of: #1973
Original patch by: @smiley
Redone by: @Stan
Standing on the shoulders of giants: @Freagarach
(Revisions: 59; Inlines: 209)
Differential revision: D1718
Comments by: @Angen, @elexis, @Imarok, @Langbart, @nani, @Nescio,
@smiley, @Stan, @wraitii
This was SVN commit r24963.
This adds a new endpoint to the RL interface for evaluating custom
JavaScript. When combined with the ability to create arbitrary
modifiers, this provides the required functionality for exploring
quantitative game balancing.
Patch By: irishninja
Fixes#5981
Differential Revision: https://code.wildfiregames.com/D3479
This was SVN commit r24962.
- PushOrderFront could lead to an infinite loop if walking fails.
- Move units in formation before issuing the move order (or the
formation may not exist).
Differential Revision: https://code.wildfiregames.com/D3411
This was SVN commit r24961.
Basically removed in 3521c8f51e, now brought back :) (But split from the
population space.)
Differential revision: D2056
Comments by: @Angen, @Nescio, @Stan, @wraitii
This was SVN commit r24960.
Since its introduction in b2f4b0f494 garrisoned entities were not
allowed to upgrade (b2f4b0f494#inline-4821) but that is not needed (at
least since 4fadd75ace).
Changing templates to anything not being able to garrison will still
fail (#5906) but that can also be done with this code.
Differential revision: D3251
Comment by: @bb
This was SVN commit r24958.
Take some responsibility from GarrisonHolder to where it belongs
(Garrisonable).
Differential revision: D3223
Comments by: @Stan, @wraitii
This was SVN commit r24957.
In our current UnitAI implementation, the states are responsible for
whether we are moving or not. If a request to stop moving is made from
outside the state that initiated the moving order that is (mostly)
wrong. This fixes that.
Differential revision: D3289
Comment by: @wraitii
This was SVN commit r24954.
18b317bc19 (#563) introduced an ANIMAL-state from a separate
AnimalAI-component (introduced in e19146cf25).
This patch merges that separate state and brings the ROAMING and FEEDING
(renamed to LINGERING) under the INDIVIDUAL.IDLE-state.
This enables e.g. city-building mods to have human units that linger and
roam or animals that behave like humans.
The specific values for animals might need tweaking after this.
Differential revision: D2646
Fixes: #1832, #5593
Comments by: @Angen, @Langbart, @Nescio, @Stan, @wraitii
Refs.: #3919
This was SVN commit r24953.
The 'controller' of an MP game (the host in general, though dedicated
servers would change that) is currently whoever first tells the server
that it is. This can be abused since it relies on trusting the clients.
This changes that logic: the server defines a 'controller secret', and
the first client to sent the correct controller secret is the
controller. This is safe assuming the secret is unknowable enough (the
current solution wouldn't pass strict cryptography tests, but it's
likely good enough).
Reverts 1a3fb29ff3, which introduced the 'trust the clients' mechanic,
as a change over 'the first local IP is controller'.
Necessary step towards dedicated server, if we want to use the regular
gamesetup (Refs #3556)
Differential Revision: https://code.wildfiregames.com/D3075
This was SVN commit r24952.
Ports 1-1023 are privileged and shouldn't be accepted by the GUI.
Patch by: DynamoFox
Differential Revision: https://code.wildfiregames.com/D3574
This was SVN commit r24949.
The spawn code should not assume that obstructions will never be
0-sized.
Reported by: Zack
Fixes#6039
Differential Revision: https://code.wildfiregames.com/D3583
This was SVN commit r24945.
Also incorporate retry improvements by Stan
Reported by: madPilot
Differential Revision: https://code.wildfiregames.com/D3585
This was SVN commit r24944.
ParticleManager uses <list> which has recently become unincluded.
Differential Revision: https://code.wildfiregames.com/D3589
This was SVN commit r24936.
The formation is set to an empty state upon disbanding which does not
have a `MEMBER`-substate.
Caused by c57a4d90a1.
Fixes: #6052
Differential revision: D3588
Reviewed by: @wraitii
This was SVN commit r24935.
There were errors in the spanish manual, and clipping issue in the
gamesetup tips text.
Refs #6024 (partly fixed)
Fixes#6027
Differential Revision: https://code.wildfiregames.com/D3573
This was SVN commit r24930.
file="" properties were not overriden by other things defined in the
actor, which lead to weird edge cases, such as frequency="0" variants
being loaded because their names="" ended up matching their parent's
name=""
Also remove the name because it doesn't serve a purpose
Accepted by: @wraitii
Differential Revision: https://code.wildfiregames.com/D3572
This was SVN commit r24929.
- Remove not included languages from the installer.
- Add credits for other languages, even if they are not included.
Differential Revision: https://code.wildfiregames.com/D3568
This was SVN commit r24927.