HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger Problem

10-16-2003, 08:16 AM#1
Balthamos
Ok, can anyone tell me why this trigger doesn't work?
Variables:
Chance is a value for a chance out of one hundred of successfully learning the spell.
Done is meant to allow me to search for the unit through the monster array and upon finding it stop the search until after the forloop has finished.
Monsters is an array of monsters which are linked to Souls which is an array of spells representing the spells you can learn from each monster and Probability is the chance that you successfully learn the spell after killing the monster.
Integerfound is supposed to keep track of the number in the three previous arrays that the monster you have killed belongs to.
BooleanGotten is a boolean array for checking whether or not you've already learnt the spell you could be gaining.
P1AbilitiesGotten is an array of the abilities the player has so far.
StackAbilitiesGotten is an array of integers keeping track of the next spot in the P1AbilitiesGotten array for where the next spell should be placed.

Enemy Death
Events
Unit - A unit owned by Player 12 (Brown) Dies
Conditions
Actions
Set Chance = (Random integer number between 1 and 100)
For each (Integer A) from 1 to 100, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Dying unit)) Equal to Monsters[(Integer A)]
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Done Equal to False
Then - Actions
Set UnitFound = Monsters[(Integer A)]
Set IntegerFound = (Integer A)
Else - Actions
Set Done = True
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
BooleanGotten[IntegerFound] Equal to False
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Chance Less than or equal to Probability[IntegerFound]
Then - Actions
Game - Display to (Owner of (Killing unit)), at offset (0.00, 0.00) for 5.00 seconds the text: |cffffcc00You have ...
Set P1AbilitiesGotten[StackAbilitiesGotten[(Player number of (Owner of (Killing unit)))]] = Souls[IntegerFound]
Set StackAbilitiesGotten[(Player number of (Owner of (Killing unit)))] = (StackAbilitiesGotten[(Player number of (Owner of (Killing unit)))] + 1)
Set BooleanGotten[IntegerFound] = True
Else - Actions
Else - Actions
Set Done = False

Basically my map works on the concept from Castlevania Aria of Sorrows, in which the player had a chance to steal an enemy's soul every time they killed the enemy. Each soul was then equipable for use as a spell. I know how to do all this I just don't know why this trigger isn't working...I only have two monsters in the array at the moment and both monster's souls can be stolen, however not both in the same test. You can steal the ghoul's but then not the warlock's, or go straight for warlock's but not ghoul's...I don't understand why it's happening :( I hope someone can see where I've slipped up. Thankyou in advance.

Cheers.
10-16-2003, 08:42 AM#2
megaerathia
...................................
10-16-2003, 11:03 AM#3
BlackSlash
Post a jpg plz...
without spaces, this trigger it's hard to reademote_confused
10-16-2003, 11:27 AM#4
Balthamos
Ok, I hope this works...
Image
10-17-2003, 02:52 AM#5
Balthamos
I'm at school, but I just realised something, note to self. Edit the Soul Loader Trigger when I get home...I need to edit the variable "special" and set it for the appropriate amount.