Home
Intel Depot
Editors Depot
Missions Depot
Addons Depot
Forum
Welcome, Guest
Sunday 19th May 2013, 12:12:48
Home
Help
Search
Login
Register
OFPEC Forum
OFPEC Forum
»
Editors Depot - Mission Editing and Scripting
»
ArmA - Editing/Scripting General
(Moderators:
h-
,
savedbygrace
) »
Attach unit to player - I'm going crazy here
Pages: [
1
]
Go Down
« previous
next »
Send this topic
Print
Author
Topic: Attach unit to player - I'm going crazy here (Read 319 times)
0 Members and 1 Guest are viewing this topic.
laggy
Offline
"Behold a pale horse"
Attach unit to player - I'm going crazy here
«
on:
02 Mar 2008, 19:10:54 »
Hi all.
I'm working on a script where I want a unit (soldier) to be attached (through setpos command) to the player, but any possibile way I try to solve this issue the attached soldier allways stays on ground level.
If I walk into a building or on top of a terrace structure, the unit is still attached to the player but his level above ground doesn't change as the players does. The player can be on top of a ten floor building and the attached soldier is sliding around down on the street. Meaning : not looking good and makes my idea useless if I can't solve it. I have tried it with normal setpos getpos commands which didn't work, then I tried it like this and it still doesn't work. Not even in the editor.
Here is my script. Please help, Iv'e been trying to solve this and looked for information all day. Sigh
#startofscript#
letgo = player addaction ["Drop Wounded Soldier", "letgo.sqs"]
dropping = false
PublicVariable "dropping"
#loop
_carrierpos = [getposASL player select 0, getposASL player select 1, getposASL player select 2]
? dropping : player removeaction letgo; exit
? velocity player select 0 > 5 OR velocity player select 1 > 5 : dropping = true; PublicVariable "dropping"; exit
? ! (alive player) : wounded setposASL [getposASL wounded select 0, getposASL wounded select 1, getposASL wounded select 2]; dropping = true; PublicVariable "dropping"; exit
wounded setdir getdir player
wounded setposASL _carrierpos
~ 0.01
goto "loop"
#endofscript#
Thanks in advance all of you oracles.
Cheers
Laggy
Logged
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.
Mandoble
Editors Depot
Administrator
Offline
Re: Attach unit to player - I'm going crazy here
«
Reply #1 on:
03 Mar 2008, 13:24:01 »
You may try using modelToWorld coords and see what happens inside buildings:
Code:
wounded setpos (player modelToWorld [0,0,0]);
instead of
Code:
wounded setposASL _carrierpos
Logged
The Triple Blow
|
ArmA Videos
|
Mando Missile ArmA
laggy
Offline
"Behold a pale horse"
Re: Attach unit to player - I'm going crazy here
«
Reply #2 on:
04 Mar 2008, 21:40:40 »
Million thanks Mandoble.
Works great, at least in editor.
Laggy
Logged
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.
Pages: [
1
]
Go Up
Send this topic
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
OFPEC The Editing Center
-----------------------------
=> General Announcements
=> Comments & Suggestions
=> Getting help with BI games
-----------------------------
Editors Depot - Mission Editing and Scripting
-----------------------------
=> Arma3 Alpha - Editing/Scripting General
=> Arma3 Alpha - Editing/Scripting Multiplayer
=> Arma3 Alpha - Editing/Scripting Resources Beta Testing & Submission
=> Arma2 - Editing/Scripting General
=> Arma2 - Editing/Scripting Multiplayer
=> Arma2 - Editing/Scripting Resources Beta Testing & Submission
=> ArmA - Editing/Scripting General
=> ArmA - Editing/Scripting Multiplayer
=> ArmA - Editing/Scripting Resources Beta Testing & Submission
=> OFP - Editing/Scripting General
=> OFP - Editing/Scripting Multiplayer
=> OFP - Editing/Scripting Resources Beta Testing & Submission
=> OFP Elite - Editing General
-----------------------------
Missions Depot
-----------------------------
=> Arma3 Alpha - Single Player Beta Testing
=> Arma3 Alpha - Multiplayer Beta Testing
=> Arma2 - Single Player Beta Testing
=> Arma2 - Multiplayer Beta Testing
=> ArmA - Single Player Beta Testing
=> ArmA - Multiplayer Beta Testing
=> OFP - Missions Beta Testing
=> OFPEC Campaign
=> Mission Discussion
===> Arma3 Alpha - Reviewed Missions
===> Arma2 - Reviewed Missions
===> ArmA - Reviewed Missions
===> OFP - Reviewed Missions
-----------------------------
Addons & Mods Depot
-----------------------------
=> Arma3 Alpha - Configs & Scripting
=> Arma3 Alpha - O2 and Models/Modelling
===> Arma3 Alpha - Texturing
=> Arma2 - Configs & Scripting
=> Arma2 - O2 and Models/Modelling
===> Arma2 - Texturing
=> Arma2 - Visitor 3 and Terrain Editing
=> Arma2 - Addons & Mods Beta Testing
=> Arma2 - Addons & Mods Discussion
=> ArmA - Configs & Scripting
=> ArmA - O2 and Models/Modelling
===> ArmA - Texturing
=> ArmA - Visitor 3 and Terrain Editing
=> ArmA - Addons & Mods Beta Testing
=> ArmA - Addons & Mods Discussion
=> OFP - Addons & Mods General
=> OFP - Addons & Mods Beta Testing
=> OFPEC Hosted Addons
Top of page