Forum Jump :

Author Message


Posts: 6
Rank:


Level: Member

Country: uk
Location: London
Occupation:
Age:
In-game name: Dave D

 
#1 Posted at 2011-05-24 21:05        
     
Hi, I am having trouble with a certain script. I want to attach a lightbar (primitive one, mind) that is already in game ("red_light"), to a vehicle. Now I am making this script for a ZL style mission, and I dont want to use named objects. The code I am going to enter in the vehicles init when spawned. But what I cant understand is why it is so hard to do this without naming the objects which is definetly not what I want to do (as there would be many clones and get messy). I just want a classname>attachto>vehicle script that can be defined in one vehicle's init. I have been working for hours on this now! and I came up with
light1= "red_light" createvehicle (position player) ; light1 attachto [this,[-0.0,-0.00,0.44]]
or
"red_light" createvehicle [this,[-0.0,0.00,0.44]]
and a guy on BIS forums said I could use
(createvehicle "red_light" [this,[0,0,0]]) attachTo [this];
but I tried this and it gives me a "missing )" error. Im actually questioning if this is actually possible using the createvehicle command. I might have tunnel vision on this subject as I have been working on this for quite some time! Help needed!


Author Message

palyarmerc  

I live inside the editor


Posts: 753
Rank:


Level: Member

Country: uk
Location:
Occupation: *Retired from ArmA*
Age:
In-game name: Paly

 
#2 Posted at 2011-05-25 04:16        
     
light1 = "red_light_blinking_EP1" createVehicleLocal position NL1;
light1 Attachto [NL1, [0,0,0.35]];

where NL1 is the name of your car - you may need to adjust the lights height
Then you can have a second light2, with a car named NL2 and so on

On the 1970 Plymouth Barracuda it was best at light1 Attachto [NL1, [0,0,0.14]];

This post was edited by palyarmerc (2011-05-25 07:30, ago)

....that's all folks....!

Advertisement


Author Message


Posts: 42
Rank:


Level: Member

Country: uk
Location: bedford
Occupation: gliding
Age: 22
In-game name:

 
#3 Posted at 2011-11-10 17:36        
     
hi i've just use this script to attach a m2 to the MTVR and it works but it onlu faces forward


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2011-11-10 19:59        
     
If you want to change the direction try using light1 setdir angle after the attach command angle would be trial and error 90,180 ect


Author Message


Posts: 42
Rank:


Level: Member

Country: uk
Location: bedford
Occupation: gliding
Age: 22
In-game name:

 
#5 Posted at 2011-11-10 22:33        
     
yer that works now thanks a lot :-)