| 08-15-2008, 10:58 PM | #1 |
Okay, Cloud of Fog basic ability is a channeling one; I made a dummy ability based on channel to make Cloud of Fog a non-channeling ability. When the channel based ability is cast, a dummy caster is created and given the right cloud ability (because of the bug between teams), set to the right level, and ordered to "cloudoffog" on a location. It worked fine but recently, after many changes in the map, it is not working. What is good to know : After 1 week testing it: 1. The dummy unit is created (so its not a problem with a non-existant unit) 2. The rightability is given, set to the right level (so not a problem with the spell) 3. On a test map with those 2 functions above, (and nothing else), + the same dummy caster, the spells works fine. 4. On my map, when the dummy caster is ordered "cloudoffog" or even the Id that I tried (852473 I think), it is not casting it. (Not stop, no cast at all) 5. The function IssuePointOrderByIdLoc returns false for all the clouds based ability, returns true for everything else. 6. Looked in the constants or everything based on the map setting if something had changed there; only the Idle Worker icon has been changed -_-. 7. If I manually cast the Cloud based ability from the dummy caster, it works and still tell me the order is "cloudoffog" and (852473 has Id)... Strange eh? 8. It's not a problem with the dummy caster itself; I tried with a human sorceress, an hero; still does not cast it. 9. Not a problem related to the team; on both team all clouds based abilities does not work. 10. Both functions above has not been changed from the time it worked and now. 11. Using IssuePointOrderById instead of IssuePointOrderByIdLoc does not solve the problem. 12. Other spells that uses the same functions/dummy caster (like Death and Decay) works has before; no problems. 13. I have more than one Cloud based ability; all of them aren't working... Wth... I've been gathered help from Hive Works Shop but seems they can't find what's wrong with it. It's been a week now and looking/testing deep. If you could help me find it I would be so happy. Thanks anyway. JASS:function SpellLoc takes location Position, integer AbiliteID, integer Niveau, integer OrderID, real PointX, real PointY, real PointZ, real Temps, player Joueur, boolean Vision, string OrderString returns unit local unit caster if Vision == true then set caster = CreateUnit( Joueur, 'e003', PointX, PointY, 0) call SetUnitZ(caster,PointZ) call UnitAddAbility(caster,AbiliteID) call SetUnitAbilityLevel(caster,AbiliteID,Niveau) if OrderID != 0 then call IssuePointOrderByIdLoc(caster,OrderID,Position) else call IssuePointOrderByIdLoc(caster,OrderId(OrderString),Position) endif else set caster = CreateUnit( Joueur, 'e004', PointX, PointY, 0) call SetUnitZ(caster,PointZ) call UnitAddAbility(caster,AbiliteID) call SetUnitAbilityLevel(caster,AbiliteID,Niveau) if OrderID != 0 then call IssuePointOrderByIdLoc(caster,OrderID,Position) else call IssuePointOrderByIdLoc(caster,OrderId(OrderString),Position) endif endif call UnitApplyTimedLife( caster, 'BTLF', Temps ) call SetUnitPathing(caster, false) return caster endfunction JASS:function CloudBahamut_Condition takes nothing returns boolean return GetSpellAbilityId()=='A0HX' endfunction function CloudBahamut_Spell takes nothing returns nothing local unit lanceur = GetSpellAbilityUnit() local location position = GetSpellTargetLoc() local player joueur = GetOwningPlayer(lanceur) local integer lvl = GetUnitAbilityLevel(lanceur,'A0HX') if PlayerIT1(joueur) then call SpellLoc(position,'A0HY',lvl,0,GetUnitX(lanceur),GetUnitY(lanceur),0,6,joueur,false,"cloudoffog") else call SpellLoc(position,'A0HZ',lvl,0,GetUnitX(lanceur),GetUnitY(lanceur),0,6,joueur,false,"cloudoffog") endif call RemoveLocation(position) endfunction function Start_CloudBahamut takes nothing returns nothing local trigger declo = CreateTrigger() call TriggerAddCondition(declo,Condition(function CloudBahamut_Condition)) call TriggerRegisterAnyUnitEventBJ(declo,EVENT_PLAYER_UNIT_SPELL_EFFECT) call TriggerAddAction(declo,function CloudBahamut_Spell) endfunction |
| 08-16-2008, 03:39 AM | #2 |
Give this a try (just create a new SpellLoc function, SpellLoc2, for convenience, since it will be taking different values, and you probably have several spells using SpellLoc() already): JASS:function SpellLoc2 takes real posX, real posY, integer AbiliteID, integer Niveau, integer OrderID, real PointX, real PointY, real PointZ, real Temps, player Joueur, boolean Vision, string OrderString returns unit local unit caster if Vision == true then set caster = CreateUnit( Joueur, 'e003', PointX, PointY, 0) else set caster = CreateUnit( Joueur, 'e004', PointX, PointY, 0) endif call UnitApplyTimedLife( caster, 'BTLF', Temps ) call SetUnitPathing(caster, false) call SetUnitZ(caster,PointZ) call UnitAddAbility(caster,AbiliteID) call SetUnitAbilityLevel(caster,AbiliteID,Niveau) if OrderID != 0 then call IssuePointOrderById(caster,OrderID,posX,posY) else call IssuePointOrderById(caster,OrderId(OrderString),posX,posY) endif return caster endfunction JASS:function CloudBahamut_Condition takes nothing returns boolean return GetSpellAbilityId()=='A0HX' endfunction function CloudBahamut_Spell takes nothing returns nothing local unit lanceur = GetSpellAbilityUnit() local location position = GetSpellTargetLoc() local real x = GetLocationX(position) local real y = GetLocationY(position) local player joueur = GetOwningPlayer(lanceur) local integer lvl = GetUnitAbilityLevel(lanceur,'A0HX') if PlayerIT1(joueur) then call SpellLoc2(x,y,'A0HY',lvl,0,GetUnitX(lanceur),GetUnitY(lanceur),0,6,joueur,false,"cloudoffog") else call SpellLoc2(x,y,'A0HZ',lvl,0,GetUnitX(lanceur),GetUnitY(lanceur),0,6,joueur,false,"cloudoffog") endif call RemoveLocation(position) endfunction function Start_CloudBahamut takes nothing returns nothing local trigger declo = CreateTrigger() call TriggerAddCondition(declo,Condition(function CloudBahamut_Condition)) call TriggerRegisterAnyUnitEventBJ(declo,EVENT_PLAYER_UNIT_SPELL_EFFECT) call TriggerAddAction(declo,function CloudBahamut_Spell) endfunction |
| 08-16-2008, 04:02 AM | #3 |
I just tried it; Doesn't work :(. Thanks for posting anyway. |
| 08-16-2008, 04:22 AM | #4 |
Your welcome, I'm sorry it didn't help. Last thing I'd suggest is seeing if it works without call RemoveLocation(position), out of curiousity. You could be destroying the location before the dummy unit casts his spell at it, but I doubt it :(. |
| 08-16-2008, 04:29 AM | #5 |
Well I tried it actually; Added a 2 seconds wait before destroying the location but take in note that; when SpellLoc/SpellLoc2 is called, it will run everything in SpellLoc/SpellLoc2 before executing whatever is after in the Cloud_Bahamut spell, so "normally" the location shouldn't be destroyed before he has started casting it. I also did a debug msg just before ordering the unit, telling me the id of the location and it wasn't null. Something is perturbing the IssueOrder function; if IssueOrder etc.==true then debug true else debug false endif returns false. It always used to return true. The location isn't null, the caster isn't null; its like if the order was erroned... Weird has hell. Maybee someone had similar problems and knows the anwser :(. |
| 08-16-2008, 05:41 AM | #6 |
Yeah, that's it for me. I know that the function call should run in its entirety before everything else, but figured better safe than sorry. Hmmmm. You said that if you change the orderid and ability, it works? Death and decay, for example? |
| 08-16-2008, 07:18 AM | #7 |
Yeah, if i had a base death and decay ability and order deathanddecay, or add a breath of fire and order breathoffire, or far sigh etc. it works pretty well, has before. It's only cloud that is affected, thats why it is weird. |
| 08-16-2008, 07:51 PM | #8 |
Okay, it's the weirdest thing I ever saw in the WE. When you preplace a unit in the World Editor, the Trigger Editor creates a function like CreateUnitForPlayer1 (or 2,3,4,5,Passive etc) that creates units that you placed. If you clicked on those units and you leveled them (like heroes) and you leveled already their skills (for some reasons), in the CreateUnitForPlayer functions there will be SelectHeroSkill functions call. My problems goes from there, but has no logic. My solution was this; I took the older version that was working, and imported the triggers, and all data in the map; that makes it almost the same has the newer one. I test it; cloud works fine... Now I start changing things I had done into my other version, (like leveling heroes to 50 on the map, put their ability to max level)... Test again; oops its not working anymore; no more clouds. The problem goes from there... I binary searched for about 3 hours to know which hero was the cause (42 heroes)... I found 2 heroes. From there I had to test each ability alone, and found 1 ability from each heroes... Those 2 abilities had nothing really strange; all 2 based on channel... But both had something identical; the orderid. The orderid of the spell is "cloudoffog".... Like what the hell. So, if you preplace a unit on the map, and sets a channel ability, which its abilityid is cloudoffog, to at least level 1, it should bug your orderid "cloudoffog" to null. Strange eh? |
| 08-16-2008, 08:32 PM | #9 |
Hmm, very interesting. Here's one more thing to try, if you aren't fed up with testing yet: does the same happen if you level a cloudoffog-based ability on a preplaced unit instead of channel with a cloudoffog orderid? In other words, is it the orderid of a preplaced preleveled ability that matters or the fact that that ability is channel? The moral: don't do funny stuff like preplacing units? :/ I dunno. Anyway, someone should update the known bugs in jass sticky once this gets fully researched, it has been a while since it was last updated. |
| 08-16-2008, 09:00 PM | #10 |
I have many spells leveled based on channel with different orderid's; only 2 had cloudoffog. I did changed them for "absorb" and there's no more problem. Has you know, Cloud of Fog has been badly-hard-coded; you need 2 different abilities for 2 different teams else you backfires the cloud on you, so this is not really surprising to find another bug with Cloud of Fog. |
