• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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