x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Cant get EditInline to work

Hello, im trying to do a modular weapon system where it has subobjects that are used for the firing logic and zooming, and i want those to be editable from the properties, in UDK it worked with editinline in the properties and editinlinenew in the class declaration of my subobject, and i could create the instance of the object from the green arrow in the properties. I cant get it to work on UE4, ive added editinlinenew to the class parameters in my UObject and then set the variable in my weapon like this :

    UPROPERTY(EditDefaultsOnly,EditInline ,Category=Firing)
         UFireMode * CurrentFiremode;

It would work by not using the Editinline keywork perfectly fine. but i really want to be able to create the object from the properties, as if not, it clutters the blueprints by a lot. Ive tried spawning that variable in the default properties function with NewObject function, and it shows the variables of the object in the properties, but i cant create, delete, or change its class, wich is what i need.

Product Version: Not Selected
Tags:
more ▼

asked Mar 11 '14 at 02:25 AM in C++ Programming

avatar image

ue4-archive ♦♦ STAFF
50k 3669 1999 9123

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

Hi Victor,

If you just want to be able to choose what type UFireMode is in the Default Properties, you can make an EditInline (or EditAnywhere) variable that represents the class you want UFireMode to be, and then spawn an instance of that class at runtime in C++.

You can see an example of this in Pawn.h, with the variable AIControllerClass

 /** default class to use when pawn is controlled by AI. */
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=AI)
 TSubclassOf  AIControllerClass;

Then the actual AIController* is assigned to when the object is created:

 if ( AIControllerClass != NULL )
 {
     FActorSpawnParameters SpawnInfo;
     SpawnInfo.Instigator = Instigator;
     SpawnInfo.bNoCollisionFail = true;
     SpawnInfo.OverrideLevel = GetLevel();
     Controller = GetWorld()->SpawnActor( AIControllerClass, GetActorLocation(), GetActorRotation(), SpawnInfo );
     if ( Controller != NULL )
     {
         Controller->Possess( this );
     }
 }
more ▼

answered Mar 11 '14 at 11:10 AM

avatar image

ue4-archive ♦♦ STAFF
50k 3669 1999 9123

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hi Victor,

Just to be clear, are you trying to edit from within the Blueprint, or from the Details panel of the actor placed in the level?

Either way, try using just EditAnywhere and let us know if that gives you the result you desire.

Cheers!

more ▼

answered Mar 11 '14 at 02:25 AM

avatar image

ue4-archive ♦♦ STAFF
50k 3669 1999 9123

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:25 AM +

I was trying to edit it from the blueprint, as EditDefaultsOnly, im going to test with EditAnywhere

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question