Git Product home page Git Product logo

Comments (3)

Madecu avatar Madecu commented on September 25, 2024

Hi @MTeuberItemis,
Those attributes are declared in a C++ class.
First, you need to add your new variable to the Pedestrians structure.
image

Then, define it in ActorBlueprintsFunctionLibrary
image

from carla.

MTeuberItemis avatar MTeuberItemis commented on September 25, 2024

Thank you for that input, that already helps a lot.
But I still get some errors that I dont really understand.

There are two cases I tested with different outcomes: [everything in carla 0.9.13]

CASE 1:

I added following code:
PedestriansParameters.h: line 59 (bottom of the code)

...
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool on_wheelchair = false;
};

ActorBlueprintFunctionLibrary.cpp: line 1124:

Definition.Attributes.Emplace(FActorAttribute{
TEXT("on_wheelchair"),
EActorAttributeType::Bool,
GetWheelchair(Parameters.on_wheelchair)});

this resulted in a build error, when I tried to launch my locally built carla:
it stopped at module 5/8:

make: *** [CarlaUE4Editor] Fehler 6

CASE 2

inspired by: how "is_invincible" was added, i made no changes to original pedestrianparameters.h
and added following to
ActorBlueprintFunctionLibrary.cpp: line 1144:

FActorVariation OnWheelchair;
OnWheelchair.Id = TEXT("on_wheelchair");
OnWheelchair.Type = EActorAttributeType::Bool;
OnWheelchair.RecommendedValues = { TEXT("false") };
OnWheelchair.bRestrictToRecommended = false;

with this it was possible to build, but unfortunately when I tried to spawn walkers, it gave me following error:

Unknown error while trying to spawn actor

Interestingly, "on_wheelchair" also got added to the properties mentioned in my original question:

LogBlueprintUserMessages: [WalkerFactory_C_0] on_wheelchair
LogBlueprintUserMessages: [WalkerFactory_C_0] role_name
LogBlueprintUserMessages: [WalkerFactory_C_0] gender
LogBlueprintUserMessages: [WalkerFactory_C_0] speed
LogBlueprintUserMessages: [WalkerFactory_C_0] is_invincible
LogBlueprintUserMessages: [WalkerFactory_C_0] generation
LogBlueprintUserMessages: [WalkerFactory_C_0] age

from carla.

MTeuberItemis avatar MTeuberItemis commented on September 25, 2024

it was actually a problem in another part of the walkerFactory. the second approach works just fine. thank you

from carla.

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.