#1311 closed defect (fixed)
[PATCH] Update wall_builder and add wall_demo random map
Reported by: | FeXoR | Owned by: | leper |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 10 |
Component: | UI & Simulation | Keywords: | rmgen, fix, update |
Cc: | Patch: |
Description
Updated rmgen lib wall_builder.js:
- Updated to new object placement in random maps
- Updated to new walls and towers of celt, hele and iber
- Tidied and documented code
- Added linear and circular wall placement functions
Fix random map fortress:
- Updated to the new method that fixes the poor placement since object placement changed
Added wall_demo random map as an code example
I still don't know what component to choose...
Attachments (7)
Change History (15)
comment:2 by , 12 years ago
Updated patch to 11430
- Added wall style 'romanSiege'
- Added 'others' to wall styles including fences, columns, benches, tables, flags, ...
- Fixed a minor bug that raises warnings when the last wall elements entity was 'undefined'
- Added and clarify documentation
I'm to impatient x)
comment:3 by , 12 years ago
Fixed the house placement for random map 'fortress'. Playtested and all get 50 population cap at start but Celts. Celts get 54 but I think it's better then 49 with one house less. Celtic fortresses only add 12 instead of 15 population cap anyway. And it was like that before. The 4 additional population cap comes from the barracks. THX much, Leper, for finding this!
by , 12 years ago
Attachment: | deep_forest.js added |
---|
by , 12 years ago
Attachment: | fortress.js added |
---|
by , 12 years ago
Attachment: | wall_builder.js added |
---|
by , 12 years ago
Attachment: | wall_demo.js added |
---|
by , 12 years ago
Attachment: | wall_demo.json added |
---|
comment:4 by , 12 years ago
The game was updated many times but AFAIK none of the files I edited. But just to make sure everything works fine with the update I added any single file changed as it should look after the patch. This ticked replaces Ticket #1288. Sorry for the 'double ticket'.
by , 12 years ago
Attachment: | wall_builder_update.diff added |
---|
Patch for wall_builder.js, fortress.js, wall_demo.js, wall_demo.json, deep_forest.js and deep_forest.json
comment:5 by , 12 years ago
Component: | Core engine → UI & Simulation |
---|
Some comments:
Move the comments after the function definition and before the opening brace in front of the function. Remove (or start to) the unneeded semi-colons.
wall_builder.js
You have some strange symbols (in the comments with the degree sign).
I'd replace the definitions in WallElement and other functions with ternary operators as in this.angle = (angle !== undefined) ? angle : 0*PI;
.
line 293 typo 'exsists'
You should use === to check if something is undefined (as noted in our coding conventions).
That are just some things I noticed while reading some of the code.
comment:6 by , 12 years ago
- Removed all semicolons after closing brackets of function, for, while, if and else
- Moved the comments from between function definition and opening brackets befor the function definition
- Separated different parts of documentation more clearly
- Removed the angles in degree from documentation
- Removed the type 'exsists' -> 'exists'
- Changed ' == undefined' -> ' === undefined'
- Changed to ternary operators
NOTE: A patch was added concerning most random maps while I edited including fortress.js. So I choose another filename for the patch: wall_builder_update2.diff. For me the patch applied cleanly after: revert -> deleting added files -> update -> patch
If I don't delete added files applying patch states:
Rejected patch hunks for 'wall_builder.js'
--- binaries/data/mods/public/maps/random/rmgen/wall_builder.js
+++ binaries/data/mods/public/maps/random/rmgen/wall_builder.js
It's even stranger cause the added files are wall_demo.js/.json and NOT wall_builder.js...
by , 12 years ago
Attachment: | wall_builder_update2.diff added |
---|
comment:8 by , 12 years ago
Keywords: | review removed |
---|---|
Milestone: | Backlog → Alpha 10 |
Thanks for the patch.
Further changes:
You'r to slow ;)