Gamestudio Links
Zorro Links
Newest Posts
How to Change Multiplier
by vicknick. 06/02/23 03:27
How to buy tomorrow at open?
by vicknick. 06/02/23 03:19
Adding Position to Current Trade
by vicknick. 06/02/23 03:09
Unable to change multiplier of contract
by vicknick. 05/30/23 06:56
Wrong Definition of Sharpe Ratio in Zorro?
by vicknick. 05/29/23 06:32
Backtest strategy on bitcoin/crypto
by JamesHH. 05/26/23 04:36
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (vicknick, 7th_zorro, Quad), 1,020 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
BInnacle, androsa, XquicksnowX, danishinvest, Trail
18942 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 1 of 6 1 2 3 4 5 6
flashlight from aum 18... #104025
12/26/06 18:28
12/26/06 18:28
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
my problem, is... when i put the action in my models, they dont do what they are supposed to do, and i cant use the flashlight at all. there are no errors at all with the code, but for some reason its not working. can anyone help?


code:

var max_dist = 10000; // use it for distances smaller than 10,000 quants
var energy = 100; // the energy for the batteries that come with the flashlight
var battery = 200; // the energy for the batteries that can be picked up

action battery_pickup
{
my.passable = on;
while (player == null) {wait (1);}
while (vec_dist (player.x, my.x) > 100) {wait (1);}
energy += battery;
ent_remove (me);
}

action flashlight_pickup
{
while (player == null) {wait (1);}
my.passable = on;
while (vec_dist (player.x, my.x) > 100) {wait (1);}
my.invisible = on;
my.lightred = 250;
my.lightgreen = 250;
my.lightblue = 170;
while (1)
{
while (energy > 0 && key_f == 1) // press the "F" key to use the flashlight
{
my.lightrange = 200;
temp.x = max_dist * cos(player.pan) * cos(camera.tilt) + player.x;
temp.y = max_dist * sin(player.pan) * cos(camera.tilt) + player.y;
temp.z = max_dist * sin(camera.tilt) + player.z;
trace_mode = ignore_models + use_box;
my.skill1 = trace (player.x, temp);
if (my.skill1 != 0)
{
temp.x = (my.skill1 - 30) * cos(player.pan) * cos(camera.tilt) + player.x;
temp.y = (my.skill1 - 30) * sin(player.pan) * cos(camera.tilt) + player.y;
temp.z = (my.skill1 - 30) * sin(camera.tilt) + player.z;
vec_set (my.pos, temp);
}
energy -= 0.5 * time;
wait (1);
}
my.lightrange = 0;
wait (1);
}
}

Re: flashlight from aum 18... [Re: Blink] #104026
12/27/06 19:59
12/27/06 19:59
Joined: Aug 2003
Posts: 2,008
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,008
Bucharest, Romania
Make sure that your player is named "player". Place this line of code at the beginning of your player action:

action my_player
{
player = my;
// the rest of your playercode would go here
............
}

Re: flashlight from aum 18... [Re: George] #104027
12/31/06 17:45
12/31/06 17:45
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 use this code with the templates? thats what i am doing now. my player has playerbiped01 action.

Re: flashlight from aum 18... [Re: Blink] #104028
01/02/07 10:33
01/02/07 10:33
Joined: Aug 2003
Posts: 2,008
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,008
Bucharest, Romania
Sure, just place that line at the beginning of player's action.

Re: flashlight from aum 18... [Re: George] #104029
01/02/07 12:28
01/02/07 12:28
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
Is there an update for the flashlight because it doesnt work quite well on my
a6 extra is there another way to solve that problem?
Regards
Aztec


Visit:
schwenkschuster-design.de
Re: flashlight from aum 18... [Re: aztec] #104030
01/03/07 20:09
01/03/07 20:09
Joined: Aug 2003
Posts: 2,008
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,008
Bucharest, Romania
What doesn't work well?

Re: flashlight from aum 18... [Re: George] #104031
01/04/07 08:08
01/04/07 08:08
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
Well I tried that code and at first there where no problems but there was no light when I pressed the f buton then I tried to rescript it
that I dont need all this pick-up stuff.

I just wanted that if I press F the light appears and if I press again it dissapears

but I didnt got it
Regards
Aztec


Visit:
schwenkschuster-design.de
Re: flashlight from aum 18... [Re: aztec] #104032
01/04/07 08:35
01/04/07 08:35
Joined: Apr 2006
Posts: 329
M
molotov Offline
Senior Member
molotov  Offline
Senior Member
M

Joined: Apr 2006
Posts: 329
Hey aztec, I also didn't want to use the pick up stuf, and also that press a button it appears and press it again it disappears. And sofar it's working for me, this is the code after I changed it:

/////////////////////////////////////////////////////////////////////////////////////////
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;

Hope this works for you.

Re: flashlight from aum 18... [Re: molotov] #104033
01/04/07 14:33
01/04/07 14:33
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
doesnt work so good
nothing happen if I press the L button
Aztec

Last edited by aztec; 01/04/07 14:38.

Visit:
schwenkschuster-design.de
Re: flashlight from aum 18... [Re: aztec] #104034
01/04/07 15:37
01/04/07 15:37
Joined: Apr 2006
Posts: 329
M
molotov Offline
Senior Member
molotov  Offline
Senior Member
M

Joined: Apr 2006
Posts: 329
That's really strange because I got working nicely.

Page 1 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