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
4 registered members (dr_panther, Quad, AndrewAMD, 7th_zorro), 945 guests, and 2 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
creating light sources with script #296646
11/02/09 09:29
11/02/09 09:29
Joined: Aug 2009
Posts: 46
gfxExp Offline OP
Newbie
gfxExp  Offline OP
Newbie

Joined: Aug 2009
Posts: 46
Hi,

Just like ent_create, how would I go about creating lights? When I had used WED before (can't use it now though) I could easily add lights.

Lite-C Workshop so far doesn't explain much about creating lights. I'm at workshop 19 (Physic Workshop).

Any suggestions?

Re: creating light sources with script [Re: gfxExp] #296649
11/02/09 09:35
11/02/09 09:35
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
wat kind of lights do u wanna create ?


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: creating light sources with script [Re: gfxExp] #296650
11/02/09 09:35
11/02/09 09:35
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline
Senior Member
Razoron  Offline
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
Code:
function light_place(x,y,z,r,g,b,range)
{ 
  ENTITY* light = ent_create(NULL,vector(x,y,z),NULL);
  light.red = r;
  light.green = g;
  light.blue = b;
  light.lightrange = range;
}


function main()
{
  ...
  level_load(...);
  light_place(100,100,100,0,0,255,1000);
  ...
}



Last edited by Razoron; 11/02/09 09:36.
Re: creating light sources with script [Re: Razoron] #296656
11/02/09 10:14
11/02/09 10:14
Joined: Aug 2009
Posts: 46
gfxExp Offline OP
Newbie
gfxExp  Offline OP
Newbie

Joined: Aug 2009
Posts: 46
Ah, so have to use null entity to create lights. Thanks!

EDIT
----

level entities are not casting any shadows. Any suggestions?

Last edited by gfxExp; 11/02/09 10:31.
Re: creating light sources with script [Re: gfxExp] #296658
11/02/09 10:32
11/02/09 10:32
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
cause the light is alwys attached to an entity. if u wanna use spot light, u have to do same. but for environment light, its on the map.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: creating light sources with script [Re: delinkx] #296675
11/02/09 12:40
11/02/09 12:40
Joined: Aug 2009
Posts: 46
gfxExp Offline OP
Newbie
gfxExp  Offline OP
Newbie

Joined: Aug 2009
Posts: 46
Point taken. Light are attached to entity. so how can I go about making the model entities cast shadows? I tried setting CAST flag to the light entity, did not work. I also tried setting model entities CAST flag as well. Still no luck.

Re: creating light sources with script [Re: gfxExp] #296741
11/02/09 17:39
11/02/09 17:39
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline
Serious User
Liamissimo  Offline
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
Set the flag shadow, in Sed with

entity.flags |= (SHADOW);


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011

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