Problem about port from C++ to BP

I using the code from the Shooter Demo as reference to make a thing in Blueprints, but i got a problem here:



void AShooterCharacter::SpawnDefaultInventory()
{
	if (Role < ROLE_Authority)
	{
		return;
	}

	int32 NumWeaponClasses = DefaultInventoryClasses.Num();	
	for (int32 i = 0; i < NumWeaponClasses; i++)
	{
		if (DefaultInventoryClasses*)
		{
			FActorSpawnParameters SpawnInfo;
			SpawnInfo.bNoCollisionFail = true;
			AShooterWeapon* NewWeapon = GetWorld()->SpawnActor<AShooterWeapon>(DefaultInventoryClasses*, SpawnInfo);
			AddWeapon(NewWeapon);
		}
	}
...

void AShooterCharacter::AddWeapon(AShooterWeapon* Weapon)
{
	if (Weapon && Role == ROLE_Authority)
	{
		Weapon->OnEnterInventory(this);
		Inventory.AddUnique(Weapon);
	}
}




	/** default inventory list */
	UPROPERTY(EditDefaultsOnly, Category=Inventory)
	TArray<TSubclassOf<class AShooterWeapon> > DefaultInventoryClasses;

	/** weapons in inventory */
	UPROPERTY(Transient, Replicated)
	TArray<class AShooterWeapon*> Inventory;

	/** currently equipped weapon */
	UPROPERTY(Transient, ReplicatedUsing=OnRep_CurrentWeapon)
	class AShooterWeapon* CurrentWeapon;


This is what i got now:

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/BPCodeQuestion.png

*Clear BP

https://dl.dropboxusercontent.com/u/28070491/UE/Forums/ClearProblem.png

Then i got problems with that lines:



FActorSpawnParameters SpawnInfo;
SpawnInfo.bNoCollisionFail = true;
AShooterWeapon* NewWeapon = GetWorld()->SpawnActor<AShooterWeapon>(DefaultInventoryClasses*, SpawnInfo);


My problem is how manage the spawn or how make that like in the C++ code.
How or for what i give the index of DefaultInventoryClasses* ?? and how made that in BP ?
Can some one give me an example of this or what is bad ? if is possible with a screen of the configuration in BP.

I’ve already recreated this in Blueprint so I should be able to help you out. You mostly have it right, I’m not at home but I can upload screenshots when I’m there.

GetWorld is your characters World Transform, so Get Player Character—> Get World Transform. Then it takes that transform and feeds it into the Spawn Actor ForEach weapon in DefaultInventoryClasses[Class array index]. Then it adds each weapon to Inventory Actor Array(Object Array).

The * just represents the current index it is on in the for loop, starting with 0. ForEach when i < Number of weapons do spawn actor DefaultInventory*, add weapon

AddWeapon calls OnEnterInventory from the weapon blueprint which sets the owner, then it adds unique to your Inventory Actor Array.

EquipWeapon sets your current weapon variable then calls OnEquip from the weapon, which runs attachmeshtopawn()