HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

[jass], [hiddenjass], [ljass] and [trigger] tags

12-22-2005, 01:30 AM#1
Vexorian
Please use the [jass] and [trigger] tags

trigger tag

Trigger:
Spell Ability
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Spell
Collapse Actions
Set TargetUnit = (Target unit of ability being cast)
Set Caster = (Triggering unit)
Set UnitDamage = (# + (# x (Real((Intelligence of Caster (Include bonuses))))))
Unit - Cause Caster to damage TargetUnit, dealing UnitDamage damage of attack type Normal and damage type Universal
Floating Text - Create floating text that reads (String(UnitDamage)) at (Target point of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Wait 1.00 seconds
Floating Text - Destroy (Last created floating text)


Jass tag
Collapse JASS:

function DoSomething takes unit u returns location
    return GetUnitLoc(u) //this will leak if not cleaned
endfunction

function Na takes nothing returns nothing
 local effect fx=AddSpecialEffect("boo\\ba.mdl", DoSomething(GetTriggerUnit()))

   call DestroyEffect(fx)

 //fx is not set to null so it leaks anyways no matter it was destroyed
endfunction

JASS tag - Errors and highlight
The jass tag has 2 features to add more functionality, some times you want to point out an error or put more strength to some text, you can place errors between # # and things to highlight between @ @

Collapse JASS:
call SetUnitPositionLoc(u, GetUnitLoc(ou) )


call SetUnitPosition(u, GetUnitX(ou), GetUnitY(ou) )


The code that generated the above code block is:


[jass]
call SetUnitPositionLoc(u, #GetUnitLoc(ou)# )


call SetUnitPosition(u, @GetUnitX(ou), GetUnitY(ou)@ )

[/jass]


JASS tag - JASS extensions
As a way to officiallize a preprocessor syntax that was the result of some kind of agreement, //! is considered preprocessor directive by the JASS tag.

Collapse JASS:
//! include something.j
function blah takes nothing returns nothing //...


The keywords static, struct and endstruct are also highlighted

Inline JASS tag [ljass]
Sometimes you only need highlight for a single line and a whole block is too much, for example: call DoNothing()
Initially collapsed JASS tag
You may want to make your script begin collapsed, then use the hiddenjass instead of the jasstag

[hiddenjass=My Function]function myfunction takes nothing returns real
return 56.3
endfunction
[/hiddenjass]

Expand My Function:
10-03-2006, 05:25 AM#2
Vexorian
there are updates...
10-03-2006, 08:06 AM#3
Blade.dk
Awesome - One thing though: I think the highlight color is very light, I find it hard to see on this screen. Else good job. (You can delete this when you've read it).
10-04-2007, 04:32 AM#4
Vexorian
Take a look to the new things I added to the jass tag.