HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spell Bug in Worldedit?

04-27-2006, 09:17 PM#1
Imbrifer
Hey gang,

It's been a while since I've mapped, but I've returned to work on my epic map.. anyhow, it has custom spells (no JASS or anything) and I've run into a big problem.

I have a 'recruit' ability which turns a villager of another player into a villager for the owner of the casting unit. Simple. Well, apparently not. I've tried a dozen base spells for this custom spells, and what it has come down to is that the value 'Target unit of ability being cast' doesn't work. I can't even get a variable to have that value.

Any help would be MONSTEROUSLY appreciated, as this is one of the fundamentals of my map. Here's what I'm trying to make fly:

Quote:
Recruit
Events
Unit - A unit Finishes casting an ability

Conditions
(Ability being cast) Equal to Recruit Villager

Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
IntGreatness[(Player number of (Owner of (Casting unit)))] Greater than ((Number of units in (Units owned by (Owner of (Casting unit)) matching (((Matching unit) is A structure) Equal to False))) - 1)
((Unit-type of (Target unit of ability being cast)) Equal to Villager (Female)) or ((Unit-type of (Target unit of ability being cast)) Equal to Villager (Male 2))

Then - Actions
Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Casting unit)) and Change color

Else - Actions
Game - Display to (Player group((Owner of (Casting unit)))) the text: You can only cast t...
04-27-2006, 09:19 PM#2
vile
Huh, a unit FINISHES casting an ablity?
Why not starts the effect of an ability?

Finishes only applies to channeling abilities. Is that what your spell does? channeling?
Because of it's not, than the trigger won't even fire.

Btw another thing: why are you putting -1 on the player number?
the gui functions already set it to -1 by default, so basically you are not setting the integer variable of the casting unit, but rather a unit before that, -1...
04-27-2006, 09:36 PM#3
Imbrifer
Ah! Thank you, I changed it to 'starts the effects of an ability' and now the trigger works. I didn't know that 'finishes casting an ability' applied only to channeling.

The jist of the map is that you have to produce food every day for your army, but your hero does not eat up food (hence the -1).
04-27-2006, 10:42 PM#4
Vexorian
finishes works for every ability, but it only triggers if the unit has succesfully finished casting it, it also does not have any Event response besides triggering unit and GetSpellAbilityId()