|
2 registered members (Quad, AndrewAMD),
1,007
guests, and 6
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: flashlight from aum 18...
[Re: Blink]
#104045
01/14/07 23:05
01/14/07 23:05
|
Joined: Aug 2005
Posts: 312 Sweden
tindust
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 312
Sweden
|
Well, I see several things that may prevent the light from showing up. First, if you use proc_late it should go to the beginning of the function just like molotov says. Don't think you would need it though. Another thing, I don't see were you tell the my pointer what it is. You may have to specify that either by adding me = player in the beginning of the function, or by adding it in the function call:
EDIT: paragraph deleted, did not apply to question
Also, if you are using the code from your first post, the flashlight will run out of power real fast, perhaps even before you see it. Temporarily turn off the power decrease line:
// power -= time*0.5;
Finally, increase the range to at least 1000. Depending on how big your level is, the light might not reach anything to illuminate. These are just some thoughts, hope they help,
cheers, tindust
Last edited by tindust; 01/15/07 03:57.
|
|
|
Re: flashlight from aum 18...
[Re: tindust]
#104046
01/14/07 23:27
01/14/07 23:27
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
Thanks tindust, but i think i am really confused now. i am using plbiped01, how do i modify that? not too sure how to add to the functions in that script. i did change the range in the flashlight script though.
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]
#104047
01/15/07 03:54
01/15/07 03:54
|
Joined: Aug 2005
Posts: 312 Sweden
tindust
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 312
Sweden
|
I'm sorry. Didn't want to confuse it more. Took a look at the flash light code. Forget about what I said regarding the my pointer. It applies to a different type of flash light script. Also, don't worry about "player = me" here since the player entity is called "plBiped01_entity". In fact I don't think you should have to change the plBiped script.
I think in order to get it to work you need to:
1/ change player to plBiped01_entity everywhere in the flash light script (alternatively add the line "player = plBiped01_entity" as first line)
2/ change "energy -= 0.5 * time;" to "//energy -= 0.5 * time;" (keeps flashlight charged at max, just for testing purpose)
3/ make sure you have a flashlight model somewhere in your level, as described in aum 18. It could be just a ball model or something.
4/ make sure the action flashlight_pickup is attached to that model (through entity properties in the World Editor)
5/ not sure how you have added the flashlight script to your project, but it needs to be included somewhere, in a separate wdl file I suppose
hope this works now,
Lighten Your Load With DynaLights 1.0
Realtime 3D Lighting. Free Trial Version available. 3DGS 660P
|
|
|
Re: flashlight from aum 18...
[Re: Blink]
#104049
01/15/07 12:50
01/15/07 12:50
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
see the code again:
///////////////////////////////////////////////////////////////////////////////////////// define flash_light skill96; var max_dist = 700; // use it for distances smaller than 10,000 quants
function flash() { var temp2; while (player == null) {wait (1);} my.passable = on; my.invisible = on; my.lightred = 250; my.lightgreen = 250; my.lightblue = 170; while(player.flash_light == on) { my.lightrange = 100; temp.x = max_dist * cos(player.pan) * cos(player.tilt) + player.x; temp.y = max_dist * sin(player.pan) * cos(player.tilt) + player.y; temp.z = max_dist * sin(player.tilt) + player.z; trace_mode = ignore_models + use_box; vec_for_vertex(temp2,player,711); my.skill1 = trace (temp2, temp); if (my.skill1 != 0) { temp.x = (my.skill1 - 30) * cos(player.pan) * cos(player.tilt) + player.x; temp.y = (my.skill1 - 30) * sin(player.pan) * cos(player.tilt) + player.y; temp.z = (my.skill1 - 30) * sin(player.tilt) + player.z; vec_set (my.pos, temp); } wait(1); } my.lightrange = 0; ent_remove(me); }
function flashlight() { IF (player.flash_light == on) { player.flash_light = off; return; } ELSE { player.flash_light = on; ent_create("flash.mdl",player.x,flash); return; } }
on_l = flashlight;
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]
#104050
01/15/07 14:18
01/15/07 14:18
|
Joined: Aug 2005
Posts: 312 Sweden
tindust
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 312
Sweden
|
I think the code looks OK, except that "function flash()" should be "action flash".
Still any errors?
Lighten Your Load With DynaLights 1.0
Realtime 3D Lighting. Free Trial Version available. 3DGS 660P
|
|
|
Re: flashlight from aum 18...
[Re: Blink]
#104053
01/15/07 16:55
01/15/07 16:55
|
Joined: Aug 2005
Posts: 312 Sweden
tindust
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 312
Sweden
|
Well, technically yes, but the template files are heavily interconnected. It's probably better to not change their code much if possible. It's better to adapt added scripts to the definitions used in the templates. One reason I'm not using templates much.
Have you tried to debug by using a breakpoint? I see one place where the flash action probably gets stuck:
function flash() { var temp2; while (player == null) {wait (1);} my.passable = on;
Try using:
function flash() { var temp2; while (player == null) {player = plBiped_entity; wait (1);} my.passable = on;
Lighten Your Load With DynaLights 1.0
Realtime 3D Lighting. Free Trial Version available. 3DGS 660P
|
|
|
|