Page MenuHomeFeedback Tracker

"setVectorDir" does not work properly with attached unit
Assigned, WishlistPublic

Description

Trying to change direction of attached unit with setVectorDir command is futile at the moment.

setVectorDir - changes direction momntarily and returns to default direction
setVectorDirAndUp - works
setDir - works

Details

Legacy ID
2394938481
Severity
None
Resolution
Open
Reproducibility
Always
Category
Scripting
Steps To Reproduce

In the editor execute

player attachto [nearestBuilding player, [0,0,10]]

try to change direction:

player setVectorDir [1,0,0];

press EXEC -> player turns right 90 degrees. Press Ecs to close debug console -> player returns to default direction.

try

player setVectorDirAndUp [[1,0,0],[0,0,1]] -> works
player setDir 180 -> works

Event Timeline

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Scripting.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Open.
Killzone_Kid set Legacy ID to 2394938481.May 7 2016, 6:40 PM
Bohemia added a subscriber: AD2001.May 29 2014, 9:11 PM

Yeah, it got executed but just failed to have the status remained.

This is bizarre. It works now even though there was no update, so basically it is the same version that I used for initial testing. I know for sure 1 more person had the same issue confirmed, but it is ok now. Dunno what to say.

F2kSel added a subscriber: F2kSel.May 7 2016, 6:40 PM

Not working for me in current Dev build.

Yep, I also find another problem between setPitchBand and attachTo, pitch byond 90 degrees flips vectorDir if obj was attached that BI fnc failed to handle it, I tried many hours to implement the fnc to handle attached obj but can't improve it, I'll note this on wiki today.

F2kSel added a comment.Jun 1 2014, 2:28 PM

That's no so much a bug but a limit of the script and is mentioned in the Function.

I have found this to be quite useful.

http://forums.bistudio.com/showthread.php?160330-Scripting-Discussion-(dev-branch)&p=2679302&viewfull=1#post2679302

Thanks @F2k, I’ve tried bapedibupa’s fncs and they really work better than setPitchBank, although BI fnc is the fastest among all who takes 0.1416ms while the rest take more than 0.21ms, I just need more time to figure out if it was attachTo destroy the algorism.
Limitation mentioned as 90 counted as 89.9 doesn’t matter, it was still nicely written but I’m just testing why vectorDir flip on attached obj at a certain pitch, which makes it no longer so functional as bapedibupa’s before dev write it into the engine.

The issue is present again in the latest dev build. Cannot attach player to a building anymore so attaching player to a helicopter. Setting vectordir now does some chaotic turning and sets player back to default direction it was facing when attached.