Predefined Materials - Salvaging and converting an old project

Posted By: Loremaster

Predefined Materials - Salvaging and converting an old project - 01/13/13 21:57

Hello everybody,

I try to recover an old 5000-Lines-Plus project from 2003 in A6 / C-Script. In the end I want to convert to Lite-C, but before, I have to bridge the C-Script-Gap between A6 and A8. So far I was able to remove every error, but now I ran into a wall.

A6 knew "predefined materials", as described here:

Quote:
At the moment there are 9 predefined materials that are automatically assigned to entities dependent on their type and flags, unless the entity has an own material. You can change the overall lighting of a level by adjusting the properties of those materials:

mat_flat for flat map surfaces
mat_shaded for shaded map surfaces
mat_terrain for terrain entities
mat_model for model entities
mat_sprite for sprite entities
mat_particle for particles (not yet used)
mat_sky for dome or scene sprites (not yet used)
mat_metal for any entity with metal flag set
mat_unlit for any entity with unlit flag set
mat_shadow for defining stencil shadow transparency and diffuse color


Unfortunately, though A7 as the step in between showed no problems with that (I tested it with the A7 version available on Conitec), A8 gets the hickups. This code appears to be faulty now:

Code:
if (mca_matnummer == 4) 
{
	str_cpy(mca_MatNameStr, "mat_model");
	mca_Object.material = mat_model;
	mca_Material = mat_model;
}



It results in

Quote:
matcal.wdl 359:0 () Parameter unknown mat_model


So these predefined materials are no longer supported? How can I fix that in C-Script?
Posted By: Iglarion

Re: Predefined Materials - Salvaging and converting an old project - 01/13/13 22:06

try with mtl_model
Posted By: Loremaster

Re: Predefined Materials - Salvaging and converting an old project - 01/13/13 22:19

Wonderful. Thank you very much.
Posted By: tolu619

Re: Predefined Materials - Salvaging and converting an old project - 07/06/14 02:20

I don't get it. Doesn't mtl_model affect ALL models?
This line of code is taken straight out of the manual yet it doesn't work.
Code:
#include <mtlFX.c>
...
action toon_warrior()
{
  my.skill41 = floatv(50);  // Shadow
  my.skill42 = floatv(50);  // Edgewidth
  my.skill43 = floatv(50);  // Threshold
  my.skill44 = floatv(50);  // Smooth
  my.material = mtl_toon;
  ...
}


After I updated my gamestudio to version 8.10.3, I had to comment out all such lines because while the game still runs, the moment it tries to create any entity that has any material assignment within its code, I get an Error E1520 that says "Structs inconsistent - MATERIAL".
Posted By: Superku

Re: Predefined Materials - Salvaging and converting an old project - 07/06/14 08:16

1) Did you change any file from the include folder?
2) Do you have a copy of any file from the include folder in your game folder?
3) Have you tried a clean second GStudio install in some other folder? If you do so make sure to use the correct SED instance for your test runs.
Posted By: tolu619

Re: Predefined Materials - Salvaging and converting an old project - 07/06/14 12:35

In other words, my code is ok, so the problem must be from my installation and/or file paths?
Posted By: tolu619

Re: Predefined Materials - Salvaging and converting an old project - 07/10/14 09:11

Found it! The include folder was ok, but I had to copy the files from the include folder into my project folder and overwrite the old files. So the code I posted earlier is working perfectly
Posted By: Superku

Re: Predefined Materials - Salvaging and converting an old project - 07/10/14 09:26

The files from the include folder should never be copied (or modified) to your own folder (-> 2) ).
Posted By: tolu619

Re: Predefined Materials - Salvaging and converting an old project - 07/17/14 18:37

Originally Posted By: Superku
The files from the include folder should never be copied (or modified) to your own folder (-> 2) ).

Really? So what am I supposed to do? If I delete all the include files from my game's folder, will the game use the files as they are in the include folder?
Posted By: Superku

Re: Predefined Materials - Salvaging and converting an old project - 07/17/14 19:11

Sure, see here (esp. the <..> remark): http://www.conitec.net/beta/include.htm
© 2024 lite-C Forums