The question is answered, right answer was accepted
Need help with card game logic of the cards effects.
Hi,
So... i already have my cards... i've chosen the long way, of creating a script for every card. And theres a base class they inherit everything from. I just overriden it's methods.... So its done...
The problem is that now... i run into a problem of getting the target coordinates of the effect from the user. the method call comes from the card and ends at the map who have a map with field gameobjects. If i try to make it wait, then of course i run into and infinite loop.
How others solve it? Every single thought is a help.
thank in advance.
Answer by pcdrive · May 08, 2018 at 12:41 PM
Answer found:
(answered by DeathDelegateMethodIsOP on an other forum)
"If you make a queue of the cards, or card effects you want to activate, then you can make a statemachine out of the whole thing. This way you dont have to wait, since you are in a specific state, and the queue reserves the activation order.
For example: current state: beginround queue cards = (activated card1, activated card 2 ...)
hope this helped!"
Answer by tormentoarmagedoom · May 06, 2018 at 09:28 PM
Good day.
i dont understand exactly what you need.
You need to know a Vector3 position relative to other object?
Then just need this:
Vector3 RelativePosition= (Object.transform.position - Me.transform.position);
the RelativePosition is a vector from me to the object.
Bye!
Thanks, but my problem is not that i cant get the coordinates. $$anonymous$$y problem is that i dont know how to wait for the input from the user without freezing up my game.
Give us more information, we dont know how your game is, how you detect inputs, what you want to happen when this misterious input is done!
What input? a mouse click from the player? Like Input methods like Input.Get$$anonymous$$eyDown?
Or you are just asking for a delay method? like Invoke ?
If you explain exatcly what you want, i will try to give you exactly what you need :D
Bye!