Problem with packaging

Hi, I posted it in Android development but now I realised that problem occurs also on Windows so it’s not a problem of android.
One script does not work- it simulates a place of spawning items, every time it should be diffrent but it is the same always (in preview it did work).

I have tried to ideas,

the first:

and the second:

Both work in preview, neither first nor second after packaging.

What seems to be the problem?

Use a Random Integer In Range From Stream node instead, promote the stream to a variable and seed it at begin play, or before your loop.

These nodes:
(Just drag off from Stream and click promote to variable to create the stream variable.

I am sorry but I do not understand it at all.
First of all, shoudl I modificate first or second setup?
Than, should I delete all my nodes, or just change some of theme?
In which blueprint should I put stream and seed random streem?

Sorry for, maybe stupid, questions but I am a beginner. Whole game works, only this tiny detail does not :confused:

The second one, like this:

The first one won’t work because there is no equivalent node for Random Point in Bounding Box that uses a random stream, but you could manually create one that has the same effect. The random number generators always generate the same random number in a packaged game unless you use the “from Stream” versions. (As you can seed these).

edit: Here is how you could do it the first way, by replacing the Random Point in Bounding Box, though there could be an easier way:

The BoxExtent variable is of type “Box”, here you can set your extents to generate random points in.

This method would be more random than selecting from predefined points, like it was in my first screenshot.

There is now almost morning in my country so I will try the second screenshot tommorow.

But your first solution, according to my second setup doesn’t work :confused: It spawns items correctly but when the player loses and level restarts,they are spawned in the same places as in the first attempt. When I play in editor, in preview window, every restart is followed by a new spawning, every item is in a different place- that is my target. But when I am packaging it and open on andriod od as windows application my items are spawned in the same way always, every time I play the game.

I hope your secend solution will solve it, thank you very much for your help!

The second one should work, though I’m not sure why the first isn’t working for you, maybe make sure you are using a “Seed Random Stream” node, and not a “Set Random Stream Seed” node.

That is how I set up first:

As I said I will test second idea tommorow due to extreme tiredness but I have one more qustion about this idea. It might be stupid :wink:
So, In the viewport of my spawn area I have a box collision and few spawn points in it. In your second setup there is no connection between this spawning area with spawn points and the spawning process. How will the game know, were to spawn the items? (it’s late and my English is not perfect so if it is hard to understand what i wrote i try to explain my doubts tommorow).

Well, it might be obvious but I have aporblem
How is that action called? I cannot finde one
what.png

It’s a regular Vector + Vector node, just right-click the pin on the right and click “Split Struct Pin” to split into the the 3 separate axis values

So here it is:


but what to do with construction script? How to tell game, what is my Box extent 1 and Box center 1 and where to spawn the items?

In your original blueprint you were using your SpawnArea object, and getting its relative location and Box Extent variables to control where things are spawned.

You can do that still in your current version:
The relative area is the same as the BoxCenter1 variable in your current blueprint, so you can get that from your SpawnArea actor. You can do it similarly for the Extent, you could add a Box variable to your SpawnArea actor, and then get it, in your function.

Hmmm, I do not get the one thing. Why my first and second blueprint and your first solution DID work in preview but did not work in game.

The last screenshot you posted isn’t working still in a packaged game?

Haven’t done in yet because I am still not sure how to setup all these variables etc, I try to do it with trial and error method but so far it spawns all the items in one place- the center of scene,

Ah I just realized that SpawnArea is a collision box. Try this:

edit: replace the spawn node with add child component node, obviously

All items now are spawned in one xy location, only z differs what makes a tower in a center of my spawn area :confused:
Here are the screenshots, do not care about the names- dobry and zly means good and bad in my language what refers to the action that follows picking up an items :slight_smile:

Spawn dobre (or zle function):

Here is construction script:

And I still have “set spawn points function” should I delete it? Can it affect a simulation? Because I wold leave it in case of returning to first idea with some new items I am going to create in future.

I realised one mistake and change first blueprint a little bit, now it again spwan all items in one place and they look as one :confused:

That is what i changed:

Your attachment didn’t work, however I notice you haven’t connected things right, it should be Relative Location minus Box Extent. You have them reversed.

You are also setting your box extent to 0,0,0.

It should be set to whatever size the spawn area should be, those are its dimensions. If it’s 0,0,0 everything will spawn in one space

Atachment was about relative location minus box extent, I also noticed it just after posting my screenshots.

Well, now simulation work but in preview it spawns the object the same way always. I will package game and check how it works.

It does not work :confused:
As always. Preview works fine. Everytime I restart game the spawning is different. After packaging, none restart changes anything. Items are spawn everytime in same way :confused: