HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Where's the fault

07-15-2006, 12:39 PM#1
Fireeye
I'm working on a card game (custom decks), and of course i want to trigger a random start hand.
All variables are set in the Map Initialization and they are correct.
I've a Problem with following Trigger, whenever it is runned WC3 crashs
Trigger:
Events
Collapse Conditions
AnzahlKartenZiehen[1] > 0
Collapse Actions
set KarteZiehen01 = GetRandomInt(1, 9)
Collapse if - Conditions
KarteSchonGewaehlt01[KarteZiehen01] Equal to true
Collapse Then - Actions
Collapse If - Conditions
Collapse And
KarteSchonAufDerHand01[KarteZiehen01] = true
KartenZiehenTyp01[KarteZiehen01] less than LibaryKartenAnzahlTyp0[[KarteZiehen01]
Collapse Then - Actions
set KartenZiehenTyp01[KarteZiehen01] = ( KartenZiehenTyp01[KarteZiehen01] + 1 )
set AnzahlKartenZiehen[1] = ( AnzahlKartenZiehen[1] - 1 )
set AnzahlKarteAufDerHand01[KarteZiehen01] = ( AnzahlKarteAufDerHand01[KarteZiehen01] + 1 )
Trigger - Run (This Trigger) (checking conditions)
Collapse Else - Actions
Collapse if - Conditions
KartenZiehenTyp01[KarteZiehen01] less than LibaryKartenAnzahlTyp01[KarteZiehen01]
Collapse Then - Actions
Collapse For each Integer A from 1 to 14
Collapse If - Conditions
Collapse And
HandPunkt01Boolean[(Integer A)] Equal to false
KarteSchonAufDerHand01[KarteZiehen01] Equal to false
Collapse Then - Actions
Unit - Create 1 Karte[KarteZiehen01] for Player 1 (Red) at Handpunkt01[(Integer A)] facing Default Building Facing (270.0) degrees
set KartenZiehenTyp01[KarteZiehen01] = ( KartenZiehenTyp01[KarteZiehen01] + 1 )
set AnzahlKarteAufDerHand01[KarteZiehen01] = ( AnzahlKarteAufDerHand01[KarteZiehen01] + 1 )
set AnzahlKartenZiehen[1] = ( AnzahlKartenZiehen[1] - 1 )
set KarteSchonAufDerHand01[KarteZiehen01] = true
set GespieltPunkt01Boolean[GetForLoopIndexA()] = true
Trigger - Run (This Trigger) (checking conditions)
Collapse Else - Actions
Do nothing
Collapse Else - Actions
Trigger - Run (This Trigger) (checking Conditions)
Collapse Else - Actions
Trigger - Run (This Trigger) (checking Conditions)
i'm sorry about the bad format, it's the first post, when there are 2 if commands together it counts as "and" and sorry for my bad english

-Edit 1-
lol, i've debugged the trigger without knowing it, there was 1 if command to much, and that caused a non-stop loop.
-Edit 2-
Changed the code it's readable now (i think so)
07-15-2006, 02:49 PM#2
Alevice
Welcome to the forums.

Use Jass tags, not trigger tags. Unless that's not jasss code -.-

If jass, unless i am missing a feature, your loop statement is wrong.

Proper loop format

Collapse JASS:
loop
    exitwhen (your condition) //eg iterator <5
    iterator = iterator +1 //in case it is a basic sequential loop
endloop

Also, I don't see any endifs, whom, when missing, crash the editor.
07-15-2006, 03:41 PM#3
Rising_Dusk
That is kind of sketch code really.
It appears to be a mixture of jass and gui.

It's kind of interesting -- But yeah anyways Alev is correct.
I don't know what you were aiming to achieve with it, since it's well.. Scrambled. If there are other errors, we probably would catch them were it in the proper format.
07-15-2006, 03:45 PM#4
Fireeye
I already found the Problem, yes i often mix Jass and Gui and now i can keep working on my magic - the gathering map.