I have a game and I got it to generate a 10x10 grid of random blocks using spawn as class and a nested for loop.
Basically the goal is to have the blocks generate server-side and then be passed to players when they join the game.
Also, I have the grid of blocks generating via a level blueprint, I was wondering if there was a way to do it outside of that?
And the last thing is probably much simpler, but I don’t know how to request the server to handle an object being destroyed and awarding points for it (a value in the character itself).
I got pretty far with those, but I’m stuck again, and this time it’s upon trying to use a node called “Spawn Actor for Gameplay Task” which runs on the server and it demands a “Task Owner” I’m lost with the whole task owner thing, i’ve tried a lot of things, but nothing seems to work!
I am not familer with the “Spawn Actor for GamePlay Task” node, But here are pictures of one of my BP’s (It’s a projectile that spawns actors of the specified class every N seconds ):
This is the event graph
I ended up finding that Class Arrays don’t work at all, they always return a value of NULL for any class input. So when i went back and tried to retrieve it, NULL was returned. I went around this by making my own Enumerator mock up and went about it that way with this function to return the proper class. This works for me.
Thanks for the note on networking too, much appreciated
I’m working on trying to get the left mouse button to raycast on the server side right now, as it’s best to handle all logic on the server side so the client isn’t responsible for game changing events. That’s what I’ve been learning anyway, if you have any more helpful links or tips, let me know, and I’m sure ill be back when i run into some trouble with networking xD
The class array should have worked, Could you post info about it?
It could have been that something went wrong when setting the default contents.
Feel free to PM me the link to the thread (or just a question) if you need more help, I do my best to help.
I have done the raycast from camera position( the mouse should be easy to take into account) to pickup a weapon, So I should be able to help if you need it.
Tips:
Make sure that your replicated actors have there owners set, I have had some issues (I can’t remember what exactly) when they did not have an owner.
Good luck
PS: I’ve done most of the network related stuff in C++, so I may have to translate to the BP equivalent.