I can definitely see some strange things happening with the current setup. On each check you are looking at all cards in hand, and if one of all the cards is a special it will let you do your thing.
On “Call Create Card” event you can run your check on the requested card, on this request, if the card is a special you create your own custom bool for “bCanPlaceDuringOpponentsTurn” or something similar. you will then be able to use this bool on the input execution to say whether or not it will let you proceed to place the card.
Back in the card widget you can run this check directly on the card name itself (the card widget will have a card name variable you can check) and check to see if its special.
You can also run this backwards a little and remove all checks for the player turn just to see if there is any other issues going on outside of the is turn active check. Then you can re-enabled this feature and use the custom bool above to make sure you are only checking the one card your trying to place, rather then all cards in the players hand.
I’m a little confused here: I’ve made a custom bool, and if the card is special, I set the bool to true. Which input execution am I running the true/false check on?
Where would I run this check? In the MouseOver function?
Sorry for so many questions, just trying my damnedest to get it working.
Not a problem! It can take time to get your head around it.
So I hope you don’t mind, ive gone back to review the code and come up with a more reliable solution. The other way there are some issues that could occur if not handled correctly. I will note this will let players pick and drag cards from their hand, but only Special cards will actually be played. If you want to only allow players to drag cards if they are special (even though they wont be played if they are not special) then you can leave some of the checks.
In the Card Widget, remove the cast to player controller “Is Turn Active” check from the OnMouseMove function completely. You don’t need this with what your trying to do.
In the Player Controller, On the Call Create Card event remove the** Is Turn active **branch check and your new additional get card data checks etc.
Still in the Player Controller, Right after the IsTurnActive macro there are a bunch of switches to determine whats currently being done (Placing card, card interactions etc). Move each of the macros to be after the switches on the Card interaction path. The “Move” input has a bunch of other code tied to it, you can move this along with the node after the Card interaction switch execution. This is so that interactions cannot be made during the turn.
Now this is where we are now going to do the special check. When the players client asks the server to play the card, we want to see if its valid for the current players turn. In the Play Card function (which is run on the server) Add the check after the Get Card Data function and run the same “Is turn Active” macro and either continue playing the card or route the branch so the play card
To get a feel of this toolkit I followed the instructions to make my first card set. I made 1 sample card in the set and followed all of the instructions to add the set to the game and editor. Once I load the game I can find my set in the deck builder, but it says that card is not unlocked. I made sure to specify in the deck settings of the card to check the unlocked box and the card is still locked when I load the game. I am pretty new to all of this, so it is possible I am doing something wrong and this may be a simple fix.
Also is there a support email if I have a question? Or do I have to post here when I need help?
Off the bat im not sure not sure whats going on here… A common cause of issues like this could be the Card Name or more specifically the Cards data table row name that may be the same as another card in a set. For example, “NewRow1” in two card sets could have conflicting results.
As for the support email, sure do. Email for any support or general toolkit questions you have. Feel free to email this issue along with some pics of your setup and I can take a look to see if anything stands out.
you have no idea of when I wanted to have understood a word of what you explained, even looked for tutorials about, but about unreal not found, would it be too much to ask a video tutorial of how do I reward card system?
Hey, currently going through something strange. I am trying to enable Card Outline(which should work on the Placement tile when you select Multicard Placement)
However, it seems to think Board Player is the parent, and is casting all the player placements on that, resulting in this.
There are two ways you can do a Card Reward System
a) Custom save structures, if you choose this path, the card will be rewarded locally. The simplest way to do this is like so.
Step 1: Create a save structure that contains a text array of saved cards.
Step 2: Check to see if a save file exists. Then run a branch with true/false.
Step 3: If it exists(true), load it. If it does not exist(false) run the function that creates a new save file(the class would be the custom library save class you’ll have to make.)
Step 4: If the branch was true and the save file is loaded. Run the “Get Data Table Row Names” function, and then connect a “Get” node to the output array. The index should be a random interger, between 0-63 or whichever numbers you want the player to unlock. If it was false, do the same thing after the save file is created.
Step 5: Run these nodes after the “Get Data Table Row Names” function if loading the library was true. The array you use should be one that is casted from the LibrarySave class you loaded.
. After that, just run a save the game function, and the player will now have that card saved.
Step 6: Going back to our library save that already exists(if the branch was true when you first checked.) Connect a branch node that checks if the array contains your card already. If it does, notify the player with a print string, and then end the function. If it does not exist already, AddUnique the name of the card. Then, run a save game function.
This is the basis of how you do a basic save system card unlock, you’ll have to go through the DeckEditor and LibraryCard widgets and run checks to see if the card exists in the LibrarySave class array, and if it returns true, then the card is unlocked(I’d love to go into detail but i have a lot of coding to do in regards to my own game, so you’ll have to really explore and figure this one out yourself, it isn’t hard but it takes time.)
b) You can do an online system with a MySQL database. There is a custom plugin you can get on the marketplace and add to your project called MySQL integration. You will do much the same thing as before, but instead you will be running queries to check your database for the cards that is in the database that matches the players ID. This is a much longer process and will take a lot more work, but it is better for online play, as players cant simply edit the save file to add the best cards.
I hope this helps. I did not make this toolkit, but the system i described should work for a very simple unlock system. Just call the function after a game ends, or with a button in the DeckBuilder UMG widget.
Lets see if I can get through this without missing anything…
Reward systems generally wouldn’t be anything special with the toolkit itself. This can be different depending on your needs but overall this is simply calling something that ends up saving some kind of data that you can read and update each time its called.
As for tutorials, Ridingkeys did a great job at explaining one way to implement this feature and hopefully you will give you a better picture of what the implementation can look like. As mentioned in my last overview about this, what I would recommend is taking a step back and taking a look at understanding the systems involved with the above tutorial as well as the direction points I mention in my last reply.
Save System - There are a lot of tutorials online to help you understand how Unreals save system works and how it can be used. Try https://www.youtube.com/watch?v=LpMGm8pNN9E to help get the ball rolling.
Save Game Function Library (Toolkit) - The toolkit has a number of save features and functions that you can use or learn from. Your user profile will follow a very similar setup, but instead of simply saving a deck you will save out unlocked cards and any other data you are after.
I’m more then happy to help with specific questions, but full feature tutorials are a bit out of reach for now unfortunately. If you get stuck and have questions or hit issues when trying this yourself then feel free to send them over.
So this would be difficult to setup in unreal out of the box. There are two options that I can see…
Create your own widget/plugin that supports text and images. I havnt seen any available plugins but there may be some out there.
The second option which may be the better one would be to use Photoshop to Save the whole card (image + card frame + text + icon text image) This would be the easiest option out of the box and will allow you to customise your cards even further. The downfall is that you will loose the ability to customise/ change the card data on the fly, but you should be able to have the icons and text play together nicely.
Create you own fond which has special characters you can customise and use in your text. This one is a bit out there but its an option that could work with how things are currently setup.
Very strange behavior… Are you able to share some of your Blueprints? (If its happening in the editor then you have been modifying the construction script?) The only reason it should be using the player tile is if you are explicitly using a reference to the tile for this. Wish I could say more to help but without knowing the changes/code its a bit difficult to see what could be going on. So let me know if you can.
Also, thanks a bunch for sharing your tutorial. I’m sure it will help a lot of people getting the ball rolling.
So i guess the better question is where are you currently making your changes to get the card outline to work on the placement? The Card outline by default is on the card itself, and if you want all cards in a single multi-card placement to also highlight in this instance, you should be able to use the card array on the owning placement to run your loop to enable the outline.
Let me know if im going down a different route to what you are trying to do.
Managed to get it fixed(although I don’t know if it’s going to kill performance, we shall see.)
I’m thinking about how to approach a “Spectator” mode that would show the hands of both players. Do you have any ideas?
Ok great. Perf is something you can always improve, so for now it sounds like its working.
Spectator is in its basic form is already supported as you may know. If you weren’t aware, In the Game mode you can enable “Single Client Enabled” and “Spectator” bools to see this in action. As for the UI… to have players access data such as the card in hand so they can see each players cards. By default the cards in hand are not replicated across client for more security reasons. So you have a couple of options:
Move the cards in hand from the Player Controller to the player state. Note here that the player state is replicated, so it may be possible for people to get access to this data even if you don’t intend for them to see it.
The second is to use the game mode to send data to the spectating clients. The Game mode is on the server so they have access to player data and variables In each player controller and also their cards in hand. This is a more timely option that will require more effort to get working but it will be a lot safer when passing around the data to the spectators.
When you have the spectating client able to access the data, you should in theory be able to add two of the Opponent UI widgets and assign then both to the correlating player. You can then simply get access to the cards in hand and have the card widgets actually populate the card widgets so they display correctly. There will be more to this but as an overview it should help. Let me know if you see any issues and we can work through them as they come.
Hey Aaron, been making some good headway with the ToolKit, I’m onto designing card layouts and I cannot seem to find where to “adjust” the “card_image” on the 3D Card layout. The image is to low for the “thinner” card_frame i have made. I can adjust the “veiwcard” 2D preview no worries, but the tabled “3D Card” the image on the card leaves a small gap at the top. I’ve attached images to highlight what I mean. Cheers in advance… I know it’s a simple one, but I’ve spent ages trying to work it out.
This is likely due to the poly-positioning on the model itself. Simple fix but you will need to import the model from UE4 into another 3D modeling application to fix the positioning.
You should be able to right click on the static mesh in the viewport/browser and export to a .fbx file. You can import this .fbx into Maya or 3ds Max (Blender is also free) to adjust the positioning of the Card Image vectors and move them up a few units so they line up with your frame. Reimport and you should be good to go!
Awesome Fixed… I happened to have Blender… had no idea what I was doing at first, moving the cubes around and the card frame up and down, then changed to compositing mode and could access the axis points for each element. Sorted Thanks again.