OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Flauta on 02 Aug 2005, 08:44:20

Title: needed script...
Post 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...
Title: Re:needed script...
Post by: 456820 on 02 Aug 2005, 18:27:20
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
Title: Re:needed script...
Post by: bedges on 02 Aug 2005, 19:40:11
Code: [Select]
;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.
Title: Re:needed script...
Post by: Flauta on 03 Aug 2005, 01:04:50
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!
Title: Re:needed script...
Post by: Flauta on 03 Aug 2005, 02:47:51
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  :-\
Title: Re:needed script...
Post by: rhysduk on 03 Aug 2005, 11:41:06
Quote from: Flauta
Please make an other one  :-\
Quote

*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
Title: Re:needed script...
Post by: Flauta on 03 Aug 2005, 21:28:41
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
Title: Re:needed script...
Post by: bedges on 04 Aug 2005, 17:38:29
m'kay. if you could tell me how it doesn't work, that would help to find the bug.

also, weapons classnames -

Quote
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 -

Code: [Select]
_pbrz = getpos billy select 2
Code: [Select]
m113_name setpos [_pbrx + (1*sin(_pbrdir)), _pbry + (1*cos(_pbrdir)), _pbrz]
Title: Re:needed script...
Post by: Flauta on 04 Aug 2005, 21:11:45
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!