View unanswered posts | View active topics It is currently Wed Aug 21, 2019 6:02 pm



Reply to topic  [ 14 posts ]  Go to page 1, 2  Next
Adding New Block Shapes 
Author Message

Joined: Mon May 04, 2015 10:08 am
Posts: 97
Reply with quote
Hey folks,

Has anyone else tried this out yet? I believe I've worked through the basics of adding a new block but I continue to receive the following error:

"game/shapes.cpp:1219:SerialBlock: :spec ASSERT(shape): invalid shape 'COUNT' with scale '1'"

I've even gone as far as to simply copy one of the existing block shapes and add it on at the end but the same error is received. I'm guessing adding shapes doesn't work correctly just yet but if anyone has been successful please fill me in!

Thanks in Advance,
- Ha11uc1n0g3n


Sat May 21, 2016 12:00 pm
Profile
User avatar

Joined: Fri Jan 24, 2014 10:11 pm
Posts: 1295
Location: Ames, IA
Reply with quote
...do you know about the mod development kit?

_________________
The game where I originated as a member of this community. . VISUAL BASED MOD KIT!!
Shellcore command EP2


Sun May 22, 2016 6:20 am
Profile

Joined: Mon May 04, 2015 10:08 am
Posts: 97
Reply with quote
If you're referring to TTFTCUTS RWDK then yes, used it quite a bit recently. However afaik and it doesn't support the very recent introduction of being able to create new block shapes as opposed to simply modding the block shapes that currently exist. According to the recent patch notes:

* Mods can now add new block shapes to the game instead of picking from a predefined list

In addition, the file "shapes.lua" now exists with some base notes on how to add shapes & whatever type of ports you would like to the game. So far I've just met with the above error though so I was hoping someone else maybe has had more success.


Sun May 22, 2016 10:38 am
Profile

Joined: Thu Mar 05, 2015 12:10 pm
Posts: 239
Reply with quote
Ha11uc1n0g3n wrote:
If you're referring to TTFTCUTS RWDK then yes, used it quite a bit recently. However afaik and it doesn't support the very recent introduction of being able to create new block shapes as opposed to simply modding the block shapes that currently exist. According to the recent patch notes:

* Mods can now add new block shapes to the game instead of picking from a predefined list

In addition, the file "shapes.lua" now exists with some base notes on how to add shapes & whatever type of ports you would like to the game. So far I've just met with the above error though so I was hoping someone else maybe has had more success.


I had even less success.


Attachments:
Reassembly_log_20160521_10.54.29.AM.txt [238.66 KiB]
Downloaded 235 times

_________________
Image
Sun May 22, 2016 11:47 am
Profile

Joined: Mon May 04, 2015 10:08 am
Posts: 97
Reply with quote
You can find the shapes.lua in your "C:\Users\Username\Saved Games\Reassembly\Data" folder. You may have to set the cvar kwriteBlocks = 1 for it to appear in the folder but keep in mind that leaving kwriteBlocks = 1 will rewrite the file and erase any changes you make to it.

