Jump to content

Splizard

Community Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by Splizard

  1. Are there any concerns about non-deterministic behavior in Javascript code, or is it guaranteed to be deterministic for modders?
    For example 'for ... in' loops do not guarantee the same iteration order (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in#Array_iteration_and_for...in).
    Should this concern me when I am creating Javascript components?
    (I am aware that the GUI Interface is not allowed to affect game state).

  2. 11 minutes ago, stanislas69 said:

    Could you share your script ? Maybe the way the coordinates are scripted makes them relative to the scale factor, hence giving you the strange effects.

    So I have currently modified the scale tags in a few of the female citizen models.
    https://github.com/0ad/0ad/blob/master/binaries/data/mods/public/art/animation/biped/new/fem_walk_relax.dae
    https://github.com/0ad/0ad/blob/master/binaries/data/mods/public/art/meshes/skeletal/new/f_dress.dae

    I have played around with the values (eg. all being the same value, or trying different values). The snippets are below.

    fem_walk_relax.dae
    <node id="Armature" name="Armature" type="NODE">
      	...
          <scale sid="scale">0.75 0.01 0.5</scale>
    
    <node id="m_armor_tunic_short" name="m_armor_tunic_short" type="NODE">
      	...
          <scale sid="scale">0.1 0.01 0.5</scale>
      
     f_dress.dae:
    <node id="f_dress" name="f_dress" type="NODE">
    	...
          <scale sid="scale">0.1 0.25 0.5</scale>
        
    <node id="Armature" name="Armature" type="NODE">
       	...
          <scale sid="scale">0.1 0.25 0.5</scale>

    As far as a script goes, it simply multiplies every number in the "mesh-positions-array" with the scaling factor and then saves the file again.

    This may be the wrong way to go about it, however, it has worked with static meshes.

  3. 1 hour ago, stanislas69 said:

    Maybe the scale modifiier is not 1.1.1 for all meshes ?

    Changing the scale ratios does have an effect to some extent, however, it does not appear to resolve the proportion issue (I'm not talking to about the head though, which is a separate actor which I have not scaled). The model is scaled to the correct height but it seems like everything is stretched when made taller and everything is squashed when made smaller.

  4. I am trying to figure out how to change the scale of an animated actor. It doesn't appear to be a moddable feature, so I have been modifying the .dae files in order to attempt to accomplish this.

    For static actors (such as buildings), the scale can be adjusted either by adjusting the scale tag in the Collada file.

            <scale sid="scale">1 1 1</scale>

    The other option I took was to write a program that manually scales all the vertices of the model and saves this back to the .dae model.
    Unfortunately, both of these options did not work for scaling animated actors whose proportions were all messed up... (Big or Small)0ad.thumb.png.cef9f9b20ff6bba7cfb1d9eadd41ee26.png

    I am not so familiar with Collada or how animations are stored. Could anyone point me in the right direction on how to accomplish something like this? (do I need to scale the armatures/transformations/weights etc) Blender did not work very well for me either...
    I am really looking for a way to automate this, as I would like to create an actor editor for 0ad with this kind of feature. Thanks!

    • Like 3
×
×
  • Create New...