| 11-14-2009, 03:27 PM | #1 |
Hey there, the following scripts give me several syntax errors, but I cannot put my finger on what's wrong with it? If it matters at all, it's in the custom scripts section of the map. Global declaration included so you can see the variables used: JASS:globals hashtable ht = InitHashtable() integer dummyID = 'u000' endglobals function dummyCastTargeted takes unit target, player caster, integer abilityID, string order returns nothing real x = GetUnitX(target) real y = GetUnitY(target) unit dummy = CreateUnit(caster, dummyID, x, y, 0) call UnitApplyTimedLife(dummy, 'BTLF', 3.0) call UnitAddAbility(dummy, abilityID) call IssueTargetOrder(dummy, order, target) target = null dummy = null endfunction Anyon able to tell me what's wrong? EDIT: I just installed the JASS newgen pack and updated my TESH and JassHelper, so it might have to do with those? |
| 11-14-2009, 03:30 PM | #2 |
Uh, you aren't declaring your local variables... JASS:function dummyCastTargeted takes unit target, player caster, integer abilityID, string order returns nothing local real x = GetUnitX(target) local real y = GetUnitY(target) local unit dummy = CreateUnit(caster, dummyID, x, y, 0) call UnitApplyTimedLife(dummy, 'BTLF', 3.0) call UnitAddAbility(dummy, abilityID) call IssueTargetOrder(dummy, order, target) set target = null set dummy = null endfunction |
| 11-14-2009, 04:32 PM | #3 |
Oh my god... I have been away from JASS for so long, coding some other stuff and I seemed to remember not having to declare variables in JASS... Doh! EDIT: also fixed the other stuff, like forgetting set VARIABLE = whatever, damn I have been away from JASS for too long :P |
| 11-15-2009, 01:05 AM | #4 |
do not null params, this is waste of chars. |
