• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

This Trigger is Tough Help!!

Status
Not open for further replies.
Level 2
Joined
Sep 10, 2008
Messages
8
I'll explain it the best I can, and please don't post in jass language I don't know jass! Basically im trying to make a card game.

So far in my trigger i have

Events:
Unit - A unit owned by player 1 begins casting an ability (ability being card)
Conditions:
(Ability being cast) Equal to (draw a card)
Actions:
Unit - Create 1 -card draw variable- (Random integer number between 1 and 10) for (Triggering player) at (Region)

on the second trigger i set card draw to variable1 = card1 , variable2= card2 ect.
Now i want to know how do I randomize the card draw from 1-10 and remove the picked card that was randomized. Meaning I want to randomize a second time and not have the same card number as the first randomize. So I don't get a one of a kind card twice. help please!
 
Level 15
Joined
Dec 18, 2007
Messages
1,098
You have to use a integer variable to store te random number, then you refer to the integer variable in the index of the array. After that, you use an integer a loop.

For every integer a from the random number variable to the cards available to draw (integer variable, set it to the maximum number of cards that you have at the starting of the game), set -card draw varible- (integer a)= -card draw variable- (integer a+1)
Finally, set the cards available to draw variable= the cards available to draw-1.
Done.
 
Status
Not open for further replies.
Top