{"action":"created","issue":{"url":"https://api.github.com/repos/ncsoft/Unreal.js/issues/48","repository_url":"https://api.github.com/repos/ncsoft/Unreal.js","labels_url":"https://api.github.com/repos/ncsoft/Unreal.js/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/ncsoft/Unreal.js/issues/48/comments","events_url":"https://api.github.com/repos/ncsoft/Unreal.js/issues/48/events","html_url":"https://github.com/ncsoft/Unreal.js/issues/48","id":141931157,"number":48,"title":"How do method params get converted to Unreal objects?","user":{"login":"Youdaman","id":287330,"avatar_url":"https://avatars.githubusercontent.com/u/287330?v=3","gravatar_id":"","url":"https://api.github.com/users/Youdaman","html_url":"https://github.com/Youdaman","followers_url":"https://api.github.com/users/Youdaman/followers","following_url":"https://api.github.com/users/Youdaman/following{/other_user}","gists_url":"https://api.github.com/users/Youdaman/gists{/gist_id}","starred_url":"https://api.github.com/users/Youdaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Youdaman/subscriptions","organizations_url":"https://api.github.com/users/Youdaman/orgs","repos_url":"https://api.github.com/users/Youdaman/repos","events_url":"https://api.github.com/users/Youdaman/events{/privacy}","received_events_url":"https://api.github.com/users/Youdaman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-18T17:31:25Z","updated_at":"2016-03-19T12:18:06Z","closed_at":null,"body":"The plugin I'm using has a function as follows:\r\n\r\n`UTexture2D * UAdvancedFriendsLibrary::GetSteamFriendAvatar(APlayerController *PlayerController, const FBPUniqueNetId UniqueNetId, SteamAvatarSize AvatarSize)`\r\n\r\nI'm able to successfully call this as:\r\n\r\n`let texture = AdvancedFriendsLibrary.GetSteamFriendAvatar(PC, friend.UniqueNetId, SteamAvatarSize.SteamAvatar_Large)`\r\n\r\nSo I've worked out how to translate C++ into JS to do things like the above.\r\n\r\nMy question is how do method params get converted into Unreal/C++ objects, and more specifically, how can I cast JS objects to be their proper C++ type and have the same properties and methods?\r\n\r\nWhat follows is a specific example.\r\n\r\nI see later in that above function in C++ it has:\r\n\r\n`uint64 id = *((uint64*)UniqueNetId.UniqueNetId->GetBytes());`\r\n\r\nHowever my friend.UniqueNetId doesn't have a UniqueNetId property or GetBytes() method.\r\n\r\nSo I'm assuming that Unreal.js does some magic and converts the JS object I'm passing as a param to an instance of the appropriate class before handing it to C++ yes?\r\n\r\nIs there a way that I can do this manually myself outside of that function if I want to get this same uint64 id? I've tried creating `new BPUniqueNetId()` variables in JS with no luck, but I reckon I'm not doing it correctly.\r\n\r\nAs far as I understand, this BPUniqueNetId is a variant of FUniqueNetIdString found here: https://docs.unrealengine.com/latest/INT/API/Runtime/OnlineSubsystem/FUniqueNetIdString/index.html\r\nor maybe: https://docs.unrealengine.com/latest/INT/API/Runtime/OnlineSubsystem/FUniqueNetId/index.html\r\n\r\nThis is less a Steam-specific question and more a question of how do I correctly create objects using JS to match their C++ counterparts. There are some hints in your example demos such as `PlayerController.C(PC).bShowMouseCursor = true` and `PlayerController.C(PC).SetInputMode_GameAndUI(widget,false,false)` which I assume means \"cast PC to be a PlayerController and set a property or call a method as that class\" -- however I'm stuck with the example above regarding creating a proper UniqueNetId instance (and its property of the same name) that I can then call GetBytes() on.\r\n"},"comment":{"url":"https://api.github.com/repos/ncsoft/Unreal.js/issues/comments/198692281","html_url":"https://github.com/ncsoft/Unreal.js/issues/48#issuecomment-198692281","issue_url":"https://api.github.com/repos/ncsoft/Unreal.js/issues/48","id":198692281,"user":{"login":"Youdaman","id":287330,"avatar_url":"https://avatars.githubusercontent.com/u/287330?v=3","gravatar_id":"","url":"https://api.github.com/users/Youdaman","html_url":"https://github.com/Youdaman","followers_url":"https://api.github.com/users/Youdaman/followers","following_url":"https://api.github.com/users/Youdaman/following{/other_user}","gists_url":"https://api.github.com/users/Youdaman/gists{/gist_id}","starred_url":"https://api.github.com/users/Youdaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Youdaman/subscriptions","organizations_url":"https://api.github.com/users/Youdaman/orgs","repos_url":"https://api.github.com/users/Youdaman/repos","events_url":"https://api.github.com/users/Youdaman/events{/privacy}","received_events_url":"https://api.github.com/users/Youdaman/received_events","type":"User","site_admin":false},"created_at":"2016-03-19T12:18:06Z","updated_at":"2016-03-19T12:18:06Z","body":"That makes sense :)\r\n\r\nOn that note, given that PrintString is available to BP, why doesn't `KismetSystemLibrary.PrintString(GWorld, 'test')` work? Or am I supposed to access PrintString via another object/path?"}}