Jump to content

WMundstock

Member
  • Content Count

    3
  • Joined

  • Last visited

  • Medals

Posts posted by WMundstock


  1. After some time messing around I find a quite easy workaround.

    Option 1 is to use a reference object for the Transform which is an array with 4 positions, each one is a vector. 

    ref EntitySpawnParams params = new EntitySpawnParams();
    referenceObject.GetWorldTransform(params.Transform);

    Second alternative is as follow

    EntitySpawnParams params = EntitySpawnParams();
    params.TransformMode = ETransformMode.WORLD;
    params.Transform[0] = referenceObject.GetWorldTransformAxis(0);
    params.Transform[1] = referenceObject.GetWorldTransformAxis(1);
    params.Transform[2] = referenceObject.GetWorldTransformAxis(2);	
    params.Transform[3] = referenceObject.GetOrigin();

    Pretty clean...

     

    Hope this helps someone else 😀


  2. For some reason something happened to my scenario that was work in progress. It seems I accidentally done something that I cannot revert. It is almost like the scenario is in an inconsistent state and I can't find why.

     

    When I run the scenario I get the error below:

       WORLD        : InitEntities 'world'
        ENTITY       : Init entity @"ENTITY:2305843009213693953" ('GameMode_Plain2', SCR_BaseGameMode) at <9543.469727 31.629999 1673.062012>
         SCRIPT    (E): NULL pointer to instance
    Class:      'SCR_GroupsManagerComponent'
    Function: 'EOnInit'
    Stack trace:
    scripts/Game/Groups/SCR_GroupsManagerComponent.c:655 Function EOnInit

    It also shows the popup saying there is a script error, etc.

     

    Then If I click to select the US group I get the following error in the console.

     

    SCRIPT    (E): NULL pointer to instance
    Class:      'SCR_GroupSubMenu'
    Function: 'OnMenuShow'
    Stack trace:
    scripts/Game/Groups/SCR_GroupSubMenu.c:92 Function OnMenuShow
    scripts/Game/UI/Menu/SubMenu/SCR_SuperMenuBase.c:100 Function OnTabShow
    scripts/Game/UI/Components/WidgetLibrary/SCR_TabView/SCR_TabViewComponent.c:225 Function CreateTabContent
    scripts/Game/UI/Components/WidgetLibrary/SCR_TabView/SCR_TabViewComponent.c:307 Function SelectIndex
    scripts/Game/UI/Components/WidgetLibrary/SCR_TabView/SCR_TabViewComponent.c:349 Function ShowTab
    scripts/Game/UI/Menu/GameMode/SCR_RespawnSuperMenu.c:277 Function UpdateTabs
    scripts/Game/UI/Menu/GameMode/SCR_RespawnSuperMenu.c:293 Function HandleOnFactionAssigned
    scripts/Game/GameMode/Respawn/SCR_RespawnMenuHandlerComponent.c:138 Function HandleOnFactionAssigned
    scripts/Game/GameMode/SCR_BaseGameMode.c:862 Function HandleOnFactionAssigned
    scripts/Game/GameMode/Respawn/SCR_RespawnSystemComponent.c:705 Function SetPlayerFaction
    scripts/Game/GameMode/Respawn/SCR_RespawnSystemComponent.c:595 Function RpcDo_SetPlayerFaction
    scripts/Game/GameMode/Respawn/SCR_RespawnSystemComponent.c:477 Function DoSetPlayerFaction
    scripts/Game/GameMode/Respawn/SCR_RespawnComponent.c:553 Function RpcAsk_SetPlayerFaction
    scripts/Game/GameMode/Respawn/SCR_RespawnComponent.c:481 Function RequestPlayerFactionIndex
    scripts/Game/GameMode/Respawn/SCR_RespawnComponent.c:361 Function RequestPlayerFaction
    scripts/Game/UI/Menu/GameMode/SCR_RespawnSubMenuBase.c:393 Function RequestFaction
    scripts/Game/UI/Menu/GameMode/SCR_SelectFactionSubMenu.c:285 Function ConfirmSelection
    scripts/Game/UI/Menu/GameMode/SCR_RespawnSubMenuBase.c:363 Function HandleOnConfirm
    scripts/Game/UI/Components/WidgetLibrary/Button/SCR_ButtonBaseComponent.c:81 Function OnClick
    scripts/Game/UI/Menu/GameMode/SCR_DeployMenuTile.c:107 Function OnClick

     

    I tried removing everything from the scenario and adding it from scratch. I get into the same error all the times.

    Not sure if there is some type of caching that is going on... but it basically rendered my scenario unusable.

     

    SRS_GroupsManagerComponent line 655 is as follows:

    override void EOnInit(IEntity owner)
    {
        SCR_AIGroup.GetOnPlayerAdded().Insert(OnGroupPlayerAdded); //655 is here
        SCR_AIGroup.GetOnPlayerRemoved().Insert(OnGroupPlayerRemoved);
        SCR_RespawnSystemComponent respawnSystem = SCR_RespawnSystemComponent.GetInstance();
        if (respawnSystem)
            respawnSystem.GetOnPlayerFactionChanged().Insert(OnPlayerFactionChanged);
        m_bConfirmedByPlayer = false;
    }

     

    I'm sure it is something simple, but just cant figure it out.

     

    One more information that is useful. Using the same MOD, I created a new world again based on Eden. 

    The second I add the GameMode Plain I get the very same error. If I create a new MOD from scratch I can make it work no problems.

     

    Any help is appreciated.


  3. Hi.

    I wanted to have a custom action to my own prefab so that it will spawn a vehicle to a location. I created a paratemeter like below:

    [Attribute()]
    ref PointInfo spawnPoint;

     

    This is very nice because It would give me referential location for the spawn point. 

    Then I have the following code to get the spawn location.

    private vector GetSpawnLocation()
    {
      vector position;
      spawnPoint.GetWorldTransform(position);
      return position;
    }

    The crash occurs when I try to GetWorldTransform. It throws a memory access violation and crash the whole Workbench.

     

    I can always use another object as a reference, for example:

    IEntity entity = GetGame().GetWorld().FindEntityByName(spawnTarget);
    return entity.GetOrigin();

    But the problem is that this require me to know the name of the target object to copy the origin. Because I want to configure this on a prefab so that I can reuse the prefab everywhere I cannot rely on component name.

     

    Any other workaround that I could use? Any thoughts?

     

    Thank you!

     

×