1
0
forked from 0ad/0ad
Commit Graph

37 Commits

Author SHA1 Message Date
78764926f8 Fix 9fc6c3c897 - Set entity/template before deserializing.
Following 9fc6c3c897, components Deserialize() was called before
entity/template were set, which is incorrect.

Refs #4698.

Differential Revision: https://code.wildfiregames.com/D3337
This was SVN commit r24561.
2021-01-12 16:15:40 +00:00
9fc6c3c897 Correctly serialize/deserialize user-defined JS objects.
Generalize component/AI serialization system to any user-defined JS
object. This includes Vector2D/3D, fixing an old issue.
As with components/AI, JS Objects may implement a Serialize/Deserialize
function to store custom data instead of the default, which attemps to
serialize all enumerable properties.

Fixes #4698

Differential Revision: https://code.wildfiregames.com/D2746
This was SVN commit r24462.
2020-12-27 17:18:13 +00:00
7f77cf2f3e Move PopulationBonus from cmpCost to new cmpPopulation.
Since PopBonus is not a cost.

Patch by: @lonehawk
Differential Revision: D2948
Comments by: @Angen, @Nescio, @wraitii
Closes #4081

This was SVN commit r24394.
2020-12-14 18:17:59 +00:00
25490bfec3 Improve JS Exception handling.
- Check for pending exceptions after function calls and script
executions.
- Call LOGERROR instead of JS_ReportError when there is a conversion
error in FromJSVal, since that can only be called from C++ (where JS
errors don't really make sense). Instead, C++ callers of FromJSVal
should handle the failure and, themselves, either report an error or
simply do something else.
- Wrap JS_ReportError since that makes updating it later easier.

This isn't a systematical fix since ToJSVal also ought return a boolean
for failures, and we probably should trigger errors instead of warnings
on 'implicit' conversions, rather a preparation diff.

Part of the SM52 migration, stage: SM45 compatible (actually SM52
incompatible, too).

Based on a patch by: Itms
Comments by: Vladislavbelov, Stan`
Refs #742, #4893

Differential Revision: https://code.wildfiregames.com/D3093
This was SVN commit r24187.
2020-11-15 18:29:17 +00:00
0f91c5ac61 Rename Armour to Resistance and change the way it is processed.
- Renames Armour-node to Resistance.
- Support resistance against Capture.
- Puts resistance against effects in separate nodes.
- Some cleaning.

Differential Revision: D2229
Reviewed by: @bb (accepted), @wraitii.
Comments by: @Stan, @Nescio.
This was SVN commit r24001.
2020-08-27 10:24:59 +00:00
eb6f14a82d AI prototype chain cleanup.
Use prototype = Object.create(parent) instead of prototype = new
parent(...) to avoid calling the constructor needlessly (as it is
redundant with the base constructor call in the constructor calls the
parent constructor).

Testfile reference comes from 7c2e9027c2,
"initial terrible AI player scripts" had it since 57e5bb878a,
jubot copied it since 02ed11ac54,
qbot copied it since b146f53d7b
qbot-wc (later aegis) copied it since 45ee419171,
aegis copied it since bcf7115b5c,
petra copied it since 97afd25171.

d23b7deb98 used Object.create correctly for new code in aegis that was
adopted for petra too in 97afd25171.

Differential Revision: https://code.wildfiregames.com/D2238
Patch By: Krinkle
This was SVN commit r22834.
2019-09-02 17:33:59 +00:00
6230bbea24 Update of the scripting tests. Test some modding features and update JS::Value integer limits.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1850
This was SVN commit r22513.
2019-07-19 15:41:27 +00:00
65b02395b3 Remove Vector2D/Vector3D prototype workaround from EngineScriptConversions.
Fixes #5376, refs #2394.
Differential Revision: https://code.wildfiregames.com/D1991
Patch By: Krinkle
Comments By: Vladislav, wraitii
This was SVN commit r22487.
2019-07-16 21:52:49 +00:00
bb
3a77eb25d3 Fix ESLint semicolon-related warnings
Patch By: Krinkle
Differential Revision: https://code.wildfiregames.com/D2004
This was SVN commit r22419.
2019-07-01 11:09:19 +00:00
e472e539e2 Remove test templates that became unused with fd93e4ae74, refs #2951.
This was SVN commit r21621.
2018-03-26 14:34:35 +00:00
ff7511d9fc Move special_filter/ templates to special/filter/.
This should help with simplifying the (un)placeable filtering again.

Reviewed By: fatherbushido
Differential Revision: https://code.wildfiregames.com/D934
This was SVN commit r20242.
2017-09-30 07:14:35 +00:00
d093f714d7 Use XML files instead of hardcoded C++ code in the template manager to universally change template properties at load time.
Patch By: leper
Differential Revision: https://code.wildfiregames.com/D215
Fixes #2951

This was SVN commit r19302.
2017-03-16 19:56:12 +00:00
3008533c8e Add a template manager test that reveals an inheritance error in ParamNode.cpp which can trigger an OOS on rejoin. Patch by leper, refs #4316.
This was SVN commit r18941.
2016-11-15 13:51:29 +00:00
b18cd3254c Test FixedVector{2,3}D script conversions, and test calling functions of the prototypes.
Also ENSURE that the given value identifier is actually present in the
cache instead of creating one if it is not.

This was SVN commit r17603.
2016-01-04 21:41:40 +00:00
882f3406e3 Syncs _test.sim required simulation data with public mod, copies RelaxNG schemas for future use
This was SVN commit r15528.
2014-07-13 21:29:30 +00:00
29549561e1 Add flag to VisualActor for entities that should only be visible in Atlas. Patch by KareemErgawy. Fixes #1411.
This was SVN commit r13465.
2013-06-09 23:18:21 +00:00
99d04e93bb Implements global tech modification function. Fixes #1358, refs #1520.
Applies tech modifications to template data returned by GuiInterface.
Extends engine to load arbitrary global scripts, separates this from RNG
replacement. Refs #1193.
Loads global scripts for most script contexts for consistency.
Adds simulation tests for global scripts.

This was SVN commit r12056.
2012-07-03 02:16:45 +00:00
8fee3d8ef8 # New territory border rendering.
Add textured line overlay rendering.
Change terrain height calculations to be triangulation-dependent for
improved accuracy.
Add triangulation-dependent terrain normal function.
Support separate S/T wrap modes for textures.
Rename CVector2D_Maths since it no longer conflicts with simulation
CVector2D.
Coalesce freed chunks in vertex buffers, to avoid excessive
fragmentation.
Add some things to help debug vertex buffer allocation a little.

This was SVN commit r9929.
2011-07-30 00:56:45 +00:00
2c58b07223 # Add experimental fighter planes.
This was SVN commit r9605.
2011-06-09 19:44:40 +00:00
a122f55bde Avoid hardcoding the actor entity template details.
This was SVN commit r9183.
2011-04-06 21:01:00 +00:00
25524dc99f Fix tests
This was SVN commit r9080.
2011-03-18 19:35:31 +00:00
f4f36af852 Block new buildings being placed on top of existing not-yet-started foundations. Fixes #740.
This was SVN commit r8980.
2011-02-24 21:49:24 +00:00
b8925fbbc9 # Support AI construction of buildings.
Pass terrain passability data to AI scripts.
Expand pathfinder passability data to 16 bits per tile, to allow more
classes.
Support 16-bit ints in serializer.
Partially support JS typed arrays.
Allow foundations to be placed on top of units (fixes #499).
Stop farms and fishes blocking movement (fixes #534).
Add obstruction flags to allow finer control over what they block.
Associate entity IDs with obstruction shapes, to allow finding colliding
entities.
Support moving to the edge of a target entity with inactive obstruction.
Support foundation entities in AI.
Support playing as non-hele civs.

This was SVN commit r8899.
2011-02-10 16:06:28 +00:00
dd501b2a5a # Add initial basic player AI framework.
Support direct access to serializer streams, so serializers can be
nested.
Make component script "this.template" read-only.
Stop globally-subscribed component scripts receiving messages posted to
local components, to reduce out-of-sync risks.
Move pathfinder data out of entity template directory.
Fix GuiInterface deserialization.

This was SVN commit r8865.
2011-01-12 12:29:00 +00:00
bd3bd084c0 Support new SpiderMonkey API.
wposix: Define int8_t compatibly with SpiderMonkey.
Remove unused camera, lightenv JS interfaces.
Remove most of vector JS interface.
Remove some of the redundant JS string conversion functions.
Remove unneeded vmem, _lodBias functions.
Clean up some formatting.

This was SVN commit r8629.
2010-11-16 23:00:52 +00:00
d3048906cb # Unit animation improvements.
Animate props much more sensibly.
Move ammo code out of CUnit.
Move animation logic out of CModel.
Launch projectiles from the correct location.
Use entity's speeds and sounds in actor viewer.
Add -nosound option to disable audio, and allow audio by default in
Atlas.
Remove some obsolete options.

This was SVN commit r7609.
2010-06-05 00:49:14 +00:00
11a20e1bcf # Handle terrain passability and movement costs in pathfinder.
Simplify terrain code (remove Handle indirection).
Delete unused terrain properties.

This was SVN commit r7590.
2010-05-27 23:31:03 +00:00
47a03c3397 Replace JS_Enumerate with manual enumeration, to avoid its memory allocations.
Use LookupProperty to avoid having to check for getters.
Add a quicker method of rooting many script values.

This was SVN commit r7579.
2010-05-25 18:24:12 +00:00
5c3a59234c Fix OOS errors when placing buildings.
Allow script components to supply custom serialization objects.

This was SVN commit r7571.
2010-05-22 23:02:07 +00:00
434248167b Fix warnings in tests
This was SVN commit r7535.
2010-05-10 09:52:35 +00:00
cfae58928f # New unit movement system, which does a far better job of approaching targets and avoiding obstacles.
Add short-range vertex-based pathfinder.
Integrate new pathfinder into unit motion code.
Change obstruction system to get rid of circles, and differentiate
structures from units.
Make PositionChanged messages synchronous.
Try to prevent some accidental float->int conversions.

This was SVN commit r7484.
2010-04-29 23:36:05 +00:00
3117f52d7c # Automatic runtime validation of entity template files.
Fixes #413.

This was SVN commit r7455.
2010-04-14 17:22:32 +00:00
18b5a7f17c Add the Obstruction component to entity previews, to support collision detection for building placement
This was SVN commit r7360.
2010-03-17 23:02:40 +00:00
953fb41c82 # Basic in-game building placement with new simulation system
This was SVN commit r7285.
2010-01-24 17:24:35 +00:00
4fed9b8242 # Added initial support for players and population counters in new simulation system, plus various infrastructure improvements.
Merge from 22b478ffed8d.
Pure scripted interface definitions.
Entity creation from scripts.
Improved messaging system.
Messages on entity deletion.
Basic player entities.
Player ownership.
Bug fixes.

This was SVN commit r7281.
2010-01-22 20:03:14 +00:00
c8138208bf # Object creation in Atlas with new simulation system
Merge from 6e8efe8f706c

This was SVN commit r7276.
2010-01-14 20:36:29 +00:00
7c2e9027c2 # Rewrite of the game's simulation system
Giant merge from
http://svn.wildfiregames.com/hg-source/file/5fb522019d5e
Infrastructure is largely complete, gameplay is largely missing
Disabled by default; use command-line flag "-sim2"
(Second attempt at commit...)

This was SVN commit r7259.
2010-01-09 19:20:14 +00:00