- Joined
- Mar 10, 2009
- Messages
- 5,014
Soweee, Adiktuz, you already answered it
...
function JOIN_US takes unit GUIer returns nothing
call IssueImmediateOrder(GUIer,"smart")
call TriggerSleepAction (ENOUGH_TIME_FOR_A_GUIER_TO_UNDERSTAND_HOW_GUI_IS_INEFFICIENT)
if DidNotQuit then
call BJDebugMsg("A GUIer has went to the JASS side ^^")
call set NUMBER_OF_JASSERS = NUMBER_OF_JASSERS + 1
call UnitGroupPraiseUnit(JASSERS, GUIer)
else
call JOIN_US(GUIer)
endif
endfunction
/*
anyway, lets not force him, he will soon realize that he needs to learn jass anyway...
then he will say "I should have listened to them"
*/
function i leave gui takes delGUIFromMem returns GreatSpellAtvJass
endfunction
Stick to topic please...
function Actions takes nothing returns nothing
// here are your actions
endfunction
function Conditions takes nothing returns boolean
return true
endfunction
function Init takes nothing returns nothing
set gg_trg_SomeTrig = CreateTrigger()
call TriggerAddAction(gg_trg_SomeTrig,function Actions)
call TriggerAddCondition(gg_trg_SomeTrig,function Conditions)
endfunction
believe me, go learn jass directly coz it's 200% more efficient...
scope simpledamagespell initializer init
private function SimpleDamage takes nothing returns boolean
//here we check if the casted spell corresponds to the spells that we want
//this code works for
//i didn't use a local for the unit since i think two calls is tolerable
if GetSpellAbilityId()=='A000'
then
call UnitDamageTarget (GetTriggerUnit (), GetSpellTargetUnit (), 100* (GetUnitAbilityLevel (GetTriggerUnit(), 'A000')), false, false,ATTACK_TYPE_CHAOS, DAMAGE_TYPE_DIVINE, null)
endif
//here we deal damage to target
//we need this line since the function should return a boolean
return false
endfunction
//this is the function tun at map init
private function init takes nothing returns nothing
//here we create a trigger
local trigger t=CreateTrigger ()
local integer i=0
loop
exitwhen i>15
//we register the event unit - A Unit starts the eedect of an ability
//For al player
call TriggerRegisterPlayerUnitEvent (t, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set i=i+1
endloop
//we merge the actions into the condition becase its faster than actions
call TriggerAddCondition (t, Condition(function SimpleDamage))
set t=null
endfunction
endscope
I need someone to help me with the spell i posted...i alr change the dummy thing but still dont work@Adiktuz: ^^ lol (infinite loop)
@rysnt11:You're going to LOVE vJASS ^^
@Ketsuno Anson: Sorry :/
If you have any questions, just ask ^^
Btw, if you want to start with GUI, I suggest you go with hashtables instead of indexing
since indexing can be a tad .. confusing/troublesome. (Even "I" don't know how to
create a good indexing system.) That's why I went straight to vJASS ^^
With GUI, you need to make your spells MUI
That means that more than 1 unit can cast the spell at once.
In JASS, you don't even have to worry about it because your scripts are going to
be MUI anyways
Try reading those tutorials on hashtables
They're VERY useful and when you want to learn JASS, they'll be VERY important
for your comprehension of how utilities like TimerUtils or Table work. That's when
you'll be able to move to vJASS ^^
Here's a small exercise I prepared for you:
-Write a spell in GUI that uses hashtables. This spell creates a ball of fire that will deal
100 damage to all units within an 800 range for 5 seconds.
Think you can pull it off? Try it ^^