Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 [2]

Author Topic: Ships and weapons property  (Read 10614 times)

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24105
    • View Profile
Re: Ships and weapons property
« Reply #15 on: July 22, 2011, 08:44:05 AM »

Post the .variant and AA_double.wpn files?

"hardpointOffsets" is just the coordinates for where the shots come from when the weapon is in a hardpoint-type slot. The coords are relative to the center of the weapon, which is the center of the left half of the sprite, with the business end of the weapon pointing to the right (i.e., 0 degrees).

"turretOffsets" is the same, but used when the weapon is in a turret slot, and is relative to the center of the sprite.
Logged

moffrevenge

  • Ensign
  • *
  • Posts: 24
    • View Profile
Re: Ships and weapons property
« Reply #16 on: July 22, 2011, 12:05:19 PM »

.variant:

{
   "displayName":"Attack",
   "hullId":"ex2_red_tempest",
   "variantId":"ex2_red_tempest_Attack",
   "fluxVents":0,
   "fluxCapacitors":0,
   "mods":[], # array of strings
   
   # mode is either LINKED or ALTERNATING
   # slot ids (WS ***) must match what's in the .ship file
   "weaponGroups":[
      {"mode":"LINKED",
       "weapons":{
                "WS 001":"AA_double",
               "WS 002":"AA_double",
                },
      },
   ],
}

AA_double.wpn:

{
   "id":"AA_double",  # this id must match what's in the spreadsheet
   "specClass":"projectile",
   "type":"BALLISTIC",
   "size":"MEDIUM",
   "displayArcRadius":400,
   "turretSprite":"graphics/ex2/weapons/AA_base.png",
   "turretGunSprite":"graphics/ex2/weapons/AA_cannon.png",
   "hardpointSprite":"graphics/ex2/weapons/AA_Hardpoint.png",
   "hardpointGunSprite":"graphics/ex2/weapons/AA_cannon.png",   
   "visualRecoil":2.0,  # the gun sprites are only used if this is non-0
   "renderHints":[RENDER_BARREL_BELOW],
   "turretOffsets":[18, -7, 18, 7],
   "turretAngleOffsets":[0, 0],
   "hardpointOffsets":[5,5,5,5],
   "hardpointAngleOffsets":[0, 0],
   "barrelMode":"LINKED", # or LINKED.  whether barrels fire at the same time or alternate.
   "animationType":"MUZZLE_FLASH",  # NONE, GLOW, MUZZLE_FLASH, SMOKE
   "muzzleFlashSpec":{"length":40.0,   # only used if animationType = MUZZLE_FLASH
                  "spread":25.0,
                  "particleSizeMin":8.0,
                  "particleSizeRange":8.0,
                  "particleDuration":0.12,
                  "particleCount":46,
                 "particleColor":[255,155,75,245]},
   "projectileSpecId":"dualflak_shot",  # projectile that will be fired
   "fireSoundTwo":"gun_light_flak",   
}
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24105
    • View Profile
Re: Ships and weapons property
« Reply #17 on: July 22, 2011, 01:12:29 PM »

Ahhh. This line:

"projectileSpecId":"dualflak_shot"

You also have to create a separate definition for the shot.
Logged

moffrevenge

  • Ensign
  • *
  • Posts: 24
    • View Profile
Re: Ships and weapons property
« Reply #18 on: July 22, 2011, 01:24:47 PM »

Hoooo thanks a lot it work :D but i dont understant why i can't use 1 shot for 2 weapon :S
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24105
    • View Profile
Re: Ships and weapons property
« Reply #19 on: July 22, 2011, 02:05:56 PM »

Because the range is a property of the shot, and each weapon using it sets it. You could use the same shot if they had the same stats - range/damage/etc. I really ought to either move the shot definition into the .wpn file at some point, or let different weapons use the same shot with different stats...


Glad it finally works :)
Logged

moffrevenge

  • Ensign
  • *
  • Posts: 24
    • View Profile
Re: Ships and weapons property
« Reply #20 on: July 25, 2011, 02:13:10 AM »

Humm an other question how the collisionRadius work?? if my ship is 300 of lenght, collisionRadius is 300 too??
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24105
    • View Profile
Re: Ships and weapons property
« Reply #21 on: July 25, 2011, 09:02:04 AM »

The collision radius, together with the center of rotation for the ship, define a circle which is used as part of collision checking. The radius needs to be large enough to cover the sprite, but not too large or it'll cause some inefficiency.
Logged
Pages: 1 [2]