| 02-06-2007, 06:08 PM | #1 | ||
Hi: This is a spell made for the Zephyr Challenge #1 spell contest at the hive workshop. This spell complies with JESP. Description:
EDIT: Screenshot added. |
| 02-10-2007, 05:59 PM | #2 |
I don't understand the part in which you add a single unit to a unit group, then ForGroup that group to do something with ExecuteFunc, wouldn't it be easier to just process the unit directly without the unit group intervention? |
| 02-10-2007, 10:30 PM | #3 |
Well, I did that in order to use GetEnumUnit() command in the function started by ExecuteFunc and get the target corpse. With that I save the usage of handle vars, return bug exploiters, etc. |
| 02-10-2007, 10:36 PM | #4 |
but for that you could just use a global variable? |
| 02-10-2007, 11:11 PM | #5 |
is it just me or if you have more than one soul and when both souls intend to kill a target but one reaches first and kills it, the second disappears? or is it meant to be that way? EDIT: oh and they cost food too! |
| 02-11-2007, 12:06 AM | #6 | ||
Quote:
Yes, that's true. the souls have as a purpose to damage/control an enemy temporally. So, as an example, the caster has 3 souls, and the target enemy die with less souls, then the remaining souls won't have any purpose and they will die. I did in that way in order to give limitations to the spell. About the food.... Hmm... I have to see if there's a way to fix it. Thanks for your comments. Quote:
|
| 02-11-2007, 05:38 PM | #7 |
Nooo Moyack. Global variables make things non-MUI in some cases, but temp globals for use in ForGroup() and ExecuteFunc() callbacks are perfectly okay. Temp globals are the ones declared in the blizzard.j file. That is more than likely what Blu told you. It's just you probably misunderstood. |
| 02-11-2007, 05:52 PM | #8 |
Cursed_Soul_GetRandomEnemy has unnecessary usage of boolean variables. As Vex mentioned, ForGroup for no reason. You could use a temp BJ global to pass the unit, which is acceptable for JESP. Trigger sleep action loops? (Edit: I loaded this thread ages ago and did other stuff before replying, so this is essentially a cross-post with Dusk) |
| 02-11-2007, 06:46 PM | #9 | |||
Quote:
Quote:
JASS:function Cursed_Soul_GetRandomEnemy takes unit c, group g, real range returns unit local unit u local boolean b1 local boolean b2 local boolean b3 local boolean b4 local boolean b5 loop set u = FirstOfGroup(g) set b1 = GetWidgetLife( u ) > 0.405 set b2 = IsUnitType(u, UNIT_TYPE_STRUCTURE) == false set b3 = IsUnitType(u, UNIT_TYPE_FLYING) == false set b4 = IsUnitEnemy(u, GetOwningPlayer(c)) set b5 = IsUnitInRangeXY(u, GetUnitX(c), GetUnitY(c), range) exitwhen u == null or (b1 and b2 and b3 and b4 and b5) call GroupRemoveUnit(g, u) endloop call DestroyGroup(g) return u endfunction I do in this way so the code can be more readable for me (I just hate to read a LOOONG line with booleans). Because booleans doesn't leak, I think there's no problem. Unless you know some issue in particular. Quote:
Are there TriggerSleepActions unnecessarily?? I checked and I consider all of them are importants in the spell behavior. |
| 02-25-2007, 05:35 AM | #10 |
I don't know what Blu was refering when he mentioned the TriggerSleepActions, but the function is faulty as if someone lags in a multiplayer game, it may cause desyncs. PolledWait() fixes this problem, though it leaks, so Vex made an improved version. ~Daelin |
| 02-25-2007, 10:48 AM | #11 |
He was referring to TSA inside of loops. They are innaccurate and do not function as desired. The use of a TSA inside of a loop *should* always be replaced by a periodic timer. Always. |
| 02-27-2007, 05:09 AM | #12 | |
Quote:
...or is that just another way to refer to "a variable declared in the variable editor"? To comply with the JESP standard, what does one have to state (regarding globals) in the spell code? |
| 02-27-2007, 11:21 AM | #13 |
@Rising: I think the TSA usage in this spell is acceptable since I don't require precision in the loop, it's used just to give smoothness to the soul movement. (Check that I used call TriggerSleepAction(0.0)) @Pyrogasm: The Temp BJ globals are variables defined in the global section of the Blizzard.j file. They are used by the BJ functions to transfer data from one function to other. |
| 02-27-2007, 03:27 PM | #14 |
TriggerSleepAction(0.0) is aproximately equivalent with TriggerSleepAction(0.30). Usually this is the value, though sometimes it may be slightly lower 0.27. Therefore, TriggerSleepAction(0.0) will always make the movement look "choppy" or "lagged". Moreover, TriggerSleepAction can cause desyncs in multiplayer. You should definitely focus on timers, though ti depends as I saw the spell, you probably used this to make the units follow the caster, and so, super accuracy is not required. Therefore, I'd go with PolledWait. ~Daelin |
| 02-27-2007, 05:10 PM | #15 |
TSA is also heavily delayed on Bnet based upon synchronization with the host. This can cause a spell to be utterly unusable. I remember an AotZ ability that had a 0.0 TSA loop that in SP was perfect, but in most MP games was delayed up to 2 seconds between iterations. This spell should most definitely be in a timer callback for a good half of the stuff. Also, your current loop has the potential to bust execution limit if the caster never dies or vanishes. Not that this case is likely, but it's worth noting. |
