Page MenuHomeFeedback Tracker

Feature Request for vector retrieval
Assigned, UrgentPublic

Description

Requesting to add the ability to retrieve Object position and orientation with one method such as GetPosYPR()
Print( player.GetPosYPR() );
Returns <X Y Z>,<Y P R> (X Y Z, Yaw Pitch Roll)
also adds the ability for offsets in such manner as: player.GetPosYPR(); - "X Y Z, Y P R"

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
General

Event Timeline

Zedmag created this task.Apr 6 2020, 12:25 PM

You can add that yourself like this:

modded class Object 
{
    Param2< vector, vector > GetPosYPR()
    {
        return new Param2( GetPosition(), GetYawPitchRoll() );
    }
    
    void SetPosYPR( Param2< vector, vector > params ) //or pass a string and split and reinterpret that as your two vectors
    {
        SetPosition( params.param1 );
        SetYawPitchRoll( params.param2 );
    }
}

If you really need it, feel free to use my code example version and modify it to your liking.
I don't see a use case for having both operations combined. You usually only modify one of the attributes when hard coding an offset.
So we don't really need this added into vanilla.

Zedmag added a comment.Apr 6 2020, 1:36 PM

"Engine Class 'Object' can not be modded"

Ah okay, too deep down. Perhaps Entity or EntitiAi works out. If none of the general base classes work for you, you can have a look at what kind of objects you use it for. If they are all items, you could use ItemBase

Geez changed the task status from New to Assigned.Apr 15 2020, 12:20 PM