Ue4 - Mobile Card Game - Draw Card Problem - user-interface

I am trying to do mobile action game with a card system. I have a 8 different card in array as a text and they are calling function like a skill system. When game start system will shuffle deck and pick 4 card from inside, remove them and add to last of array as you can see downside. After use skills (buttons) if stamina is enough function will work and card will go to last index of array. Everything is working but when i try to start with 4th button ( All system is same) its always going infinite loop. When i press 1 or 2 or 3 its working and after that i can press 4th and its working but if i choose 4th button for a first card its crashing. I am sharing all system to look. I try to do for 5 days and couldnt found please help me and if you can share me your experiences about these systems to more optimize. If you want i can give more information.
Thanks A Lot!
https://imgur.com/a/uapK2u7

capture of your blueprint image
in your GetDatas Function,
looping Deck array, you are trying to swapping (i) and (i-1)
but this logic could be dangerous if i == 0, it would try to access array[-1] and cause crash.

Related

Unity, character selection screen on same PC by two players

The game I am trying to make include local multiplayer to play on same PC. I have done by making the different controllers in input manager and game work perfectly fine.
But now I am onto the part where I have to create a character selection screen for multiple player on same PC. I am beginner to the unity and learning right now. So I have no idea how to make it happen. Because when I tried to make it unity UI didn't able to take two input. At a time
I have also watched some of the threads in which people suggested to make your own eventsystem and button but I tried doing that somehow buttons are not taking any response they are not clickable. If anyone has seen those thread and that method is working for them, so please let me know how to.make it work
Or if someone has any other idea how to do please let me know
Thanks in advance
As far as I know, you CAN'T have more than one event system in the same scene.
So knowing that I'll suggest to change the...perspective about your game, here is something that can work:
You can't have more than one input on the same UI, but you can distinguish "keyboard" inputs. So let's guess the scenario that you have the screen divided in 2 parts, where left side is the Player 1 selection character, and can select between 2 characters, and right side is the Player 2 selection character, with the same number (or different, as you want!) of possible characters.
The pseudo code will be something like:
private Player m_player1;
private Player m_player2;
private CharacterSelection m_CharacterSelection_Player1;
private CharacterSelection m_CharacterSelection_Player2;
If (m_Player1.Input.GetKeyDown(KeyCode.A))
{
m_CharacterSelection_Player1.Left();
}
else if(m_Player1.Input.GetKeyDown(KeyCode.D)){
m_CharacterSelection_Player1.Right();
}
If (m_Player2.Input.GetKeyDown(KeyCode.LeftArrow))
{
m_CharacterSelection_Player2.Left();
}
else if(m_Player1.Input.GetKeyDown(KeyCode.RightArrow)){
m_CharacterSelection_Player2.Right();
}
Here is the visual representation about what I'm trying to tell you:

google forms multiple choice grid: validate

I am trying to put together a multiple choice grid in a google form, which should have some logic in it.
The idea is that people can use the form to predict a starting line up from a football team. I want to keep the form as easy and small as possible, thus going for a multiple choice grid.
The design I had in mind to use is pretty simple:
The logic I need is:
you can and must put only 1 player on goal
the total number of players selected should be 11
if you reach the 11 selection, you shouldn't be able to select any more players
if you have selected 1 player on goal, you shouldn't be able to select any more players on goal
Ideally: the check should be dynamic, while you are filling in the form. As soon as you reach the 11th name, you shouldn't be able to continue selecting options.
I have already tried tinkering with some add-ons for google forms, but they all struggle with the multiple choice grid.
Does any one have any advice how and if I can even achieve this with google forms or maybe it's wiser to move on to another solution?
In order to do what you want (a different number of selections for each column) you'd need to have them as separate questions. I haven't used a survey platform that would do what you want the way you've been thinking about it.
So, you'd have a question asking who they want the goalie to be. Then you'd have another question where you ask which 10 other players they'd select for the other positions. To get fancy, you'd make a separate question for each person that's selected for goalie, that would ask about the other positions, leaving out who the goalie.

How do I perform math using TinyDB? (App Inventor 2)

I am trying to use TinyDB in order to store a value on one screen and display it on another. On the second screen, I want to add 1 to the number stored with TinyDB on the first screen. However, when I try to do this, nothing happens. What am I doing wrong?
Here's my code for the two screens.
Screen1
Screen2
You already loaded the available computers in Screen2.Initialize into label computersAvail.Text. Therefore in the Button1.Click event first add 1 like this
set computersAvail.Text to get computersAvail.Text + 1
and to store the updated available computers in TinyDB then use the following block
TinyDB.StoreValue "Computers"
get computersAvail.Text
btw. it helps to first do the tutorials to learn the basics of App Inventor...
also see this link for "the lost souls"...

MATLAB: How to present multiple images/figures to user and wait for click on one of them?

all. I'm new to Matlab and I'm a bit stuck. The last piece of the puzzle to run my experiment is to get some human input (expert supervised system). As easy as this may sound, I just can't seem to figure this one out.
I need to display four images to the user, plus an additional fifth figure (button, or could even be another image, doesn't matter). The code should wait until the user clicks any one of those images/figures and should continue afterwards (closing the figures, too). Obviously, I'd need to know which figure was clicked.
GUI programming in Matlab doesn't seem to be documented clearly to me. Or perhaps it's just in a realm that I'm not talented with. It's definitely a lot more confusing than Visual Studio, that's for sure.
Thanks in advance for your time; I greatly appreciate it! :)
Could you make all five of the images into buttons? The 'CData' property of a button can be used to display an image on a MATLAB button. See the following links for an example and an explanation (that hopefully makes sense!).
http://www.mathworks.com/matlabcentral/fileexchange/2378-buttons/content/buttons.m
http://www.mathworks.com/support/solutions/en/data/1-16V03/
Use menu:
figure(1)
plot...
figure(2)
plot...
figure(3)
plot...
figure(4)
plot...
% this will create a menu of labeled buttons where the user can click
m = menu('Choose a figure','Figure 1','Figure 2','Figure 3','Figure 4','None');
% close all 4 figures
close(1:4) %will close figures 1 to 4
% --------- your program from here on ---------
if m == 5
display('You chose no Figure');
else
display(['You chose Figure:' num2str(m)]);
end
%---------
menu will return a number which corresponds to the option that the user clicked on.

How to remove splash screen?

Right, hi guys, I recently followed a tutorial http://xnadevelopment.com/tutorials/thestateofthings/thestateofthings.shtml where I wanted to create a sort of splash screen, and it worked I managed to get a two different screens interchanging between one another (so, if I press A, it goes to TitleScreen, and if I press B, it returns back to ControllerDetectScreen)
Here's the code http://paste.org/43859
Obviously there is no actual game, but if you could show me how to get rid of the TitleScreen and ControllerDetectScreen by adding a function to remove them both out of the way (preferably the spacebar, and to start my game (The background will be 'CornFlowerBlue after the function is added and pressed.)
Thank you!
Using the same code, you could add another bool for whether you're in the game or not, and another if statement wherever you need it to contain the code for the game (probably Update and Draw)

Resources