Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Script that I'm using in my "Convoy" mission to place crates in the truck
- ; If crates were loaded to open truck then show that they're inside
- ; Create dummy crates
- ~1
- _crate1a = "unimogadd_crate" camCreate [0,0,0]
- _crate2a = "unimogadd_crate" camCreate [0,0,0]
- _crate3a = "unimogadd_crate" camCreate [0,0,0]
- _crates = [_crate1a,_crate2a,_crate3a]
- ; Wait for player to load crates to open truck
- #WaitToLoad
- @Crate_Vehicle in [t1,t3,t4]
- _anchor = Crate_Vehicle
- ? _anchor == t1 : _CoordsX=[-0.461914,0.53125,-0.0126953]; _CoordsY=[-1.86377,-1.87866,-1.96484]; _CoordsZ=[1.72502,1.73502,2.11004]; _dirs=[273.866,270.366,359.866]
- ? _anchor in [t3,t4] : _CoordsX=[-0.0625,-0.0644531,-0.0625]; _CoordsY=[-1.46631,0.691406,-0.415771]; _CoordsZ=[1.5351,1.58001,1.90002]; _dirs=[269.866,269.866,269.866]
- _i = 0
- ~3
- ; Place dummy crates in the truck
- #SetPosLoop
- ? Crate_Vehicle != _anchor : {_x setPos [0,0,0]} forEach _crates; goto "WaitToLoad"
- _crate = _crates select _i
- _dir = getDir _anchor
- _A = _CoordsX select _i
- _B = _CoordsY select _i
- _X = (getpos _anchor select 0) + _B*(sin _dir) + _A*(cos _dir)
- _Y = (getpos _anchor select 1) + _B*(cos _dir) - _A*(sin _dir)
- _Z = (getpos _anchor select 2) + (_CoordsZ select _i)
- _crate setPos [_X, _Y, _Z]
- _crate setDir _dir + (_dirs select _i)
- ? _i < (count _crates)-1 : _i=_i+1; goto "SetPosLoop"
- ~0.01
- _i = 0
- goto "SetPosLoop"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement