Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,007 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 3 of 6 1 2 3 4 5 6
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 Offline
Senior Member
tindust  Offline
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 Offline OP

Expert
Blink  Offline 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 Offline
Senior Member
tindust  Offline
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: tindust] #104048
01/15/07 12:49
01/15/07 12:49
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
can i make the same changes for the other script? i dont want to use the flashlight pickup and battery pickup. i just want to hit a button for the light to toggle on and off.

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 Offline OP

Expert
Blink  Offline 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 Offline
Senior Member
tindust  Offline
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: tindust] #104051
01/15/07 15:50
01/15/07 15:50
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
ok... same error. let me ask, this is going to sound stupid. but could the problem be that since the flashlight script says player, should the player script say player as well everywhere in the script, and not plbiped01?

Re: flashlight from aum 18... [Re: Blink] #104052
01/15/07 16:47
01/15/07 16:47
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
nevermind..tried it, didnt work at all, too many errors.

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 Offline
Senior Member
tindust  Offline
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
Re: flashlight from aum 18... [Re: tindust] #104054
01/15/07 18:26
01/15/07 18:26
Joined: Apr 2006
Posts: 329
M
molotov Offline
Senior Member
molotov  Offline
Senior Member
M

Joined: Apr 2006
Posts: 329
Hey Blink, here is a small demo from me, which include my inventory system(press i) and the flashlight(press L). Try to see if the flashlight works in this demo on your computer, it did work on mine. This way you can see if it is a script related problem or a computer related program. Let me know if it works or not.
http://rapidshare.com/files/11848793/inventar_and_flashlight.rar.html

Page 3 of 6 1 2 3 4 5 6

Moderated by  George 

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