Code Monkey home page Code Monkey logo

Comments (5)

victorbstan avatar victorbstan commented on May 27, 2024

I figured out that I had to re-build the solution from within Unreal Engine for VisualStudio to pick up on #include "CGTerrainManager.h" as a real thing, but SetUpTerrain(); is still not a thing...

from cashgenue.

midgen avatar midgen commented on May 27, 2024

The method is ACGTerrainManager::SetupTerrain, you need to call it on an instance of CGTerrainManager.

from cashgenue.

victorbstan avatar victorbstan commented on May 27, 2024

Thanks, although it seems I have to provide it with a number of different parameters, which isn't explained in the README.

I've gotten to the point where I'm setting up the noise generation params:

UUFNNoiseGenerator * NoiseGenerator = new UUFNNoiseGenerator();
ACGTerrainManager * TerrainManager = new ACGTerrainManager();

TerrainManager->SetUpTerrain(NoiseGenerator, NoiseGenerator, ?);

But I'm not sure about what the last AActor aTrackingActor param is supposed to be...

Originally I assumed it would be the player, but the player is a APawn, so I'm not sure how to get that as an AActor type.

	UWorld * World = GetWorld();
	if (World && World->GetFirstPlayerController() != NULL)
	{
		APawn * Player = World->GetFirstPlayerController()->GetPawn();
		FVector PlayerLocation = Player->GetActorLocation();

		TerrainManager->SetUpTerrain(NoiseGenerator, NoiseGenerator, ?);
	}

Should I cast (AActor *)Player ? Is that reasonable?

As a side note, I am not completely certain if I can do: ACGTerrainManager * TerrainManager = new ACGTerrainManager();

There are no problem indicated in VisualStudio, but when I try to compile in UE4, I get this message:

CompilerResultsLog:    Creating library E:\victo\Documents\Projects\Code\ProcTerrainC2\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-ProcTerrainC2-8744.suppressed.lib and object E:\victo\Documents\Projects\Code\ProcTerrainC2\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-ProcTerrainC2-8744.suppressed.exp
CompilerResultsLog: Error: ProcTerrainC2GameModeBase.cpp.obj : error LNK2019: unresolved external symbol "private: static class UClass * __cdecl ACGTerrainManager::GetPrivateStaticClass(void)" (?GetPrivateStaticClass@ACGTerrainManager@@CAPEAVUClass@@XZ) referenced in function "public: virtual void __cdecl AProcTerrainC2GameModeBase::BeginPlay(void)" (?BeginP
lay@AProcTerrainC2GameModeBase@@UEAAXXZ)
CompilerResultsLog: Error: ProcTerrainC2GameModeBase.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl ACGTerrainManager::ACGTerrainManager(void)" (??0ACGTerrainManager@@QEAA@XZ) referenced in function "public: virtual void __cdecl AProcTerrainC2GameModeBase::BeginPlay(void)" (?BeginPlay@AProcTerrainC2GameModeBase@@UEAAXXZ)
CompilerResultsLog: Error: E:\victo\Documents\Projects\Code\ProcTerrainC2\Binaries\Win64\UE4Editor-ProcTerrainC2-8744.dll : fatal error LNK1120: 2 unresolved externals
CompilerResultsLog: ERROR: UBT ERROR: Failed to produce item: E:\victo\Documents\Projects\Code\ProcTerrainC2\Binaries\Win64\UE4Editor-ProcTerrainC2-8744.dll

from cashgenue.

midgen avatar midgen commented on May 27, 2024

I'm nearly finished with the multiplayer branch and will be merging to master in the next couple of days. This should hopefully be the last significant API change.

The code steps should be simpler, just one step:

  1. Call SetupTerrainGenerator with the various struct attributes/noise generators

Any Actors that you have given a TerrainTrackerComponent to will take care of registering themselves with the ACGTerrain actor.

fyi - You can't just new an AActor, you have to use World::SpawnActor

from cashgenue.

midgen avatar midgen commented on May 27, 2024

See the latest README.md

https://github.com/midgen/cashgenUE

from cashgenue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.