HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

(Spell 3) - Buff - Charm (Seems to crash the game)

06-12-2006, 12:39 AM#1
Fulla
I've been trying to make a buff - charm spell.

You cast a buff on a unit, to gain control of that unit.
When buff expires, control reverts back to default.

Currently it is not required to be multi instanceable.
Only 1 hero/player will exist in the game.

I know this will be "frowned upon" but with cooldowns the hero will never control more than 10 units.

Trigger:
Buff Persuasion
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Persuasion [Seer]
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Ability_A_Seer_Mind_T Not equal to 10
Collapse Then - Actions
Set Ability_A_Seer_Mind_U[Ability_A_Seer_Mind_T] = (Target unit of ability being cast)
Set Ability_A_Seer_Mind_I[Ability_A_Seer_Mind_T] = (Player number of (Owner of (Target unit of ability being cast)))
Set Ability_A_Seer_Mind_T = (Ability_A_Seer_Mind_T + 1)
Collapse Else - Actions
Set Ability_A_Seer_Mind_U[Ability_A_Seer_Mind_T] = (Target unit of ability being cast)
Set Ability_A_Seer_Mind_I[Ability_A_Seer_Mind_T] = (Player number of (Owner of (Target unit of ability being cast)))
Set Ability_A_Seer_Mind_T = 0
Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Casting unit)) and Change color


Trigger:
Persuasion2
Collapse Events
Time - Every 1.00 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer B) from 1 to 10, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Ability_A_Seer_Mind_U[(Integer B)] has buff Persuasion ) Not equal to True
Collapse Then - Actions
Unit - Change ownership of Ability_A_Seer_Mind_U[(Integer B)] to (Player(Ability_A_Seer_Mind_I[(Integer B)])) and Change color
Else - Actions

The 2nd trigger crashes the game????

Does anyone know why and/or how to fix it?
Annoying thing is I dont even know if the 2nd trigger would work.

thank you
06-12-2006, 12:58 AM#2
TaintedReality
What kind of variable is Ability_A_Seer_Mind_U? It's because of the line (Player(Ability_A_Seer_Mind_I[(Integer B)])) in your second trigger, but I can't tell you how to fix it until I know what kind of variable it is.
06-12-2006, 01:02 AM#3
Fulla
U = Unit (array)
T = integer
I = Integer (array)
06-12-2006, 01:23 AM#4
PipeDream
Probably Ability_A_Seer_Mind_I has a value of zero somewhere, perhaps because it's uninitialized. ConvertedPlayer subtracts one from this before passing it on to Player. Player(-1) then crashes the game.
06-13-2006, 12:22 AM#5
Fulla
Ok I set I/T - default value = 1.
It works fine now.