OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Flauta on 02 Aug 2005, 08:44:20
-
Hey! I need a little script.... I dont know how to do it... but IÂ'm quite sure that it can be done with the Cosin-Sin thing....
I need a script which must attach any cargo to any other object.. like a M2 Machinegun in a 5th Truck... and the orientation must be the same... it can be done easily with the setpos command.. but if you set an offset to any direction, it will keep it without getting the angle direction of the first object...
if mi english isn't clear.. ask.. :P
What IÂ'm trying to do is to attach an M113 to a Mark 2 PBR... (like it is in the back)
Ha!! and I forgoth the Class name for the Stachel Charges/Pipe Bombs.. or whatever...
Thanks anyway...
-
well first question i remember seeing a script in the ed depot wich attacked an M2 to a 5t truck but i had a look and cant find it
seconds question isnt it 'Pipebomb' thats what i can remember hope that helps alittle ill have a nother look in the dpot and ill look for a link
-
;put m113 on pbr
#loop
_pbrx = getpos pbr_name select 0
_pbry = getpos pbr_name select 1
_pbry = getpos pbr_name select 2
_pbrdir = getdir pbr_name
m113_name setpos [_pbrx + (1*sin(_pbrdir)), _pbry + (1*cos(_pbrdir)), _pbry]
~0.1
?not (stop_pbrloop):goto "loop"
exit
to end the setpos loop, set stop_pbrloop to true.
-
Well, The Bedge's Script did it, Thanks guys!!!
And... I Thought it was pipebomb... but it is not? I'll try again, but I tryed whit Pipebomb and didnt work... maybe I didnt Writed it well.. or someting..
Thanks
You exel boys!
-
no, IÂ've lied ;D.... BedgeÂ's Script dinnt make it :s He gets de Idea... but the script dind't work..... and I cant fund the problem! :-[
Please make an other one :-\
-
Please make an other one :-\
*Rolls on floor in sheer laughter*
LOL ;D Thats great!!
If the RECRUITMENT Depot was working then you could ask (politely) in there.
Use the recruitment lounge if needs be.
Have you thought about starting to script yourself?
Rhys
-
hey whatÂ's your problem?
I know the basics of scripting, and I made a lot of own made scripts, but this script go beyond mi knowledge... and I jus tried to fix the problem, but mi I didnt get any result, the script keeps not working propely..
so because I used this way to solve mi problem....
I hope this dont bother anyone
-
m'kay. if you could tell me how it doesn't work, that would help to find the bug.
also, weapons classnames -
Pipebomb(Satchel Charge)....................................Pipebomb
Timebomb(30s delayed satchel, no remote detonation).........Timebomb
look at this (http://www.ofpec.com/editors/faq_view.php?id=100).
EDIT - found typos in code -
_pbrz = getpos billy select 2m113_name setpos [_pbrx + (1*sin(_pbrdir)), _pbry + (1*cos(_pbrdir)), _pbrz]
-
Ouch! im sure it dosnt work because of that typos... I'll trying to make it work on a few minutes.... Thanks bedges!
And In first thime Pipebomb dosnt work for me because I was adding it whit Addweaponcargo ::) jeje and I must add it whit Addmagazinecargo....
Thanks for your patient!!!!
CHeers!