Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Turning CAST ON and OFF #290063
09/17/09 04:57
09/17/09 04:57
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline OP
Senior Member
bart_the_13th  Offline OP
Senior Member
B

Joined: Aug 2008
Posts: 482
Hi, I just want to ask if this happen to other...
I want to optimize the game I made by removing unnecessary shadow casting light source by switching CAST OFF when the light source cant be seen from camera.
Code:
reset(me,CAST);


And setting them on again when they can be seen
Code:
set(me,CAST);



The problem is that it wont work. The flag CAST itself changed but the light still casting shadow(if they're at the first time) or still not casting shadow(if they weren't) even if the CAST flag changed.

I do have a work around that's setting lightrange to 0 before switching CAST flag the setting it lightrange again, but it's very noticable since the light's out for one frame...

Could anyone tell me what's going on?

Re: Turning CAST ON and OFF [Re: bart_the_13th] #290066
09/17/09 05:17
09/17/09 05:17
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Its only an educated guess, but check and make sure the DYNAMIC flag is ON for the lights at all times.
Especially if they are placed in the level in WED, make sure they are DYNAMIC in there too.

FROM MEMORY,(so I may be wrong), lights created in WED default to static lights, and therefore
only get their light "values" calculated at compile time, and wont show any "value" changes made by the script...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Turning CAST ON and OFF [Re: EvilSOB] #290076
09/17/09 07:56
09/17/09 07:56
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline OP
Senior Member
bart_the_13th  Offline OP
Senior Member
B

Joined: Aug 2008
Posts: 482
Actually the light source it self are entities placed in WED and have action assigned. So I suppose that the DYNAMIC flag is automatically set to ON.
I dont want to place dynamic lights wildly in the WED since it can be affect the frame rate and not to mention ghost shadow glitches.

But I'll try to manually set the DYNAMIC to ON and see the result.

Thanks

Re: Turning CAST ON and OFF [Re: bart_the_13th] #290079
09/17/09 08:17
09/17/09 08:17
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Probably will be, if their actions are attached IN WED.

If you dont have any luck with that, then TRY this educated guess.
Try making sure the entities that in WED...
LIGHTRANGE == 0, CAST == OFF, LIGHT == OFF
and set them to on or whatever in the actions...

Just a test to see if it makes a difference on ONE of your known
"problem" entities...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Turning CAST ON and OFF [Re: EvilSOB] #290256
09/18/09 03:49
09/18/09 03:49
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline OP
Senior Member
bart_the_13th  Offline OP
Senior Member
B

Joined: Aug 2008
Posts: 482
Tested last night, it still doesn't work...

But it solved already by using static light to 'backup' the dynamic light(when it has to turn off). Still noticeable but it works...

Thanks EvilSOB laugh

Re: Turning CAST ON and OFF [Re: bart_the_13th] #290258
09/18/09 04:00
09/18/09 04:00
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Bah... thats not a fix, thats a botch-job.
BUT it will do I spose, unless someone else reading this thread has an actual cure.
Im out of ideas....
Sorry dude.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Turning CAST ON and OFF [Re: EvilSOB] #290261
09/18/09 04:07
09/18/09 04:07
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline OP
Senior Member
bart_the_13th  Offline OP
Senior Member
B

Joined: Aug 2008
Posts: 482
Just went to wiki to find the meaning of botch
Quote:

1. An action, job, or task that has been performed very badly.
2. A ruined, defective, or clumsy piece of work; mess; bungle.
3. A mistake that is very stupid or embarrassing.
4. A messy, disorderly or confusing combination; conglomeration; hodgepodge.


grin grin grin Hehe... I think so... grin grin grin

Last edited by bart_the_13th; 09/18/09 04:08.
Re: Turning CAST ON and OFF [Re: bart_the_13th] #290264
09/18/09 04:51
09/18/09 04:51
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
1,4, and kind-of 2 is my meaning... grin


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Turning CAST ON and OFF [Re: EvilSOB] #290265
09/18/09 06:14
09/18/09 06:14
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
try this :
reset(my,DYNAMIC);


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de

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