[Reveal] Spoiler: Here's what the "COMMAND_MISSILE" looks like
-- COMMAND_MISSILE
{70, {{verts={{-5, 5}, {2.071, 5}, {5, 2.071}, {5, -2.071}, {2.071, -5}, {-5, -5}}, ports={{5, 0.5,
MISSILE}, {0, 0.5, MISSILE}, {4, 0.5, MISSILE}}},
{verts={{-10, 10}, {5, 10}, {10, 5}, {10, -5}, {5, -10}, {-10, -10}}, ports={{5, 0.5, MISSILE},
{0, 0.5, MISSILE}, {4, 0.5, MISSILE}}},
{verts={{-15, 15}, {7.5, 15}, {15, 7.5}, {15, -7.5}, {7.5, -15}, {-15, -15}}, ports={{5, 0.5, MISSILE},
{0, 0.5, MISSILE}, {4, 0.5, MISSILE}}},
{verts={{-20, 20}, {10, 20}, {20, 10}, {20, -10}, {10, -20}, {-20, -20}}, ports={{5, 0.5, MISSILE},
{0, 0.5, MISSILE}, {4, 0.5, MISSILE}}},
{verts={{-25, 25}, {12.5, 25}, {25, 12.5}, {25, -12.5}, {12.5, -25}, {-25, -25}}, ports={{5, 0.5,
MISSILE}, {0, 0.5, MISSILE}, {4, 0.5, MISSILE}}},
{verts={{-30, 30}, {15, 30}, {30, 15}, {30, -15}, {15, -30}, {-30, -30}}, ports={{5, 0.5, MISSILE},
{0, 0.5, MISSILE}, {4, 0.5, MISSILE}}},
{verts={{-35, 35}, {17.5, 35}, {35, 17.5}, {35, -17.5}, {17.5, -35}, {-35, -35}}, ports={{5, 0.5,
MISSILE}, {0, 0.5, MISSILE}, {4, 0.5, MISSILE}}},
{verts={{-40, 40}, {20, 40}, {40, 20}, {40, -20}, {20, -40}, {-40, -40}}, ports={{5, 0.5, MISSILE},
{0, 0.5, MISSILE}, {4, 0.5, MISSILE}}},
{verts={{-45, 45}, {22.5, 45}, {45, 22.5}, {45, -22.5}, {22.5, -45}, {-45, -45}}, ports={{5, 0.5,
MISSILE}, {0, 0.5, MISSILE}, {4, 0.5, MISSILE}}},
{verts={{-50, 50}, {25, 50}, {50, 25}, {50, -25}, {25, -50}, {-50, -50}}, ports={{5, 0.5, MISSILE},
{0, 0.5, MISSILE}, {4, 0.5, MISSILE}}}}}


[Reveal] Spoiler: And so I've taken these exact lines and simply changed the ports to be LAUNCHER or MISSILE
-- COMMAND_MISSILE_2
{71, {{verts={{-5, 5}, {2.071, 5}, {5, 2.071}, {5, -2.071}, {2.071, -5}, {-5, -5}}, ports={{5, 0.5,
MISSILE}, {0, 0.5, LAUNCHER, MISSILE}, {4, 0.5, LAUNCHER, MISSILE}}},
{verts={{-10, 10}, {5, 10}, {10, 5}, {10, -5}, {5, -10}, {-10, -10}}, ports={{5, 0.5, LAUNCHER, MISSILE},
{0, 0.5, LAUNCHER, MISSILE}, {4, 0.5, LAUNCHER, MISSILE}}},
{verts={{-15, 15}, {7.5, 15}, {15, 7.5}, {15, -7.5}, {7.5, -15}, {-15, -15}}, ports={{5, 0.5, LAUNCHER, MISSILE},
{0, 0.5, LAUNCHER, MISSILE}, {4, 0.5, LAUNCHER, MISSILE}}},
{verts={{-20, 20}, {10, 20}, {20, 10}, {20, -10}, {10, -20}, {-20, -20}}, ports={{5, 0.5, LAUNCHER, MISSILE},
{0, 0.5, LAUNCHER, MISSILE}, {4, 0.5, LAUNCHER, MISSILE}}},
{verts={{-25, 25}, {12.5, 25}, {25, 12.5}, {25, -12.5}, {12.5, -25}, {-25, -25}}, ports={{5, 0.5,
MISSILE}, {0, 0.5, LAUNCHER, MISSILE}, {4, 0.5, LAUNCHER, MISSILE}}},
{verts={{-30, 30}, {15, 30}, {30, 15}, {30, -15}, {15, -30}, {-30, -30}}, ports={{5, 0.5, LAUNCHER, MISSILE},
{0, 0.5, LAUNCHER, MISSILE}, {4, 0.5, LAUNCHER, MISSILE}}},
{verts={{-35, 35}, {17.5, 35}, {35, 17.5}, {35, -17.5}, {17.5, -35}, {-35, -35}}, ports={{5, 0.5,
MISSILE}, {0, 0.5, LAUNCHER, MISSILE}, {4, 0.5, LAUNCHER, MISSILE}}},
{verts={{-40, 40}, {20, 40}, {40, 20}, {40, -20}, {20, -40}, {-40, -40}}, ports={{5, 0.5, LAUNCHER, MISSILE},
{0, 0.5, LAUNCHER, MISSILE}, {4, 0.5, LAUNCHER, MISSILE}}},
{verts={{-45, 45}, {22.5, 45}, {45, 22.5}, {45, -22.5}, {22.5, -45}, {-45, -45}}, ports={{5, 0.5,
MISSILE}, {0, 0.5, LAUNCHER, MISSILE}, {4, 0.5, LAUNCHER, MISSILE}}},
{verts={{-50, 50}, {25, 50}, {50, 25}, {50, -25}, {25, -50}, {-50, -50}}, ports={{5, 0.5, LAUNCHER, MISSILE},
{0, 0.5, LAUNCHER, MISSILE}, {4, 0.5, LAUNCHER, MISSILE}}}}}


