Home   Help Search Login Register  

Author Topic: tank shell tracer problem  (Read 1651 times)

0 Members and 1 Guest are viewing this topic.

Offline sfc.itzhak

  • Members
  • *
tank shell tracer problem
« 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.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: tank shell tracer problem
« Reply #1 on: 17 Mar 2008, 22:03:29 »
Do you get the titletext ["shell fired","plain"]; displayed ?

Offline sfc.itzhak

  • Members
  • *
Re: tank shell tracer problem
« Reply #2 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.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: tank shell tracer problem
« Reply #3 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.

Offline sfc.itzhak

  • Members
  • *
Re: tank shell tracer problem
« Reply #4 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


Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: tank shell tracer problem
« Reply #5 on: 18 Mar 2008, 01:41:41 »
In your code you are missing a ] here _light LightAttachObject [_Missile,[0,0,0];

Offline sfc.itzhak

  • Members
  • *
Re: tank shell tracer problem
« Reply #6 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.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: tank shell tracer problem
« Reply #7 on: 18 Mar 2008, 13:18:25 »
Try this experiment:

Offline sfc.itzhak

  • Members
  • *
Re: tank shell tracer problem
« Reply #8 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..

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: tank shell tracer problem
« Reply #9 on: 18 Mar 2008, 15:00:32 »
I see both, the light and the drop using external view.