|
3 registered members (AndrewAMD, juanex, Grant),
1,018
guests, and 8
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: flashlight from aum 18...
[Re: tindust]
#104065
01/18/07 01:31
01/18/07 01:31
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
tindust, do you have a biped model using your code? my model is a basic plbiped model, using a template script. can you show me an example of your script you use for your model that uses the flashlight script?
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
Re: flashlight from aum 18...
[Re: Blink]
#104066
01/18/07 12:38
01/18/07 12:38
|
Joined: Aug 2005
Posts: 312 Sweden
tindust
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 312
Sweden
|
Sure, here's a code for a flashlight action. Just move closer to the flashlight entity with your player ent to get the flashlight "attached". When it is, it becomes invisible and the flashlight comes on whenever you press the f key. The light will turn with the player. Code:
/**************************************************************************************** 2007-01-17
Dynamic Flashlight and Torch: type dynamic spotlight becomes "attached" to player as the player gets closer than 100 from the model that has the flashlight action attached to it, in example below it is plBiped01_entity. Make it work by placing a flashlight model (any model) in your level, attach the action "flashlight" to it and change the player (plBiped01_entity) to whatever your player entity name is, and yes include this wdl in your include list at the end. This kind of lighting on block geometry looks "blocky". It's a property of dynamic lighting, looks great on models though. cheers tindust ****************************************************************************************/
var energy = 100;
action flashlight { // d3d settings optional; d3d_lightres = off; // quality of dynamic light setting. set to "on" can give better result sometimes //d3d_spotlightcone[0] = 30; // optional settings, look up in manual. Applies to all spotlights in level //d3d_spotlightcone[1] = 15; //d3d_spotlightcone[2] = 1; // while (plBiped01_entity == null) {wait (1);} my.passable = on; while (vec_dist (plBiped01_entity.x, my.x) > 100) {wait (1);} my.invisible = on; my.lightrange = 0; my.spotlight = on; // off for using as Torch my.lightred = 250; my.lightgreen = 250; my.lightblue = 170; while(1) { vec_set(my.x,plBiped01_entity.x); vec_set(my.pan,plBiped01_entity.pan); while (energy > 0 && key_f == 1) // press the "F" key to use the flashlight { my.lightrange = 1000; vec_set(my.x,plBiped01_entity.x); vec_set(my.pan,plBiped01_entity.pan); my.tilt += 5; // degree upward tilt of flashlight, value depends on using third or first person view //energy -= 0.5 * time; wait (1); } my.lightrange = 0; wait (1); } }
Last edited by tindust; 01/18/07 22:21.
Lighten Your Load With DynaLights 1.0
Realtime 3D Lighting. Free Trial Version available. 3DGS 660P
|
|
|
Re: flashlight from aum 18...
[Re: tindust]
#104067
01/18/07 13:24
01/18/07 13:24
|
Joined: Apr 2006
Posts: 329
molotov
Senior Member
|
Senior Member
Joined: Apr 2006
Posts: 329
|
Hey Tindust, isn't using a spotlight in such way, causing a lower framerate. Hey Blink, you can use winzip or winrar for compressing a small demo, and then use; http://rapidshare.com/for releasing it for download.
|
|
|
Re: flashlight from aum 18...
[Re: molotov]
#104070
01/18/07 17:14
01/18/07 17:14
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
so, i cant use it? the levels i want to use it on have prefabs. do i have to replace them all with map entities?
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
Re: flashlight from aum 18...
[Re: molotov]
#104072
01/18/07 19:30
01/18/07 19:30
|
Joined: Apr 2005
Posts: 653 Germany
Det
User
|
User
Joined: Apr 2005
Posts: 653
Germany
|
Where`s your problem with this code ? The works good and has no Errors.
When you picked up the Flshlight you must pusch tef "F" Button then the
Flashlight in burning That`s all.
Wissen ist macht. Nichts wissen macht auch nichts.
A7.86
|
|
|
|