# Pass Command Line Arguments For Specific PIE Client

**URL:** <https://forums.unrealengine.com/t/pass-command-line-arguments-for-specific-pie-client/444749>\
**Category:** Mobile\
**Tags:** game-instance, command-line, unreal-engine, editor, UE4, CPP, question\
**Created:** [March 6, 2019, 11:35pm UTC](https://forums.unrealengine.com/t/pass-command-line-arguments-for-specific-pie-client/444749 "2019-03-06T23:35:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_55a04064](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_55a04064](https://forums.unrealengine.com/u/anonymous_user_55a04064)\
**Post date:** [March 6, 2019, 11:35pm UTC](https://forums.unrealengine.com/t/pass-command-line-arguments-for-specific-pie-client/444749/1 "2019-03-06T23:35:51Z")

</div>

I’m currently trying to figure out how to pass some command line arguments to only some of the clients launched by the engine using the ‘Play In Editor’.

Here’s a link to the Unreal Engine’s source code:  
[https://github.com/EpicGames/UnrealEngine/blob/811c1ce579564fa92ecc22d9b70cbe9c8a8e4b9a/Engine/Source/Editor/UnrealEd/Private/PlayLevel.cpp#L2599](https://github.com/EpicGames/UnrealEngine/blob/811c1ce579564fa92ecc22d9b70cbe9c8a8e4b9a/Engine/Source/Editor/UnrealEd/Private/PlayLevel.cpp#L2599)

For example, I would like to be able to pass a custom command line argument to the first 4 clients that spawn, but not to the rest. (e.g. first 4 have --has\_pet, but the rest of the clients don’t)

How would I go about doing that? (Assume that I can change the Unreal Engine’s code)

---

<div class="post-metadata">

**Author:** ![developpeur2000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@developpeur2000](https://forums.unrealengine.com/u/developpeur2000)\
**Post date:** [March 7, 2019, 3:08pm UTC](https://forums.unrealengine.com/t/pass-command-line-arguments-for-specific-pie-client/444749/2 "2019-03-07T15:08:26Z")

</div>

In PIE there is no command line argument, as the clients are only simulated and all launched from your editor.

But you are able to modify the game the way you want in the GameInstance by overriding [UGameInstance::InitializeForPlayInEditor](https://api.unrealengine.com/INT/API/Runtime/Engine/Engine/UGameInstance/InitializeForPlayInEditor/index.html)

---

<div class="post-metadata">

**Author:** ![rickyviking](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rickyviking](https://forums.unrealengine.com/u/rickyviking)\
**Post date:** [January 19, 2023, 9:53am UTC](https://forums.unrealengine.com/t/pass-command-line-arguments-for-specific-pie-client/444749/3 "2023-01-19T09:53:12Z")

</div>

How/where would you override [UGameInstance::InitializeForPlayInEditor](https://api.unrealengine.com/INT/API/Runtime/Engine/Engine/UGameInstance/InitializeForPlayInEditor/index.html)?  
Should one need to subclass UGameInstance and assign it to what, at which point?  
Thank you
