UFO: Alien Invasion Issue Tracker
UFO: Alien Invasion
Go to the previous open issue
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
icon_project.png UFO: Alien Invasion / Closed Bug report #2943 angles key not understood for most ent., script needed
Go to the next issue (open or closed)
Go to the next open issue
This issue has been closed with status "Closed" and resolution "Not determined".
Issue basics
  • Type of issue
    Bug report
  • Category
    Maps
  • Targetted for
    Not determined
  • Status
    Closed
  • Priority
    4. Useful
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (0)
There are no items
People involved
Times and dates
  • Posted at
  • Last updated
  • Estimated time
    Not estimated
Issue details
  • Resolution
    Not determined
  • Reproducability
    Not determined
  • Severity
    Not determined
  • Complexity
    Not determined
  • Platform
    Not determined
  • Architecture
    Not determined
Attachments (0)
There is nothing attached to this issue
Duplicate issues (0)
This issue does not have any duplicates
Description
[http://sourceforge.net/p/ufoai/bugs/2943 Item 2943] imported from sourceforge.net tracker on 2013-01-28 19:54:51

Hey Sandro.
I hope you can help me with a problem I've introduced...
I would need help fixing it.
I fixed the model rotation problem with the angle -> angles commit.
But I broke rotation for the actors and other entities on the battlescape with the model rotation fix...
The key 'angles' is not understood for info_human_start, info_player_start, info_alien_start, info_civilian_start, info_2x2_start, func_rotating...
I hope I got all of them ;)
This must be fixed in the map files and therefore has to be done via script.
We can fix it with a script that changes -"angles" "0 0 - to -"angle" "- for all entities except models.
I need help to make this script.
A modified version of map_scale_textures.py could imho do this job. Can you please help with this ?
===== Comments Ported from Sourceforge =====

====== tlh2000 (2011-07-07 05:39:12) ======

i don't see how a modified version of a the texture scale script could help here.

what is the state mcr? did you already start to fix them? this is something that should really be fixed by you before we release 2.4
====== mcr2010 (2011-07-07 11:07:55) ======

state: unchanged.

====== alextishin (2011-07-07 20:23:17) ======

I guess MCR points to the fact that that script uses a module which completely parses .map and reassembles it back. So, derivatives of said script could selectively modify any entity fields.

MCR, what exactly the nature of changes you want to make? I have not enough free time nowadays, so please write comprehensive spec if you want me to create that script.
====== mcr2010 (2011-07-08 11:36:07) ======

Hey Sandro.
Thanks for your answer.

The script should parse all map files and search for the entity key *"angles" "0 0 * and replace it with *"angle" "* in all cases, except when the entity is a model, then the script should NOT change anything, because for models "angles" is valid.

That means if the script finds for example "angles" "0 0 55" and the entity is not a model it should change it to "angle" "55", because the key "angles" is just understood for models, but not for the other entities...

I hope this explanation and specification for the script is exact enough, otherwise just ask.
====== alextishin (2011-07-08 20:22:05) ======

MCR: thanks, I understand the idea now. Could you provide a full list of entity types which should have the "angles" key unchanged? The ones you call models? I'm not familiar with that part of code.
====== mcr2010 (2011-07-09 08:23:23) ======

JUST the entities with the "classname" "misc_model" should have the "angles" key unchanged.
====== mcr2010 (2011-07-21 08:45:57) ======

If this is the reason for 2.4 being delayed and you cannot help me here with the script, Sandro, I could fix that manually also...

I would first exchange all of the '"angles" "0 0 ' occurencies to '"angle" "' and then in a second step search for models within the maps file which use the "angle" key and manually change those back to "angles".
This would mean quite a bit of work for me, but could ofc. be done.

Another possibility would be to revert the commit that caused this bug to happen, but

1) I do not know if this task could be done without causing bugs, because many of the map files have been changed afterwards (but should somehow be possible with git).
2) It would bring back the bug that many of the models were displayed with wrong rotation in UFORadiant, because UFORadiant does not understand the "angle" key for model entities anymore (just "angles").

So this would not be a good solution for the problem.

A third solution would be to find a good search and replace program which would allow me to define exact rules for replacement (all entities except models) inside the map files, but I do not know any program capable to do this...

A coding solution would be to simply make UFORadiant also understand/interpret the entity key "angle" for models also, then I could simply search and replace all of the "angles" keys, which have the form '"angles" "0 0 ' and replace them with '"angle" "' and all would be fine as only the models with just z-rotation would be changed, the other "angles" keys changing more than one axis rotation would be left untouched (just models use this possibility to rotate around more than just the z-axis).

IMHO that would be the most elegant solution for this problem.
====== alextishin (2011-07-23 15:04:46) ======

The script to solve the problem
====== alextishin (2011-07-23 15:08:22) ======

Attached the script which should do what is requested. Will not add it to the repo since it's a one-time thing.

Please clean up the commits made after running this script -- it shuffles entity fields causing false diffs (should REALLY fix that in ufomap_io.py library).
Steps to reproduce this issue
Nothing entered.
Todos (0 / 0)
Issue created
footer_logo.png The Bug Genie 4.3.1 | Support | Feedback spinning_16.gif