Which blueprint should i put the function in? Cardgameplayerstate or Cardgamemode where the mana is calculated?
I made the function in the cardgameplayerstate but it doesnt seem to be working.
Thanks!
Which blueprint should i put the function in? Cardgameplayerstate or Cardgamemode where the mana is calculated?
I made the function in the cardgameplayerstate but it doesnt seem to be working.
Thanks!
This code can be added to an ability
All the functions Iām calling in the example would be available with the toolkit and should work off the bat. Create a new ability and get the player ID from the card triggering the ability -> Get player controller then add this code (and any other checks you want to add). Add it to a card and woola! should all work. Let me know if you run into any troubles.
Hi, curious about this feature Customizable Card Game AI, can i setup AI with a different kind of card theme (ie. Hero), than the player uses? And is there some sort of deck builder for players, already integrated?
I shouldāve worded this better from the beginning, my fault.
Basically I need the amount of cards that are in the graveyard set the player mana each tu rn.
For example if there are 5 cards in the graveyard, the player would have 5 mana. If a new card enters the graveyard, then the player has 6 mana, etc.
The problem I am having is that the player state and graveyard actor are different classes, so its hard to make them work together.
I assume it would be easier to create the mana function in the graveyard class?
Hello! Yep, the AIās deck can be changed. The AI currently gets its deck randomly from one of the decks listed in the personality profile. AI decks are loaded from the pre-built decks datatableby default, so if you would like to change the deck(s) used you can add more prebuilt decks to the datatable and set the deck in the AIās personality profile.
As for the deck builder, this was added in update 1.1 and will be available to you on UE4.14 and above
No worries at all, and thanks for clarifying. This would be a different answer
By default, the toolkit will check how much mana they have for the turn from the Get Turn Mana function in the game mode. You can simply change this call so that it points to a new custom function that gets the players graveyard from the game state (As long as you are using update 1.2 of the toolkit). From this, you can get the length of the graveyard array and return the amount of mana based on the length of the array. Should be a fairly simple change to make.
You would find examples of how to get the reference from the game state in one of the Get Card from Graveyard abilities if you get stuck on what to call or how to get the information you need, but let me know anyway if you run into any issues or uncertainties.
Best kit that i have ever spent on!
Really easy to understand the code, but i am still having trouble on how to gamemode works.
Thanks CEORyze, Glad your enjoying the toolkit!
To give you some details, the game mode can be used to enforce the rules, setup, and play style of the game. In the toolkit the game mode handles things like the players entering the game, spawning the AI, checking the games current status (has anyone been defeated?) and a few gameplay related things, like Mana per turn calculations. It only exists on the server and is not replicated to the clients (Important to keep in mind for multiplayer games!), if your after replication this Is where the game state comes in
You probably know about the details in the documentation, but this definitely helps clarify some of the framework details for the engine https://docs.unrealengine.com/latest/INT/Gameplay/Framework/GameMode/index.html Hope this helps!
I tried using my get grave mana but it didnt work out. Although Iām pretty new to unreal so could be why Iām having trouble.
Also I think if I added functions for mana in add card to graveyard/remove card from graveyard, it might be better long term? I would prefer this method if possible.
Any help is appreciated, thanks!
Try this one on for sizeā¦
Only a small change was made in the **Game Mode **-> Get Turn Mana function and should all work as you would expect. Hope this clears things up!
It worked! Now the thing is that I actually need it to be actively changing the mana state every time a card enters/leaves the graveyard. As of now it only updates at the beginning of the turn, which is ok but some cards change the graveyard count on the same turn.
I am able to either get the increase mana or decrease mana working, but I need both so that it can consistently change instead of only doing one of the functions.
Also I think I am doing it to far in the execution chain since the mana will update later after the card goes into the graveyard instead of immediately.
it does card->grave->play card on board->updates mana.
i need card->grave->update mana
Well at least I have an idea of how to get the mana from grave, so thank you for that! Just need a little more help
The Update Player state is mainly used to update UI related elements for things that shouldnāt be replicated. If I remember correctly this Is only called when a few things change, not all so I can see where the delay can occur.
If I understand correctly, lets say at the start of the players turn they have 5 cards in the graveyard, which means they will have 5 mana. If during their turn a 3 mana card is placed onto the board and is sent straight to the graveyard, then 5 will turn into 2 mana, and when it is sent to the graveyard it will add ā1ā mana to the players pool, totaling to 3 mana remaining.
If this is the case, in your graveyard actor at the end of the Add To Graveyard Server Event, you can add the below code to add a single mana to the owning* player (be sure to have the graveyardās player index set so you donāt run into any issues).
I have only briefly tested this and it works, but in theory there should be no troubles setting this up or changing it to work with the mechanics of your game.
UE4.16 Support has been added to the Toolkit!
Note: No change or fixes were required with this update. Migrating any existing 4.15 -> 4.16 projects should not break any of the core toolkit features, however it is recommended to save a project backup/copy before updating your project to the latest engine version.
**Small Feature Update Tutorial: **
With the recent updates to the engine and its inner workings, there is now an easier alternative for how you can update and add new cards sets to your game. Because Data tables are now a supported variable type through blueprints (And with recent fixes in 4.16), creating an array of data tables will now allow you to easily add/remove active card sets and get the card data easier then before. Below you can find the changes to the Get Card Data function within your Deck_FunctionLibrary.
Old:
New:
With this change, simply adding your new card set to the ActiveCardDataTablesArray will make this accessible to the rest of your game!
**Note: **While this was no longer required, you will no longer be able to specify the card set which the card is from. This should not cause any issues and you cards should now be found through the āContainsā logic rather then specifying the card set.
Enjoy!
That is the greatest update, using array instead of creating a new variables really simplify peopleās life in making a new card set.
Great job!
It does update, but it isnāt perfect. Sometimes it wont update the mana when a 0 cost card enters the graveyard until I play a card >0 cost on the field.
Also when a card enters the grave, it doesnāt update the max.
*The example below is based on already having 2 cards in my graveyard
Example, I have 2/2mana -> play 2 cost card on field and it goes to graveyard immediately -> now I have 1/2mana but I should actually have 1/3mana since new card entered the graveyard.
My main concern was getting the mana working so you do not have to necessarily help me as these are more just bugs that I can tinker out. Your help is always appreciated though.
Thanks for the help!
Iāve been looking at this project for awhile now, but for the idea Iāve been floating around in my head, a quick question, or rather, adviceā¦ for multiplayer.
How would I go about, using the engine, implement a wi-fi ad-hoc network with another device (mobile) so that the playerās can ābattleā each other?
The first bug is because of the second, both pretty easy to fix.
One solution would be to add a bool input to the Increase player mana interface message called something like bIncreaseMax, then in the implementation in the player state you can then add a branch which will also increase the max mana like you have described.
You will need to change this for both the player state and the player character (AI version of the player state) if you wish to use the AI that comes with the toolkit.
Hey SaviorNT, the toolkit takes advantage of Unreals multiplayer framework. So the setup and support for this would be limited by the engines ability to provide this, which thankfully it does. I have not personally tested multiple mobile devices on ad-hoc wifi, but setup with the toolkit should not be to difficult, or if any additional work is even needed. So In theory it should work out of the box once you deploy and have the same* version on both devices. Hope this answers your question.
It worked and I got everything I needed for the mana. This is awesome man thanks! I really appreciate your help on this.
I have another feature that I want to add to my game, and Iāll use your map Arena Great Wall as an example.
There are about 4 different areas i can place cards. Im trying to have cards that end up in the first row become a taunt (like hearthstone, shadowverse taunts). Basically I want the first row to be the line of defense.
So my question is where should I look to add this feature? I was thinking of either create a second type as taunt or an ability of taunt, and then implement that into card placement. Maybe create a check box in card placement that makes the card in that space a taunt.
I can explain in more detail if necessary.
If you canāt help me thatās ok, I just want to be pointed in the right direction so I know what area to tackle.
Thank you!
Iām sorry, it was more of a brainstorming question rather than a real one about this particular product, although, it is how I would plan to use this product.
FYI: I did some research on the subject, and you could allow the āhostā to enable the wifi hotspot, and then allow other devices to connect to it for Android, on IOS 7, it is much easier as you can use Multi-Peer. The idea is to find players, in the area, to have ācard battlesā with.
A guess another good way would be to have a small program in the background that records location data every X minutes. If two devices are with Y range, then send a notification to both parties. At this point, then they meet and decide who will be the host player, and then, the host launches the game, the Match server sends the both the host and client a unique WiFi password. The host game would then store the previous password upon launching as host, the game enables the WiFi hotspot, changes password, and then launches the game server. Yeaā¦ At the end of the game, the game then resets the WiFi password back to the original password.
Of course, nothing in blueprints will do this, other than the location data
Looks like I wont have to! Right on the money there. Add a new Card Type for your Taunt cards, then add this support to the placements, the toolkit should handle the rest.
If you wanted to go down the route of setting the cards to āTauntā only if they are played in those placement areas this will be a little more complex but still doable. Add a bool to the placement for whether or not the placement is to convert cards to be āTauntsā, also add this bool to your cards. If your card is placed and is to be a Taunt card then you can intercept this in the āPlay Cardā function in the player controller, which you can then check the placement and set the bool in the card based off this. Keep in mind that if you have anything that moves cards around the board then you will need to cater for the change and recheck whether this card is still meant to be set as a Taunt Card.
Awesome stuff SaviorNT, thanks for sharing. Havenāt seen anything in blueprints for this kind of stuff either but if you do get stuff running on the C++ side, it would be easy enough to make these calls āBluerpintCallableā and expose the functionality to blueprints for you to use with the rest of the toolkit
Loose_Moose are you still active on this forum? I need to get in touch with you about your CCG that youāve been developing. This is AngryJoe via the AngryJoeShow. Apparently I donāt have permissions on the forums to send you a private message.
Look me up on twitter for my contact info!