Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Specular light problem with scripts #109517
01/28/07 13:29
01/28/07 13:29
Joined: Jan 2007
Posts: 7
F
freddylowski Offline OP
Newbie
freddylowski  Offline OP
Newbie
F

Joined: Jan 2007
Posts: 7
Hi there,

I like to show a model with specular colors in my 3D-world. If I add this to an empty project it looks nice. But when I add a script like the walk-through script it suddenly turns black.

What am I doing wrong?

Re: Specular light problem with scripts [Re: freddylowski] #109518
02/01/07 16:53
02/01/07 16:53
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline
User
RedPhoenix  Offline
User
R

Joined: Jan 2007
Posts: 651
Germany
I am not sure whether I understood what you mean...
Have you made a model with skript changed material options? Then you need a sun for making specular light effects. May be your skript changes the sun or ambient parameters of the level. Please describe your problem more precisely

Re: Specular light problem with scripts [Re: freddylowski] #109519
02/01/07 23:22
02/01/07 23:22
Joined: Jan 2007
Posts: 183
K
Kinji_2007 Offline
Member
Kinji_2007  Offline
Member
K

Joined: Jan 2007
Posts: 183
Right click the light and goto properties. Set the range if needed.


http://www.geocities.com/carapacedweller/kinjis/Tutorial_Index.html A5 and A6 tutorials <> E3S series "Show me once and I got it, tell me once and I'll think twice."
Re: Specular light problem with scripts [Re: Kinji_2007] #109520
02/25/07 18:19
02/25/07 18:19
Joined: Jan 2007
Posts: 7
F
freddylowski Offline OP
Newbie
freddylowski  Offline OP
Newbie
F

Joined: Jan 2007
Posts: 7
Hi there,
thanks for your replies. Unfortunately I was very busy the last weeks.
I'll try to describe my problem a little bit more precisely.

I importet ad .3ds Model into the MED. There were no diffuse,ambient or emissive colors (all set to 0,0,0). Just specular colors (125,125,125). When I do the engiene preview the model appears like I expect it to and like it does in 3DSmax.

When I create a new project in WED and insert just the model it looks exactly like in the engine preview of MED. - like I expect it to. (the background is blue) I don't set any ambient or sun light nor do I have any light source in my world.

Now I add an empty script. When I compile and run the project the screen is black. This doesn't change when I add ambient or sun light in the Map properties. Even if I add a light object this doesn't change.
The screen is black because there are no blocks or anything that reflect the ligth. But my model should do this.

As soon as I remove the script the background is blue again and the model has the right colors.

Are there any default settings for lights and the refelction of lights that a model does, that are overridden as soon as I attach a script to the project?

Or are there any settings I do have to change for my importetd model entity?

Thanks in advance

Re: Specular light problem with scripts [Re: freddylowski] #109521
02/26/07 14:33
02/26/07 14:33
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline
User
RedPhoenix  Offline
User
R

Joined: Jan 2007
Posts: 651
Germany
Yes there are. If I understood you right the reflection abilities of your models were only set in the preview window of med/wed. These values are only for the preview mode, to set them to your model in the real game you have to write a new material for your model and set it to the model like this:

MATERIAL my_special_mat {
ambient = 50;
//now set the diffuse, specular, ambient and emissive as you want
}

ACTION entities_action { My.Material = my_special_mat; }

Re: Specular light problem with scripts [Re: RedPhoenix] #109522
02/26/07 14:55
02/26/07 14:55
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
Quote:

Now I add an empty script.




Does that script load your level?

function main
{
level_load("levelname.wmb");
}

You´ll get a black screen, if you don´t load your level in the attached script.


no science involved
Re: Specular light problem with scripts [Re: RedPhoenix] #109523
03/03/07 11:16
03/03/07 11:16
Joined: Jan 2007
Posts: 7
F
freddylowski Offline OP
Newbie
freddylowski  Offline OP
Newbie
F

Joined: Jan 2007
Posts: 7
@ RedPhoenix:
Setting a material doesn't have any effect to my model. Maybe because the material is overriden by the material I specified within MED.

@ fogman:
You were right about loading my world in the main procedure. Although this didn't solve my problem it at least helped me to localize the problem.


I found the line that causes the problem when I add a template-script. It's in the display00.wdl in line 117:

// enable: Dynamic Sun?
// help: Use directional light for sun?
// help: Note: This will use one of the dynamic lights.
// id: 11
var sun_light = 1;

If I comment this line out and save the file the colors of my model are displayed like I expect them to.

Can anyone tell me why this line disables the specular light?


Gamestudio download | 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