• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Card Shuffle Theme: Card Draw and limitation problems

Status
Not open for further replies.
Level 11
Joined
Jul 28, 2007
Messages
920
You have deck with 60 cards
Max number of one type of card is 6
So each time when u draw card, number drops by one

Probem is, that i need system, coz seems like mine isnt working.
Its based on random number
from 1 to 60
if its 1 it draws card that is bind for that number, so 6 times 1 means 6 cards of same type

I need help there now...
When get 6 times number one, means that u got 6 same cards, and if u get number 1 again i dont know what should i do, i created, if number one is randomed 6 times, that system runs trigger again, but this crashes the map.

So how can i make system that detects that u have draw 6 times same card, and then removes that opinion.

Any idea ?


Here is m system, but it crashes when u get same number 7 times.

Card Draw System
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to |cffffcc00D|rraw Card
Actions
Set Draw_Random_Card[(Player number of (Owner of (Casting unit)))] = (Random integer number between 1 and 2)
Game - Display to (All players) the text: (String(Draw_Random_Card[(Player number of (Owner of (Casting unit)))]))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Casting unit)) Equal to Player 1 (Red)
(Name of Player 1 (Red)) Equal to tiger_cro
Then - Actions
-------- 1 - Ignacio Spider --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
"This is how same cards u may have in deck(its 6)=>"C_IS[(Player number of (Owner of (Casting unit)))] Greater than 0
Draw_Random_Card[(Player number of (Owner of (Casting unit)))] Equal to 1
Then - Actions
Hero - Create |CFF00FF00Ignacio Spider|r ;Forest and give it to tiger_cro
Set C_IS[(Player number of (Owner of (Casting unit)))] = (C_IS[(Player number of (Owner of (Casting unit)))] - 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
C_IS[(Player number of (Owner of (Casting unit)))] Less than 1
Then - Actions
Trigger - Run (This trigger) (checking conditions)
Else - Actions
-------- 2 - Forest --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Draw_Random_Card[(Player number of (Owner of (Casting unit)))] Equal to 2
C_F[(Player number of (Owner of (Casting unit)))] Greater than 0
Then - Actions
Hero - Create Forest and give it to tiger_cro
Set C_F[(Player number of (Owner of (Casting unit)))] = (C_F[(Player number of (Owner of (Casting unit)))] - 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
C_F[(Player number of (Owner of (Casting unit)))] Less than 1
Then - Actions
Trigger - Run (This trigger) (ignoring conditions)
Else - Actions
-------- 3 - Satyr --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
C_SA[(Player number of (Owner of (Casting unit)))] Greater than 0
Draw_Random_Card[(Player number of (Owner of (Casting unit)))] Equal to 3
Then - Actions
Hero - Create |CFF00FF00Satyr|r ;Forest and give it to tiger_cro
Set C_SA[(Player number of (Owner of (Casting unit)))] = (C_SA[(Player number of (Owner of (Casting unit)))] - 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Draw_Random_Card[(Player number of (Owner of (Casting unit)))] Equal to 3
C_SA[(Player number of (Owner of (Casting unit)))] Less than 1
Then - Actions
Trigger - Run (This trigger) (checking conditions)
Else - Actions
Else - Actions
 
Level 3
Joined
Mar 2, 2008
Messages
62
instead of creating an item for the hero every time, add charges to the item? that way before randoming you can check if the hero has 6 charges of that item?

there are other ways, most i can think of involve very big arrays of integers, and re-sorting the integers as the numbers disappear.
 
Level 11
Joined
Jul 28, 2007
Messages
920
I think that it wont work properly... with charges.. ccc
I need some idea of system that will enable me to have 60 cards in deck, and when i draw 6 same cards, than i cant draw 7th card of that type, i will get another card... ?_?

Edit: I mean i maked that game knows when u are out ot one type of card, but i dont know how to make game draws diffrent card when u get number for that card that you dont have anymore

random number between 1-2
1-dragon
2-spider

1,1,1,1,1,1 = 6 times so no more dragons in my deck

And now i get number 1 again, there are no more dragons, so waht now ? :D

Edit2: I fixed problem, if anyone will need this kind of system, let me know, i'll post trigger
 
Last edited:
Status
Not open for further replies.
Top