Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, SBGuy), 987 guests, and 3 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
Page 1 of 2 1 2
Dynamic Light #162572
10/21/07 13:46
10/21/07 13:46
Joined: Jul 2007
Posts: 19
T
tivi Offline OP
Newbie
tivi  Offline OP
Newbie
T

Joined: Jul 2007
Posts: 19
Hi,

I have a propblem with light entities and models. The lighting is switched on/off on the models. I think this happens when I load a terrain. The light is an animated sprite with this action: Code:

action irr_gang_Viol()
{
my->red = 70;
my->green = 2;
my->blue = 70;
my->ambient = 80;
my->lightrange = 30;
my->frame = random(40);

while(1)
{
my->frame += 1*time_step;
if(my->frame > 41) my->frame -= 40;

wait(1);
}
}


Does someone know the problem and maybe has a solution?. I tried changing the unlit-flag, lightrange etc., nothing helped.
Please help me

Tom

Last edited by tivi; 10/21/07 13:46.
Re: Dynamic Light [Re: tivi] #162573
10/21/07 16:38
10/21/07 16:38
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Depending on the Gstudio your using, you may have too many dynamic lights running at the same time. The old default was 8 dynamic lights but in the new way, it depends on the output of your game compile I think.

Re: Dynamic Light [Re: Nems] #162574
10/21/07 21:18
10/21/07 21:18
Joined: Jul 2007
Posts: 19
T
tivi Offline OP
Newbie
tivi  Offline OP
Newbie
T

Joined: Jul 2007
Posts: 19
thanks for the reply.
There are only four lights in the level, so this should not be the problem. Without the terrain, everything runs fine.
With the terrain the reflected light on some models start blinking on/off slowly. Sometimes it´s ok for some seconds .
The problem is the same on different pc´s.
I´m using A7.06pro

Tom

Re: Dynamic Light [Re: tivi] #162575
11/03/07 08:18
11/03/07 08:18
Joined: Jul 2007
Posts: 19
T
tivi Offline OP
Newbie
tivi  Offline OP
Newbie
T

Joined: Jul 2007
Posts: 19
really no one with the same problem? I still have no solution and no workaround. I saved the terrain as mdl and used a detailmap shader, the lightning problem is the same.

Re: Dynamic Light [Re: tivi] #162576
11/03/07 08:59
11/03/07 08:59
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Try my.light = on; before the lightrange declaration,just wondering if it needs to be activated to get a consistent light effect without the switching happening on you.

Mind you, dont know your syntax arangment my->, I'm more used to my_lightred and so on like this;

my.lightred = 70;
my.lightgreen = 20;
my.lightblue = 70;

Re: Dynamic Light [Re: Nems] #162577
11/03/07 11:37
11/03/07 11:37
Joined: Jul 2007
Posts: 19
T
tivi Offline OP
Newbie
tivi  Offline OP
Newbie
T

Joined: Jul 2007
Posts: 19
I´m using lite_C so it should be: set(my,LIGHT); right?
my.lightred... leads to an error ( lightred is not a member of ENTITY )
I´m coming from C++, so I´m always writing my->... for pointers, but I changed this for testing, with no luck.
Thank you for trying to help me and sorry for my bad english.

Tom

Re: Dynamic Light [Re: tivi] #162578
03/03/08 05:49
03/03/08 05:49
Joined: Feb 2003
Posts: 264
Michigan,USA
alienheretic Offline
Member
alienheretic  Offline
Member

Joined: Feb 2003
Posts: 264
Michigan,USA
i had a simillar problem also placing a solid sky bok around the level seemed to fix it

Re: Dynamic Light [Re: tivi] #162579
03/07/08 03:43
03/07/08 03:43
Joined: Jun 2003
Posts: 427
Prison
DarkWhoppy_ Offline
Senior Member
DarkWhoppy_  Offline
Senior Member

Joined: Jun 2003
Posts: 427
Prison
I am having the same problem... The light fades on and off... Without turning it on/off by code. I think it's a bug... I can't get it to stop doing it.

BTW... It is the ONLY light in the scene... A7.07 Extra Edition


darkwhoppy@msn.no.spam.com (remove no.spam.) Website: WhoppyArts
Re: Dynamic Light [Re: DarkWhoppy_] #162580
03/07/08 04:28
03/07/08 04:28
Joined: Aug 2005
Posts: 312
Sweden
tindust Offline
Senior Member
tindust  Offline
Senior Member

Joined: Aug 2005
Posts: 312
Sweden
Looks to me as if the problem might be with the while loop. It allows the frame 41 to be used when it does not exist. It should be:

Code:
{		my->frame += 1*time_step;
if(my->frame >= 41) my->frame -= 40;
wait(1);
}



or:

Code:
{		my->frame += 1*time_step;
my->frame %= 41;
wait(1);
}



at least that's how to use the modulo operator in c-script

cheers

edit: Also wonder why you want to tie the frame number to time_step and not the time each frame is shown. It should really be:

Code:
{
my->frame += 1;
my->frame %= 41;
wait(-time_step); // multiply with 0.01 ... 100 to adjust length
wait(1);
}



Last edited by tindust; 03/07/08 04:38.
Re: Dynamic Light [Re: tindust] #162581
03/15/08 09:28
03/15/08 09:28
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Ok, I think its to do with "Creat Meshes" in the build dialog box. I keep this unchecked as I develope with models mostly so Dynamic lights always work for me.

Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

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