Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aaron/fixwheelchair #8001

Merged
merged 12 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions PythonAPI/examples/generate_traffic.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,11 @@ def main():
for spawn_point in spawn_points:
walker_bp = random.choice(blueprintsWalkers)
# set as not invincible
probability = random.randint(0,100 + 1);
if walker_bp.has_attribute('is_invincible'):
walker_bp.set_attribute('is_invincible', 'false')
if walker_bp.has_attribute('can_use_wheelchair') and probability < 11:
walker_bp.set_attribute('use_wheelchair', 'true')
# set the max speed
if walker_bp.has_attribute('speed'):
if (random.random() > percentagePedestriansRunning):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@ void UActorBlueprintFunctionLibrary::MakePedestrianDefinition(


Definition.Attributes.Emplace(FActorAttribute{
TEXT("can_use_wheel_chair"),
TEXT("can_use_wheelchair"),
EActorAttributeType::Bool,
Parameters.bCanUseWheelChair ? TEXT("true") : TEXT("false") });

Expand Down Expand Up @@ -1626,7 +1626,7 @@ void UActorBlueprintFunctionLibrary::MakePedestrianDefinition(
WheelChairVariation.Type = EActorAttributeType::Bool;
if(bCanUseWheelChair)
{
WheelChairVariation.RecommendedValues = { TEXT("true"), TEXT("false") };
WheelChairVariation.RecommendedValues = { TEXT("false"), TEXT("true") };
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
// For a copy, see <https://opensource.org/licenses/MIT>.

#include "WalkerBase.h"


AWalkerBase::AWalkerBase(const FObjectInitializer &ObjectInitializer)
: Super(ObjectInitializer)
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class CARLA_API AWalkerBase : public ACharacter

GENERATED_BODY()

AWalkerBase(const FObjectInitializer &ObjectInitializer);
public:

UPROPERTY(Category="Walker Base", BlueprintReadWrite, EditAnywhere)
Expand Down