Announcement

Collapse
No announcement yet.

[Plugin] Http/s REST, blueprintable JSON and Parse REST API manager at once (VaRest)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by martoof View Post
    Hi,
    Thank for 4.25 update !!! you're the best !

    "Get Response Object" seem to not work on 4.24 & 4.25?
    Can you confirm ufna ?

    I have same problem "By HevoYTB-FR on April 20, 2020 9:08 PM on marketplace"


    For the moment my only solution is to "get response content as string + construct my json object and decode json.
    I think I have the same problem. Using 4.25 from store.

    Comment


      Just tested, all works as it should. Please provide example that fails.
      Making games with Unreal Engine https://alyamkin.com

      Comment


        Hi ufna, I have what's hopefully a quick question.

        How do I loop through a Object Array that came in as a response?

        {"ship_values":[{"total_water":"0"},{"total_material":"0"},{"total_score":"0"}]}

        Basically i'm trying to have the key and value come into UE4.

        Example:

        Click image for larger version

Name:	ObjArray.PNG
Views:	244
Size:	113.5 KB
ID:	1774287

        Thanks!

        -T

        Comment


          Hi, ufna I am facing some problem about top-level arrays reading.

          I have tried to do this: https://www.notion.so/HowTo-Read-top...de0c9e65d512f5 but it still does not work.

          Error Log is: LogVaRest: Error: UVaRestJsonObject::SetRootObject(43): Trying to set invalid json object as root one. Reset now.

          Thanks you in advance for your attention.

          P.S. UE4.21

          Edited (1): I've just found actually it did not callback after run Call URL node. Maybe it cause my issue ?
          Last edited by タナポン.TEC; 06-11-2020, 02:31 AM.

          Comment


            ok so I Downloaded 4.25plus from github and compiled source. How do i re compile your plugin for source build engines? your wiki is gone. your site links to dead links etc.
            I need to recompile the plugin so i can use it with a project requiring chaos but it says this error when trying to compile it:

            editor modules can't be compiled while the engine is running.
            Matt Walton: Programmer and owner of WireLiteSoft Games.

            [Streaming Terrains][WireLiteSoft.us]

            Comment


              With 4.25.2 I'm having issues getting my project to package. So I did a fresh pull on the repo and tried to load the the project and can't. I have make sure that the plugin is installed in the engine, but am getting this error when I try to load or build the project:

              ERROR: Expecting to find a type to be declared in a module rules named 'VaRest' in UE4Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null. This type must derive from the 'ModuleRules' type defined by Unreal Build Tool.
              Any Ideas?

              Comment


                Copying the plugin into the project seems to have fixed the issue for now, but I am curious as to why I'm having to do that...

                Comment


                  It's a bug of UE 4.25.2 release. Please check https://forums.unrealengine.com/unre...37#post1792437
                  Making games with Unreal Engine https://alyamkin.com

                  Comment


                    Anyone have any examples on how to get a Map field from the JSON string?

                    Comment


                      I'm trying to call VaRest plugin in my own plugin written in C++. I think I need to get the object of the UVaRestSubsystem in order to be able to access the rest of the VA* objects (e.g. VaRestRequest, VaRestJson, etc.). How do I get the UVaRestSubsystem in C++? I've used BP and it's just a node, but I'm not sure how to do that in C++.

                      Comment


                        Originally posted by jshu_quanser View Post
                        I'm trying to call VaRest plugin in my own plugin written in C++. I think I need to get the object of the UVaRestSubsystem in order to be able to access the rest of the VA* objects (e.g. VaRestRequest, VaRestJson, etc.). How do I get the UVaRestSubsystem in C++? I've used BP and it's just a node, but I'm not sure how to do that in C++.
                        You can use it this way: GEngine->GetEngineSubsystem<UVaRestSubsystem>()
                        Making games with Unreal Engine https://alyamkin.com

                        Comment


                          Thanks ufna.

                          Comment


                            Another noob question.

                            Now I want to bind a function in my plugin's class to the UVaRestRequestJSON::OnRequestComplete delegate. I've followed some tutorials (e.g. https://www.youtube.com/watch?v=MwqgmhOL8gs) about how to register the funciton using UVaRestRequestJSON::OnRequestComplete.AddDynamic() method. However, it looks like the AddDynamic() function requires that the class and method be declared using the UCLASS() and UFUNCTION() macros. However my plugin's class is derived from the IAnalyticsProvider class, which is not derived from any other class. Thus I'm not able to successfully add my class's method as delegate using AddDynamic(). So is there any other way to bind/register delegate function?

                            Comment


                              Ok, looks like I have to use a class that is derived from UObject. So I've done this:

                              header:
                              Code:
                              /**
                              *
                              */
                              UCLASS()
                              class MYOBJECT_API URestCommunicator : public UObject
                              {
                              GENERATED_BODY()
                              public:
                              UFUNCTION() bool Initialize(); UFUNCTION() void OnRESTComplete(UVaRestRequestJSON* Request); UFUNCTION() void OnRESTFail(UVaRestRequestJSON* Request);
                              private:
                              /** The REST system that is used to send data via REST. */ UPROPERTY() UVaRestSubsystem* RESTSystem; UPROPERTY() UVaRestRequestJSON* JSONRequest;
                              };
                              Then in the class's cpp file:
                              Code:
                              bool URestCommunicator::Initialize()
                              {
                              if (GEngine != nullptr) {
                              RESTSystem = GEngine->GetEngineSubsystem<UVaRestSubsystem>(); if (RESTSystem == nullptr) {
                              return false;
                              }
                              } else {
                              return false;
                              }
                              JSONRequest = RESTSystem->ConstructVaRestRequestExt(EVaRestRequestVerb::POST, EVaRestRequestContentType::json); if (JSONRequest != nullptr) {
                              JSONRequest->OnRequestComplete.AddDynamic(this, &URestCommunicator::OnRESTComplete); JSONRequest->OnRequestFail.AddDynamic(this, &URestCommunicator::OnRESTFail);
                              }
                              return true;
                              }
                              I was able to compile the code. However when I run it, during the Initialize(), I got the following error in the Output Log:

                              Code:
                              LogOutputDevice: Error: === Handled ensure: ===
                              LogOutputDevice: Error: Ensure condition failed: this->IsBound() [File:C:\Program Files\Epic Games\UE_4.24\Engine\Source\Runtime\Core\Public\Delegates/DelegateSignatureImpl.inl] [Line: 1132]
                              LogOutputDevice: Error: Unable to bind delegate to 'OnRESTComplete' (function might not be marked as a UFUNCTION or object may be pending kill)
                              As can be seen in my code, I have included UFUNCTION in front of my methods that should handle the delegate. I checked to make sure the JSONRequest object is valid. Could it be that the JSONRequest object really is already in pending state?
                              I know this is probably not a problem with the plugin, and more to do with the delegate add/bind issue. But just wondering if someone else has tried to do this in C++ and can spot where my problem is.

                              Comment


                                Please check two things:
                                1. Solution should be generated again after UFUNCTION was added
                                2. How URestCommunicator class object is created and exists
                                Making games with Unreal Engine https://alyamkin.com

                                Comment

                                Working...
                                X