So I'm having issues trying to execute a LogEventRequest inside of a realtime script. I followed the loot drop tutorial (https://docs.gamesparks.com/tutorials/currencies--virtual-goods-and-achievements/loot-drop-and-gacha-systems.html) to create my loot drop event. Tested it in test harness as well as calling it from inside UE4, and it is working properly. But I don't want to call it inside UE4 in order to prevent cheating and would pefer to call it in a realtime script. However, when I try and call it from inside a realtime script I can not get it to work. I have to be doing something wrong, but I went through all the docs and forum posts to make sure I was doing it right, so I'm currently stuck. Here is my code for the realtime script, I'm just trying to get the shortCode for the first Item it the lootDrop response. The loot_drop event code I'm using is from the tutorial page as is.
var rtData = RTSession.newData();
var request = RTSession.newRequest().createLogEventRequest();
request.SetEventAttribute ("amount", 1);
var response = request.Send();
var scriptData = response.scriptData.lootDrop.shortCode;
i have a similar issue, any update on this?
Could you try logging the response you receive using:
RTSession.getLogger().debug("Got response: " + JSON.stringify(response));
It would appear from your request history that the 'lootDrop' field in this event's response contains an int as opposed to an array.