Gamestudio Links
Zorro Links
Newest Posts
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Ayumi, Quad, PeWi), 488 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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