Quote from AegisRunestone:
I, personally, don't think the word "Holy" is going to get the map banned. Or" temple", or "clergy", etc. Those are general religion terms, and I doubt anyone would be offended by them. Just my 2 cents. :P
----
I've been in the heads of fundamentals. All it takes is one mom looking over the shoulder of her ten-year-old child and she'll write a complaint to blizzard. Whether she is right or wrong blizzard will not bother to investigate the matter and will ban the map.
I understand the irony in that situation. Why is a ten year old child playing a game with gore, then having his mother complain that the game contains the word "gore". And it's just a jersey thing. You wouldn't understand.
Those words are not vital to the gameplay, and put the author at risk. So it's better safe than sorry.
Quote from RodrigoAlves:
Quote from AegisRunestone: Go
Yeah, I'd hold off until you find all that junk and get rid of it. Good luck, man. I'm going to try playing your map ASAP.
I will hold a little, but only folder 0 and 1 will be published in the first week. I'm trying to clean both folders today to publish it at night.
----
Ahh, let me check folder 1 real quick first. I really like NWW and don't want you to get banned. I'll edit this post with what I find, should be done within an hour.
Okay here it is.
There are just a ton of duplicates. Is there any way you can sort all these by alphabetical order? That'd make it a lot easier to catch all these dupes.
EASY - 1
yoga
serf
haj (again, this was in folder 0 as well)
wimp
slob
gal
flay
cur
pray
acme (this was an actual company, not just a cartoon)
EASY - 2
punk
slob
hajj
mock
slit (lots of repeats here)
liar (lots of dupes, make sure you use F3 and search for multiples)
holy
slum
bunk
wee
EXTREME - 1 & 2
antisyphilitic
peacock-throne
hallucinogenic
praisworthiness
high-muck-a-muck (really I included this because it'd be really weird to see in game)
hallucinogenic (so many duplicates...)
holier-than-thou (twice, remember to always check "next" results when you search)
fundamentalism
cholecystectomy
jack-in-the-box
irreligiousness
gynandromorphic
environmentalist
HARD - 1
cervical
prostitute
nicotine
rubbish
titivation
wanderlust
deathtrap
cloistered
hellion
sabbatic
earth-god
fascist
annulus (I know what it means, but still)
HARD - 2
criminal
screwball
suicide
arrogance
euphemize
spectral
murderer
prophecy
immorally
exorcist
worship
eulogize
looting
lusciously
execute
tritheism
I've gone through all of folder 1. It's all I have patience for right now.
I used my "granny" sense to pick out bad words. I grew up in an environment that would have treated many of these words as devil-speak, so even though you guys may see no fault with them they could still get you banned.
If you're sad that you're going to lose these perfectly acceptable, quality words; don't be. You still have lots of good words that aren't offensive in any way. Just let go.
Only a few of these words would definitely get you banned and those are Smut, Sexy, Pope, Batman, Mosque and Minge. Minge is not a good thing to say.
I will continue looking through each folder throughout the week. I strongly recommend you hold off on posting your map until everything has been searched.
Some of these words occur more than once. I've sorted them by difficulty, just use F3 to find them:
EASY:
monk
pray
gore
sect
haj
slit
tzar
kill
duce
cuss
racy
suck
visa
nun
kink
smut
maim
sexy
darn
cult
serf
pope
holy
bunk
evil
flog
oath
hex
Reason I throw in the button change option when I see these types of questions is because I think it can give them a cleaner result. I think a lot of people use the default buttons because they try to use an image they like and then give up after it creates a result like dre_ stated.
And I think that a transparent button with an image underneath it reads better and takes away an unnecessary step: That is the additional overlay of a label for the numbers that dre_ requires on his buttons.
I don't know if everybody knows this, but it is very important and I think a lot of people are missing the point:
That image that any button uses by default... That's not just a square picture of a button. It's a combination of two images (can't use editor due to downtime, so this name is just a rough guess) ui_defaultbutton_normalpressed and ui_defaultbutton_overpressed.
Now if you manage to find either one of those files you'll notice something odd. They're both bizarre cut-ups of different parts of the button. You've probably noticed these types of images before while scrolling through the list of Default Blizzard Images. If you think about that for a minute you'll realize that when the game tries to render that button it is actually taking that fragmented image, cutting it apart piece by piece and throwing them together to make that *ass-ugly* default button we have all learned to loathe.
Therein lies the reason you cannot use that picture of a missile turret as a button. It's because the game is taking little pieces of that image and throwing it together to create something that resembles a foggy day in Toronto. But armed with your new knowledge of button-rendering you can search through the images until you find *similar* images to the crappy ui_defaultbutton_overpressed. I mean it'd be easy to find them, all you have to do is type "pressed" into the search field.
Then to create your not-ass-ugly button you simply use "set dialog item image" after making the button. And into that you put the normalpressed image. Then in the button's "hover image" property you add the overpressed equivalent. You can then slide the picture of the missile turret in behind or in front and the nasty default texture wont get in the way anymore.
Use this method for every button. Square, wide, list, transparent, opaque.
I never want to see the default buttons again. You hear me?
The reason why setting a buttons image/hover image has such bizarre results is actually for a good, practical reason.
If you've scrolled through the /images that blizz provides by default you will have noticed a number of images that are all little 'parts' of either buttons or borders or other crap like that. It looks messed up and you probably though "well those look like nice buttons but how could I arrange those parts into a real button?"
Well if you haven't figured it out by now, what the game does with your "set last created dialog item's image" and "hover Image" is take those messed up images and cut them into pieces, rearrange them and put them where they need to be. It does this so you can have buttons of any size without any stretching. This also works if you want to create a custom border. You may have noticed the "Image type" category under the properties of "Create Dialog Image". Well that corresponds to the way the image will be sliced, diced and put together. All those messed up images are usable, you just have to figure out which ones are buttons, which are borders, which are horizontalborders, which are end caps and so on. The main Dialog's frame can also be easily changed through "Set Dialog Background".
Obviously this means you cannot use a static image as a button. But what I just do is set the button to a simple, transparent, white button and throw the image in behind it.
If you want to find a specific type of image just remember this:
to search for buttons just enter "pressed"
to search for borders enter "frame"
Please people... stop using the defaults. They're fugly.
After looking into the lighting editor I don't think I've found specifically what I'm looking for.
Perhaps I don't know that editor well enough but it looks like it is altering the lighting of the entire map. So maybe I could make everything you see black and white but not just a specific texture file. Maybe you can alter the lighting of individual texture files? I don't see how that would work.
Specifically what I'm trying to do is create a dialogue with a background that is a textured white. I like the look and feel of one of blizzard's images but it is purple. I am trying to desaturate that image.
I know there are many images that are greyscale by default. But I think it'd be really cool if I could use one of the hundreds of colored images.
Is it possible to desaturate the existing blizz images/textures using only triggers? From what I've done so far it seems that 'set dialog item color' only adjusts the value of each RGB channel.
What I'd like is a way to force all the channels into the one color. Right now if I set the color to 'white' the editor just assumes I want all the channels to retain 100% of their existing information rather than force all of them to adopt a uniform value.
seeing as you've figured out the shuffle idea, you can shuffle then the "array indices" of an card array, so the card array itself is always in the same order, but in the deck array, they aren't sorted. like your shuffle shuffles the array.
You can now just create functions to remove a number from the array and shove the rest up, or let the array remain the same and remove the highest index card remaining. Just use an additional integer to keep track of the available cards. This integer you could also use in your random shuffle bit to prevent your deck from having holes in them. so instead of random 1 to 100 you'll get, random 1 to decksize.
you add the removed number above to a players hand, and retrieve the card information out of an array you have defined at the side. this way you'll just be using an integer to pass about. the card information will stay nice together, if you use a record (or struct for those who use galaxy code). in this record you can e.g. set the following data: Value (A,2,5,K,etc.), Type (Spades, Hearts,etc.) Display Text(Ace of Spades, Two of Hearts, etc.)
----
I like the sound of the first paragraph but am a tad confused. Do you mean rather than shuffling the contents of the array around I shuffle the containers?
*edit*
The plan right now is to have the backbone of the game operate purely on integers and math. So even though card 3 is the mace of unruliness it's just the number 3 as it's being drawn, discarded, played, cursed and such is just the displacement of a number.
Hopefully the cards and actions therein can be treated on a modular basis using if/then/ors and action definitions.
So:
event:
a card is played
condition:
a player is in combat
that card is the number 3
action:
the player in combat gets maced by the player who had that card
Next up, learning dialogues and the math behind combat.
Thanks Anthius. The second seemed to be the easiest to make a trigger for so I went ahead and did that one.
*note* while I was writing this Helral posted exactly this information. But alas.
I've also figured out how to remain aware of the top card and shuffle however many cards are in the discard back into the draw stack.
Using a few tools to move cards either to my hand or to the discards (the ones in my hand will not appear again in the draw stack.) I just had to make a reshuffle trigger which looked a lot like the original one but with more crap.
ShuffleDiscards
Events
UI - Player Any Player presses Num Pad 4 key Down with shift Allow, control Allow, alt Allow
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Abs(#DoorCardsInDeck)) == 0
Then
General - While (Conditions) are true, do (Actions)
Conditions
(Abs(#DoorCardsInDiscard)) > 0
Actions
Variable - Modify #DoorCardsInDeck: + 1
Variable - Set DoorCardDeck[#DoorCardsInDeck] = DoorDiscardDeck[#DoorCardsInDiscard]
Variable - Set DoorDiscardDeck[#DoorCardsInDiscard] = 0
Variable - Modify #DoorCardsInDiscard: - 1
General - Repeat (Actions) 10000 times
Actions
Variable - Set TempShuffleInt[1] = (Random integer between 1 and #DoorCardsInDeck)
Variable - Set TempShuffleInt[2] = (Random integer between 1 and #DoorCardsInDeck)
Variable - Set TempShuffleInt[3] = DoorCardDeck[TempShuffleInt[1]]
Variable - Set DoorCardDeck[TempShuffleInt[1]] = DoorCardDeck[TempShuffleInt[2]]
Variable - Set DoorCardDeck[TempShuffleInt[2]] = TempShuffleInt[3]
Else
Do nothing
The trick was to always keep track of how many cards are in each deck. The # of cards in each is always equal to the highest-level variable in the arrays that hasn't been taken already (set to zero). So the # of cards will always be the next one you want to take.
When I call the cue, if the draw stack is at zero the discards will get returned one at a time and then reshuffled. I just set the randomization parameters to 1 - #of cards in the draw stack.
I hope this helps anyone else who wants to do something like this :/
Thanks Helral. I'm having a bit of trouble reading your map file but I can see some of the triggers and will try to understand it.
I've just figured out how to shuffle an array of intergers within itself. Which could theoretically be used with other triggers to resemble various cards (i.e. 1 = ace of clubs, 2 = two of clubs, 3 = three of clubs, 14 = ace of diamonds etc.)
What I did was fill an array of 100 with numbers ranging from 1 - 100 so it is like such: CardDeck(1) = 1, CardDeck(2) = 2, CardDeck(41) = 41 etc.
-Then create a Array of 3 to fill temporary numbers.
-Then take two of random numbers from the array of 100 and swap them.
Since there is no real 'swap' integer action I used the first two variables in the secondary array to generate two random numbers between 1 and the number of cards in the deck.
Those two numbers are then picked out of the CardDeck(1-100) array and swapped with each other using the third extra variable to temporarily store the value of the first CardDeck variable before it is destroyed.
So it looks like so:
Shuffle
Events
UI - Player Any Player presses Up key Down with shift Allow, control Allow, alt Allow
Local Variables
Conditions
Actions
General - Repeat (Actions) 10000 times
Actions
Variable - Set TempShuffleInt[1] = (Random integer between 1 and 100)
Variable - Set TempShuffleInt[2] = (Random integer between 1 and 100)
Variable - Set TempShuffleInt[3] = DoorCardDeck[TempShuffleInt[1]]
Variable - Set DoorCardDeck[TempShuffleInt[1]] = DoorCardDeck[TempShuffleInt[2]]
Variable - Set DoorCardDeck[TempShuffleInt[2]] = TempShuffleInt[3]
My machine is pretty good but doing this 10000 times doesn't generate a pip of lag and yields indistinguishably random results.
I'm trying to create a game that shuffles and deals cards to each player, stores a deck to draw new cards from and stores a discard pile.
Think of it like a game of poker. Fifty two cards are randomly arranged in a draw pile, then the cards are distributed to the players.
My lack of coding knowledge leads me to ask the following:
- How do I create a system that knows each card (ace of spades, seven of diamonds, etc) and randomizes them into some variable or array in a way that does not duplicate or leave out cards? organized deck > shuffled deck
- How do I manipulate this variable/array/record/datatable to order the cards from top to bottom as they are drawn. So the game isn't just randomly drawing out of the (already randomized) stack but rather in a set order. top card = jack of hearts & second card = two of clubs > draw > top card = two of clubs.
- After these cards are used and all cards are either in the players hands or in the discard pile (which also must be organized) how do I then shuffle the cards from the discard pile (which will be less than 52) into a new draw pile. #cards in deck = 0, #cards in players hands = 15, #cards in discard = 37. > shuffle > #cards in deck = 37, #cards in players hands = 15, #cards in discard = 0.
I'd like to keep the data tidy. So a system containing a variable for your draw pile, one for your discards and one for each players hand is ideal. The system must also be flexible since more cards will be added to the game as I update it. The number of cards each player can carry will vary based on events within the game and all sorts of crap occurs as the cards are played. Sometimes the players will need to take stuff out of the discards, sometimes the game needs to search through the draw stack for a specific card.
0
Quote from AegisRunestone:
I, personally, don't think the word "Holy" is going to get the map banned. Or" temple", or "clergy", etc. Those are general religion terms, and I doubt anyone would be offended by them. Just my 2 cents. :P
----
I've been in the heads of fundamentals. All it takes is one mom looking over the shoulder of her ten-year-old child and she'll write a complaint to blizzard. Whether she is right or wrong blizzard will not bother to investigate the matter and will ban the map.
I understand the irony in that situation. Why is a ten year old child playing a game with gore, then having his mother complain that the game contains the word "gore". And it's just a jersey thing. You wouldn't understand.
Those words are not vital to the gameplay, and put the author at risk. So it's better safe than sorry.
0
Quote from RodrigoAlves:
Quote from AegisRunestone: Go
Yeah, I'd hold off until you find all that junk and get rid of it. Good luck, man. I'm going to try playing your map ASAP.
I will hold a little, but only folder 0 and 1 will be published in the first week. I'm trying to clean both folders today to publish it at night.
----
Ahh, let me check folder 1 real quick first. I really like NWW and don't want you to get banned. I'll edit this post with what I find, should be done within an hour.
Okay here it is.
There are just a ton of duplicates. Is there any way you can sort all these by alphabetical order? That'd make it a lot easier to catch all these dupes.
EASY - 1
yoga
serf
haj (again, this was in folder 0 as well)
wimp
slob
gal
flay
cur
pray
acme (this was an actual company, not just a cartoon)
EASY - 2
punk
slob
hajj
mock
slit (lots of repeats here)
liar (lots of dupes, make sure you use F3 and search for multiples)
holy
slum
bunk
wee
EXTREME - 1 & 2
antisyphilitic
peacock-throne
hallucinogenic
praisworthiness
high-muck-a-muck (really I included this because it'd be really weird to see in game)
hallucinogenic (so many duplicates...)
holier-than-thou (twice, remember to always check "next" results when you search)
fundamentalism
cholecystectomy
jack-in-the-box
irreligiousness
gynandromorphic
environmentalist
HARD - 1
cervical
prostitute
nicotine
rubbish
titivation
wanderlust
deathtrap
cloistered
hellion
sabbatic
earth-god
fascist
annulus (I know what it means, but still)
HARD - 2
criminal
screwball
suicide
arrogance
euphemize
spectral
murderer
prophecy
immorally
exorcist
worship
eulogize
looting
lusciously
execute
tritheism
NORMAL - 1
temple
deific
sacral
cancer
hacker
coven
gamble
bullet
whore
shame
caliph
sexton
punky
zodiac
hippie
spirit
mason
craps
hookup
hoodoo
sutra
NORMAL - 2
clergy
adobe
stool
affair
bimbo
spirit
shrine
mauler
screwy
yakuza
piracy
wrath
sheik
papacy
savior
Again, many ban-worthy words. Many of which even regular English-speakers wouldn't catch.
0
Quote from RodrigoAlves:
Some offensive words I found myself: Folder 0
gv_word[0][ 32] = "monk";
gv_word[0][ 35] = "pray";
gv_word[0][ 300] = "suck";
gv_word[0][ 417] = "sexy";
gv_word[0][ 620] = "holy";
gv_word[3][ 90] = "progestational";
gv_word[3][ 710] = "hallucinogenic";
gv_word[2][ 775] = "excretory";
gv_word[1][ 12] = "dogma";
gv_word[1][ 167] = "judas";
gv_word[1][ 263] = "drunk";
gv_word[1][ 328] = "macho";
gv_word[1][ 431] = "prayer";
gv_word[1][ 531] = "faecal"; Folder 8
gv_word[3][ 438] = "drunk-and-disorderly";
----
Wow, I can't believe I missed some of those. This is going to take a lot of collective effort :/
0
I've gone through all of folder 1. It's all I have patience for right now.
I used my "granny" sense to pick out bad words. I grew up in an environment that would have treated many of these words as devil-speak, so even though you guys may see no fault with them they could still get you banned.
If you're sad that you're going to lose these perfectly acceptable, quality words; don't be. You still have lots of good words that aren't offensive in any way. Just let go.
Only a few of these words would definitely get you banned and those are Smut, Sexy, Pope, Batman, Mosque and Minge. Minge is not a good thing to say.
I will continue looking through each folder throughout the week. I strongly recommend you hold off on posting your map until everything has been searched.
Some of these words occur more than once. I've sorted them by difficulty, just use F3 to find them:
EASY:
monk
pray
gore
sect
haj
slit
tzar
kill
duce
cuss
racy
suck
visa
nun
kink
smut
maim
sexy
darn
cult
serf
pope
holy
bunk
evil
flog
oath
hex
EXTREME:
pork-barreling
masculinization
preachification
microevolution
supernaturalist
macroevolution
double-breasted
HARD:
pinhead
preteen
godless
adulatory
salvation
ritualism
idolizer
seductress
sextuple
unpurified
NORMAL:
dogma
judas
batman
piracy
prayer
rajah
halal
cockle
virtue
preach
faecal
hoodoo
dunce
minge
slain
mosque
divine
septic
0
I'll help
0
@Yaos01:
Reason I throw in the button change option when I see these types of questions is because I think it can give them a cleaner result. I think a lot of people use the default buttons because they try to use an image they like and then give up after it creates a result like dre_ stated.
And I think that a transparent button with an image underneath it reads better and takes away an unnecessary step: That is the additional overlay of a label for the numbers that dre_ requires on his buttons.
0
It is likely a fault on his end. Not something you did wrong in the editor.
Bank files are stored on any individual's computer under:
TheirDocumentFolder > Starcraft 2 > Acounts > ####### > #-#-###### > Banks > #-#-######
On his end he may have messed this hierarchy up in any number of ways.
Deleting a folder
Moving a directory around
Being on the wrong Log-In ID
Owning a Mac
You don't have a choice but to ignore the problem.
0
I don't know if everybody knows this, but it is very important and I think a lot of people are missing the point:
That image that any button uses by default... That's not just a square picture of a button. It's a combination of two images (can't use editor due to downtime, so this name is just a rough guess) ui_defaultbutton_normalpressed and ui_defaultbutton_overpressed.
Now if you manage to find either one of those files you'll notice something odd. They're both bizarre cut-ups of different parts of the button. You've probably noticed these types of images before while scrolling through the list of Default Blizzard Images. If you think about that for a minute you'll realize that when the game tries to render that button it is actually taking that fragmented image, cutting it apart piece by piece and throwing them together to make that *ass-ugly* default button we have all learned to loathe.
Therein lies the reason you cannot use that picture of a missile turret as a button. It's because the game is taking little pieces of that image and throwing it together to create something that resembles a foggy day in Toronto. But armed with your new knowledge of button-rendering you can search through the images until you find *similar* images to the crappy ui_defaultbutton_overpressed. I mean it'd be easy to find them, all you have to do is type "pressed" into the search field.
Then to create your not-ass-ugly button you simply use "set dialog item image" after making the button. And into that you put the normalpressed image. Then in the button's "hover image" property you add the overpressed equivalent. You can then slide the picture of the missile turret in behind or in front and the nasty default texture wont get in the way anymore.
Use this method for every button. Square, wide, list, transparent, opaque.
I never want to see the default buttons again. You hear me?
0
The reason why setting a buttons image/hover image has such bizarre results is actually for a good, practical reason.
If you've scrolled through the /images that blizz provides by default you will have noticed a number of images that are all little 'parts' of either buttons or borders or other crap like that. It looks messed up and you probably though "well those look like nice buttons but how could I arrange those parts into a real button?"
Well if you haven't figured it out by now, what the game does with your "set last created dialog item's image" and "hover Image" is take those messed up images and cut them into pieces, rearrange them and put them where they need to be. It does this so you can have buttons of any size without any stretching. This also works if you want to create a custom border. You may have noticed the "Image type" category under the properties of "Create Dialog Image". Well that corresponds to the way the image will be sliced, diced and put together. All those messed up images are usable, you just have to figure out which ones are buttons, which are borders, which are horizontalborders, which are end caps and so on. The main Dialog's frame can also be easily changed through "Set Dialog Background".
Obviously this means you cannot use a static image as a button. But what I just do is set the button to a simple, transparent, white button and throw the image in behind it.
If you want to find a specific type of image just remember this:
to search for buttons just enter "pressed"
to search for borders enter "frame"
Please people... stop using the defaults. They're fugly.
0
After looking into the lighting editor I don't think I've found specifically what I'm looking for.
Perhaps I don't know that editor well enough but it looks like it is altering the lighting of the entire map. So maybe I could make everything you see black and white but not just a specific texture file. Maybe you can alter the lighting of individual texture files? I don't see how that would work.
Specifically what I'm trying to do is create a dialogue with a background that is a textured white. I like the look and feel of one of blizzard's images but it is purple. I am trying to desaturate that image.
I know there are many images that are greyscale by default. But I think it'd be really cool if I could use one of the hundreds of colored images.
0
Apologies if this has already been answered.
Is it possible to desaturate the existing blizz images/textures using only triggers? From what I've done so far it seems that 'set dialog item color' only adjusts the value of each RGB channel.
What I'd like is a way to force all the channels into the one color. Right now if I set the color to 'white' the editor just assumes I want all the channels to retain 100% of their existing information rather than force all of them to adopt a uniform value.
0
Quote from Helral:
@Hikury: Go
seeing as you've figured out the shuffle idea, you can shuffle then the "array indices" of an card array, so the card array itself is always in the same order, but in the deck array, they aren't sorted. like your shuffle shuffles the array.
You can now just create functions to remove a number from the array and shove the rest up, or let the array remain the same and remove the highest index card remaining. Just use an additional integer to keep track of the available cards. This integer you could also use in your random shuffle bit to prevent your deck from having holes in them. so instead of random 1 to 100 you'll get, random 1 to decksize.
you add the removed number above to a players hand, and retrieve the card information out of an array you have defined at the side. this way you'll just be using an integer to pass about. the card information will stay nice together, if you use a record (or struct for those who use galaxy code). in this record you can e.g. set the following data: Value (A,2,5,K,etc.), Type (Spades, Hearts,etc.) Display Text(Ace of Spades, Two of Hearts, etc.)
----
I like the sound of the first paragraph but am a tad confused. Do you mean rather than shuffling the contents of the array around I shuffle the containers?
*edit*
The plan right now is to have the backbone of the game operate purely on integers and math. So even though card 3 is the mace of unruliness it's just the number 3 as it's being drawn, discarded, played, cursed and such is just the displacement of a number.
Hopefully the cards and actions therein can be treated on a modular basis using if/then/ors and action definitions.
So:
event:
a card is played
condition:
a player is in combat
that card is the number 3
action:
the player in combat gets maced by the player who had that card
Next up, learning dialogues and the math behind combat.
0
Thanks Anthius. The second seemed to be the easiest to make a trigger for so I went ahead and did that one.
*note* while I was writing this Helral posted exactly this information. But alas.
I've also figured out how to remain aware of the top card and shuffle however many cards are in the discard back into the draw stack.
Using a few tools to move cards either to my hand or to the discards (the ones in my hand will not appear again in the draw stack.) I just had to make a reshuffle trigger which looked a lot like the original one but with more crap.
ShuffleDiscards
Events
UI - Player Any Player presses Num Pad 4 key Down with shift Allow, control Allow, alt Allow
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Abs(#DoorCardsInDeck)) == 0
Then
General - While (Conditions) are true, do (Actions)
Conditions
(Abs(#DoorCardsInDiscard)) > 0
Actions
Variable - Modify #DoorCardsInDeck: + 1
Variable - Set DoorCardDeck[#DoorCardsInDeck] = DoorDiscardDeck[#DoorCardsInDiscard]
Variable - Set DoorDiscardDeck[#DoorCardsInDiscard] = 0
Variable - Modify #DoorCardsInDiscard: - 1
General - Repeat (Actions) 10000 times
Actions
Variable - Set TempShuffleInt[1] = (Random integer between 1 and #DoorCardsInDeck)
Variable - Set TempShuffleInt[2] = (Random integer between 1 and #DoorCardsInDeck)
Variable - Set TempShuffleInt[3] = DoorCardDeck[TempShuffleInt[1]]
Variable - Set DoorCardDeck[TempShuffleInt[1]] = DoorCardDeck[TempShuffleInt[2]]
Variable - Set DoorCardDeck[TempShuffleInt[2]] = TempShuffleInt[3]
Else
Do nothing
The trick was to always keep track of how many cards are in each deck. The # of cards in each is always equal to the highest-level variable in the arrays that hasn't been taken already (set to zero). So the # of cards will always be the next one you want to take.
When I call the cue, if the draw stack is at zero the discards will get returned one at a time and then reshuffled. I just set the randomization parameters to 1 - #of cards in the draw stack.
I hope this helps anyone else who wants to do something like this :/
0
Thanks Helral. I'm having a bit of trouble reading your map file but I can see some of the triggers and will try to understand it.
I've just figured out how to shuffle an array of intergers within itself. Which could theoretically be used with other triggers to resemble various cards (i.e. 1 = ace of clubs, 2 = two of clubs, 3 = three of clubs, 14 = ace of diamonds etc.)
What I did was fill an array of 100 with numbers ranging from 1 - 100 so it is like such: CardDeck(1) = 1, CardDeck(2) = 2, CardDeck(41) = 41 etc.
-Then create a Array of 3 to fill temporary numbers.
-Then take two of random numbers from the array of 100 and swap them.
Since there is no real 'swap' integer action I used the first two variables in the secondary array to generate two random numbers between 1 and the number of cards in the deck.
Those two numbers are then picked out of the CardDeck(1-100) array and swapped with each other using the third extra variable to temporarily store the value of the first CardDeck variable before it is destroyed.
So it looks like so:
Shuffle
Events
UI - Player Any Player presses Up key Down with shift Allow, control Allow, alt Allow
Local Variables
Conditions
Actions
General - Repeat (Actions) 10000 times
Actions
Variable - Set TempShuffleInt[1] = (Random integer between 1 and 100)
Variable - Set TempShuffleInt[2] = (Random integer between 1 and 100)
Variable - Set TempShuffleInt[3] = DoorCardDeck[TempShuffleInt[1]]
Variable - Set DoorCardDeck[TempShuffleInt[1]] = DoorCardDeck[TempShuffleInt[2]]
Variable - Set DoorCardDeck[TempShuffleInt[2]] = TempShuffleInt[3]
My machine is pretty good but doing this 10000 times doesn't generate a pip of lag and yields indistinguishably random results.
0
Hey guys.
I'm trying to create a game that shuffles and deals cards to each player, stores a deck to draw new cards from and stores a discard pile.
Think of it like a game of poker. Fifty two cards are randomly arranged in a draw pile, then the cards are distributed to the players.
My lack of coding knowledge leads me to ask the following:
- How do I create a system that knows each card (ace of spades, seven of diamonds, etc) and randomizes them into some variable or array in a way that does not duplicate or leave out cards? organized deck > shuffled deck
- How do I manipulate this variable/array/record/datatable to order the cards from top to bottom as they are drawn. So the game isn't just randomly drawing out of the (already randomized) stack but rather in a set order. top card = jack of hearts & second card = two of clubs > draw > top card = two of clubs.
- After these cards are used and all cards are either in the players hands or in the discard pile (which also must be organized) how do I then shuffle the cards from the discard pile (which will be less than 52) into a new draw pile. #cards in deck = 0, #cards in players hands = 15, #cards in discard = 37. > shuffle > #cards in deck = 37, #cards in players hands = 15, #cards in discard = 0.
I'd like to keep the data tidy. So a system containing a variable for your draw pile, one for your discards and one for each players hand is ideal. The system must also be flexible since more cards will be added to the game as I update it. The number of cards each player can carry will vary based on events within the game and all sorts of crap occurs as the cards are played. Sometimes the players will need to take stuff out of the discards, sometimes the game needs to search through the draw stack for a specific card.
Thanks to whoever can figure this out.