OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: sfc.itzhak on 17 Mar 2008, 18:03:15

Title: tank shell tracer problem
Post by: sfc.itzhak on 17 Mar 2008, 18:03:15
hi.

i am trying to attach the tank shell with a "tracer" that will make it visible at night/day its still alpha but it wont work.

Quote
_Missile =  nearestobject [_this select 0,_this select 4];
? isNull  _Missile : exit
_Type= typeOf _Missile

titletext ["shell fired","plain"];

shell1= "bvr_shell"  createVehicle [0,0,0];

#loop
? _Type != typeOf _Missile : goto "end"
shellpos=getpos _Missile;
shellx=shellpos select 0;
shelly=shellpos select 1;
shellz=shellpos select 2;



shell1 setpos [shellx,shelly,shellz];
Goto "loop"
titletext ["shell fired","plain"];
#End
exit

any ideas/suggestions?

thanks in advance.
Title: Re: tank shell tracer problem
Post by: Mandoble on 17 Mar 2008, 22:03:29
Do you get the titletext ["shell fired","plain"]; displayed ?
Title: Re: tank shell tracer problem
Post by: sfc.itzhak on 18 Mar 2008, 00:29:09
yeap.

and only when i really slow mo i can see the attached shell.
so either the projectile is moving to fast or the script is too slow.

maybe i am using a bad approach?

the drop command is better?

what i am trying to achieve is, whan the tank fire a shell we can see the shell(bright and orange/red projectile).

so maybe create a particle and attach it to the projectile.
Title: Re: tank shell tracer problem
Post by: Mandoble on 18 Mar 2008, 00:48:20
You may create a lightpoint vehicle and attach it to your shell:
Code: [Select]
_light = "#lightpoint" createVehicle [0,0,0];
_light setLightColor [0.7,0.8,1];
_light setLightAmbient [0.7,0.8,1];
_light setLightBrightness 0.1;
_light LightAttachObject [_Missile,[0,0,0]];

Not sure it will be seen at daylight.
Title: Re: tank shell tracer problem
Post by: sfc.itzhak on 18 Mar 2008, 01:11:13
hey mandoble.

whan i use this script i get

this is what i use to activate the script
Quote
this addEventHandler ["Fired", {this exec "fired.sqs"}]

Quote
_Missile =  nearestobject [_this select 0,_this select 4];
? isNull  _Missile : exit
_Type= typeOf _Missile

? _Type != typeOf _Missile : goto "end"
shellpos=getpos _Missile;
_light = "#lightpoint" createVehicle [0,0,0];
_light setLightColor [0.7,0.8,1];
_light setLightAmbient [0.7,0.8,1];
_light setLightBrightness 0.1;
_light LightAttachObject [_Missile,[0,0,0];

titletext ["shell fired","plain"];
#End
exit

"error type any,expected object" and this line is above it.
Quote
_light LightAttachObject [_Missile,[0,0,0]];

thanks in advance

Title: Re: tank shell tracer problem
Post by: Mandoble on 18 Mar 2008, 01:41:41
In your code you are missing a ] here _light LightAttachObject [_Missile,[0,0,0];
Title: Re: tank shell tracer problem
Post by: sfc.itzhak on 18 Mar 2008, 12:38:12
hey mandoble.

i tried what you said but it still gives me the same error.

Quote
_Missile =  nearestobject [_this select 0,_this select 4];
? isNull  _Missile : exit
_Type= typeOf _Missile

? _Type != typeOf _Missile : goto "end"
shellpos=getpos _Missile;
_light = "#lightpoint" createVehicle [0,0,0];
_light setLightColor [0.7,0.8,1];
_light setLightAmbient [0.7,0.8,1];
_light setLightBrightness 0.1;
_light LightAttachObject [_Missile,[0,0,0]];

titletext ["shell fired","plain"];
#End
exit

and the "shell fired" wont show up.
Title: Re: tank shell tracer problem
Post by: Mandoble on 18 Mar 2008, 13:18:25
Try this experiment:
Title: Re: tank shell tracer problem
Post by: sfc.itzhak on 18 Mar 2008, 13:37:11
thanks again man for your help

but are able to see anything?

cuz i dont see any orb or something..
Title: Re: tank shell tracer problem
Post by: Mandoble on 18 Mar 2008, 15:00:32
I see both, the light and the drop using external view.