I've tried other things as well and I've been very sure to make sure the formatting is 100% identical including all open { and close } brackets. Unfortunately, the error persists.
Also as a note for those interested, you can successfully use the # of the blocks in your blocks.lua files instead of the block name and it works all the same:

shape=COMMAND_MISSILE is read identically to shape=70


Sun May 22, 2016 4:28 pm
Profile

Joined: Wed Mar 30, 2016 6:50 pm
Posts: 5
Reply with quote
Your shape ID is conflict with the shape ID of the Game. Try to change it to a value exceeded 100.


Sun May 29, 2016 12:44 am
Profile

Joined: Mon May 04, 2015 10:08 am
Posts: 97
Reply with quote
I got so excited when I saw your answer ZMiG but then I tried it with 100, 101, 110, and 200 and it still gives a similar error except now instead of "Invalid shape 'COUNT'" it says "Invalid shape '100'" etc.

Sad times :(


Sun May 29, 2016 4:16 pm
Profile

Joined: Wed Mar 30, 2016 6:50 pm
Posts: 5
Reply with quote
Ha11uc1n0g3n wrote:
I got so excited when I saw your answer ZMiG but then I tried it with 100, 101, 110, and 200 and it still gives a similar error except now instead of "Invalid shape 'COUNT'" it says "Invalid shape '100'" etc.

Sad times :(

It seems that your shape doesn't define well.
Maybe you can read the shapes.lua under the game directory to confirm your shape is totally correct.
If it doesn't work, I'm glad to have a look at your code.


Mon May 30, 2016 1:02 am
Profile

Joined: Thu Jan 14, 2016 2:21 pm
Posts: 94
Reply with quote
Pretty sure you can't make a port more than one type, and the invalid shape error is because of this.

_________________
My mods
Starring:
  • The Triumvirate - Triangles with shotguns and ablative armour
  • InfraSpatia - Disjointed aliens with spinal guns
  • Systems Coalition Remnant - Turbo-rectangles with stacking guns
  • Roiders - Cities and drills
Make your own with the Reassembly Web Development Kit!


Wed Jun 01, 2016 7:57 pm
Profile

Joined: Wed Mar 16, 2016 11:09 am
Posts: 4
Reply with quote
I've succesfully made my own mod shapes, and my mod will go online later this week, but i can post some code here:
shapes.lua
Code:
{
  {102,
    {
      {
        verts={
          {-4.619, -2.5},
          {-4.619, 2.5},
          {4.619, 3.161},
          {4.619, -3.161}
        },
        ports={
          {0, 0.5},
          {1, 0.5},
          {3, 0.5},
          {2, 0.5, WEAPON_IN}
        }
      }
    }
  }
}

blocks.lua
Code:
{
   {
      1,
      group=20,
      name="middle part",
      shape=102,
      fillColor=0x4b3d47,
      durability=1.3,
      growRate=7.5,
   },
}

possible port modifiers: WEAPON_IN, WEAPON_OUT, THRUSTER_IN, THRUSTER_OUT, NONE, LAUNCHER, MISSILE
tell me if i missed any

_________________
http://atg.lychnobi.com/ttftcuts/rwdk/
Visual Reassembly mod kit


Wed Jun 08, 2016 1:42 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 14 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software