Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 1,086 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
shade-c terrain #291256
09/24/09 09:00
09/24/09 09:00
Joined: Jan 2008
Posts: 34
Fab4 Offline OP
Newbie
Fab4  Offline OP
Newbie

Joined: Jan 2008
Posts: 34
hi guys,
ive got a strange problem...
im trying to use the shade-c terrain shader but it doesnt work...
thats how its in the manual:

How to use:
Set my.material = sc_mtl_obj_terrain;
Set sc_mtl_obj_terrain.skin1 to your colortilemap, or simply create a custom material


Code:
BMAP* myTerrainColor = "myTerrainTile.bmp";

MATERIAL* mtl_myTerrain ()
{
   skin1 = myTerrainColor;
   effect = "sc_obj_terrain.fx";
}




and thats my complete code (i used the entities from the demo for trying)

Code:
#define PRAGMA_PATH "shade-c"
#define PRAGMA_PATH "stuff"
#include <acknex.h>
#include <default.c>
#include "sc_core.c"; 

ENTITY* ent_terrain;


BMAP* myTerrainColor = "terrain_color.dds";

MATERIAL* mtl_myTerrain ()
{
   skin1 = myTerrainColor;
   effect = "sc_obj_terrain.fx";
}


void main()
{
   level_load("empty.wmb");
   wait(4);
	ent_terrain = ent_create("terrain.mdl",vector(0,0,0),mtl_myTerrain);
	wait(2);
   //set resolution
   video_switch(8,32,0); 

   //Setup Shade-C
   sc_setup();
   //

   //you can now make full use of Shade-C!
   
   
}



i always get a syntax error in line 14 'skin1' undeclared identifier

by changing
Code:
MATERIAL* mtl_myTerrain ()
{
   skin1 = myTerrainColor;
   effect = "sc_obj_terrain.fx";
}


to
Code:
MATERIAL* mtl_myTerrain =
{
   skin1 = myTerrainColor;
   effect = "sc_obj_terrain.fx";
}


the error disappers but the engine crashs in by error E1513.

i realy dont know what to do, and i would by happy about every help i can get.



[edit]
ok i did it after hours of trying. grin

first i had to create the terrain model without shader and change the material later.
Code:
ent_terrain = ent_create("terrain2.mdl",vector(0,0,0),NULL);
	wait(2);
	ent_terrain.material = sc_mtl_obj_terrain;



for changing the tile set you have to
Code:
sc_bmap_terrainColor = bmap_create("new_tile.dds");
	wait(2);
	sc_mtl_obj_terrain.skin1=sc_bmap_terrainColor;



if i said something wrong, please feel free to spit on me grin
but it worked this way in my script

Last edited by Fab4; 09/24/09 10:34.
Re: shade-c terrain [Re: Fab4] #291276
09/24/09 10:37
09/24/09 10:37
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
I think this:
Code:
MATERIAL* mtl_myTerrain ()


should be this:
Code:
MATERIAL* mtl_myTerrain () =



Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: shade-c terrain [Re: JibbSmart] #291294
09/24/09 12:26
09/24/09 12:26
Joined: Jan 2008
Posts: 34
Fab4 Offline OP
Newbie
Fab4  Offline OP
Newbie

Joined: Jan 2008
Posts: 34
thx first,
but in the the sc_objShaders.h its without only = ,too
but it works now

thx again

Re: shade-c terrain [Re: Fab4] #291297
09/24/09 12:31
09/24/09 12:31
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
I haven't looked at Shade-C, but since you're talking about a ".h" file I think it's just a prototype, so that anything can use it no matter where it's placed in the code.

Glad it worked laugh

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: shade-c terrain [Re: JibbSmart] #291329
09/24/09 15:48
09/24/09 15:48
Joined: Aug 2008
Posts: 133
Sweden, Stockholm
E
Enduriel Offline
Member
Enduriel  Offline
Member
E

Joined: Aug 2008
Posts: 133
Sweden, Stockholm
You assigned a material instead of an action on the ent_create's last parameter, that's why it crashed I think.

Re: shade-c terrain [Re: Enduriel] #291506
09/25/09 17:56
09/25/09 17:56
Joined: Jan 2008
Posts: 34
Fab4 Offline OP
Newbie
Fab4  Offline OP
Newbie

Joined: Jan 2008
Posts: 34
Originally Posted By: Enduriel
You assigned a material instead of an action on the ent_create's last parameter, that's why it crashed I think.

yes your right, how stupid :S
thx, i was really wondering why it didnt work...


Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1