• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Need some help with spells

Status
Not open for further replies.
Level 2
Joined
May 11, 2007
Messages
24
Ok, I'm kind of new to map making and I'm interested in making/borrowing spells for the map I'm working on, and to that end I have a couple of questions I need cleared up.

Ok, first, I was looking through another players spell trigger code, and there's a point where it says, "Play Victims death animation". What I'm wondering is i clicked on the trigger to see what other animations I could turn it into and there's no list, 'death' is an entered text. Is there somewhere I can go to find out what other animations I can change it to? Also, what program can I use for my own animations? (Something hopefully not expensive?)


Ok, and my last question (I know you're bored of me already) most of the spells I find only deal 1 level of damage. How do I make it so a certain custom spell does more damage as it goes up in level?

Thanks for your time and assistance :)
 
Level 3
Joined
Jun 18, 2007
Messages
72
For you animation trigger question. I believe that it is set as a specific string value and thats why its in text. And you can find the actual values that can be used on the unit by simply placing the unit in your map via the Unit Pallete and on your left you should see a box with a portrait of the unit and at the top of the box it says the name then under it, it says "Animation:" and then a box with 2 side facing arrows next to it. Just simply click those arrows to change the animation in the box and then you can find exactly all the string values available to the unit that you can place in that trigger code. Keep in mind that something like "play death animation" doesnt actually kill the unit, it just plays the animation. If you then tell the unit to move it will go back to normal, if you want the unit to actually die then you'll have to set a kill trigger.
 
Level 2
Joined
Nov 9, 2006
Messages
25
Animation tutorial: http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=32588

So if you wanted to play its spell casting animation you would enter spell in the field where death is.

As to your second question do you mean the damage they do in the level editor? You can change the Stats - Number of levels field, and then change the fields within the spell that do damage.

If you mean that they have triggers, and the triggers only work for 1 level spells, then it becomes a bit more tricky. If you post the code to the spell here or in the triggering forum, then someone will be able to help you with it.
 
Level 2
Joined
May 11, 2007
Messages
24
Ah, triggers only work for level 1 spells, I see. Well that explains a lot of things then. Ok, so I want this spell to have 3 levels of damage:


constant function TiBo_Id takes nothing returns integer
return 'A001'
endfunction

constant function TiBo_ItemId takes nothing returns integer
return 'I001'
endfunction

constant function TiBo_NotActivatedItemId takes nothing returns integer
return 'I000'
endfunction

constant function TiBo_MaxArea takes nothing returns rect
return bj_mapInitialPlayableArea
endfunction

constant function TiBo_Periodic takes nothing returns real
return 1.00
endfunction

constant function TiBo_MaxTime takes nothing returns real
return 10.00
endfunction

constant function TiBo_ExplodeArea takes nothing returns real
return 300.00
endfunction

constant function TiBo_DestroyDestructableArea takes nothing returns real
return 300.00
endfunction

constant function TiBo_ExplodeDamage takes nothing returns real
return 200.00
endfunction

constant function TiBo_ExplodeMdl takes nothing returns string
return "Abilities\\Weapons\\Mortar\\MortarMissile.mdl"
endfunction

constant function TiBo_ExplodeSoundPath takes nothing returns string
return "Sound\\Buildings\\Death\\BuildingDeathLargeHuman.wav"
endfunction

constant function TiBo_ExplodeSoundRange takes nothing returns real
return 1500.00
endfunction

constant function TiBo_TickSoundPath takes nothing returns string
return "Sound\\Interface\\BattleNetTick.wav"
endfunction

constant function TiBo_TickSoundRange takes nothing returns real
return 500.00
endfunction

constant function TiBo_NotActivatedExplodeDelay takes nothing returns real
return 0.50
endfunction

constant function TiBo_Dummy takes nothing returns integer
return 'e000'
endfunction

constant function TiBo_ExplodeScale takes nothing returns real
return 3.00
endfunction


constant function TiBo_ExplodeAttach takes nothing returns string
return "origin"
endfunction

constant function TiBo_Code takes nothing returns string
return "TimeBomb_SaveVars"
endfunction

constant function TiBo_NotActivatedBombsFunction takes nothing returns string
return "TimeBomb_DestroyNotActivatedBombs"
endfunction

function TiBo_GetUnitConitions takes nothing returns boolean
return UnitHasItem(GetFilterUnit(),I2It(GetStoredInteger(udg_cache,TiBo_Code(),"bomb")))
endfunction

function Trig_Time_Bomb_Conditions takes nothing returns boolean
return GetSpellAbilityId()==TiBo_Id()
endfunction

function TimeBomb_EnumDamage takes nothing returns nothing
local unit u=I2U(GetStoredInteger(udg_cache,TiBo_Code(),"lastOwner"))
call UnitDamageTarget(u,GetEnumUnit(),TiBo_ExplodeDamage(),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
set u=null
endfunction

function TimeBomb_GetBombUnit takes nothing returns nothing
call StoreInteger(udg_cache,TiBo_Code(),"lastOwner",H2I(GetEnumUnit()))
endfunction

function TimeBomb_DestructableKill takes nothing returns nothing
local destructable d=GetEnumDestructable()
if not IsDestructableInvulnerable(d) and GetDestructableLife(d)>0 then
call KillDestructable(d)
endif
set d=null
endfunction

function TiBo_InitDestroyNotActivatedBombs takes nothing returns nothing
local timer t =GetExpiredTimer()
local string s =H2S(t)
local item i =I2It(GetStoredInteger(udg_cache,s,"bomb"))
if GetWidgetLife(i)>0 then
call StoreInteger(udg_cache,TiBo_Code(),"bomb",H2I(i))
call ExecuteFunc(TiBo_NotActivatedBombsFunction())
else
set i=null
endif
call FlushStoredMission(udg_cache,s)
call AB_DestroyTimer(t)
endfunction

function TimeBomb_DestroyBombsInTheNear takes nothing returns nothing
local item i=GetEnumItem()
local timer t
if GetItemTypeId(i)==TiBo_ItemId() then
call SetWidgetLife(i,0)
elseif GetItemTypeId(i)==TiBo_NotActivatedItemId() then
set t=CreateTimer()
call TimerStart(t,TiBo_NotActivatedExplodeDelay(),false,function TiBo_InitDestroyNotActivatedBombs)
call StoreInteger(udg_cache,H2S(t),"bomb",H2I(i))
set t=null
endif
set i=null
endfunction

function TimeBomb_DestroyNotActivatedBombs takes nothing returns nothing
local item i =I2It(GetStoredInteger(udg_cache,TiBo_Code(),"bomb"))
local real x =GetItemX(i)
local real y =GetItemY(i)
local group g
local unit a
call FlushStoredMission(udg_cache,TiBo_Code())
call Play3DSoundAtPointXY(TiBo_ExplodeSoundPath(),x,y,0,TiBo_ExplodeSoundRange(),100)
set a=CreateUnit(Player(14),TiBo_Dummy(),x,y,GetRandomReal(0,360))
call SetUnitPathing(a,false)
call SetUnitX(a,x)
call SetUnitY(a,y)
call SetUnitScale(a,TiBo_ExplodeScale(),TiBo_ExplodeScale(),TiBo_ExplodeScale())
call DestroyEffect(AddSpecialEffectTarget(TiBo_ExplodeMdl(),a,TiBo_ExplodeAttach()))
call U2Null(a,0.5)
call RemoveItem(i)
call PickUpDestructableInCircle(x,y,TiBo_DestroyDestructableArea(),function TimeBomb_DestructableKill)
call PickUpItemsInCircle(x,y,TiBo_ExplodeArea(),function TimeBomb_DestroyBombsInTheNear)
call StoreInteger(udg_cache,TiBo_Code(),"lastOwner",H2I(a))
set g=GetUnitsInRange(TiBo_ExplodeArea(),x,y,null,true)
call ForGroup(g,function TimeBomb_EnumDamage)
call FlushStoredMission(udg_cache,TiBo_Code())
call AB_DestroyGroup(g)
set a=null
endfunction

function TimeBomb_Counter takes nothing returns nothing
local timer t =GetExpiredTimer()
local string s =H2S(t)
local real counter =GetStoredReal(udg_cache,s,"counter")
local unit lastOwner =I2U(GetStoredInteger(udg_cache,s,"lastOwner"))
local item bomb =I2It(GetStoredInteger(udg_cache,s,"bomb"))
local texttag tt =CreateTextTagXY(I2S(R2I(counter))+"!",0,0,0,12,100,0,0,0)
local real xvel =(64*0.071/128)*Cos(90*3.14159/180)
local real yvel =(64*0.071/128)*Sin(90*3.14159/180)
local real x
local real y
local group g
local unit a

if IsItemOwned(bomb) then
if UnitHasItem(lastOwner,bomb) then
set x=GetUnitX(lastOwner)
set y=GetUnitY(lastOwner)
else
call StoreInteger(udg_cache,TiBo_Code(),"bomb",H2I(bomb))
set g=GetUnitsInRectMatching(TiBo_MaxArea(),Condition(function TiBo_GetUnitConitions))
call ForGroup(g,function TimeBomb_GetBombUnit)
set lastOwner=I2U(GetStoredInteger(udg_cache,TiBo_Code(),"lastOwner"))
set x=GetUnitX(lastOwner)
set y=GetUnitY(lastOwner)
call StoreInteger(udg_cache,s,"lastOwner",H2I(lastOwner))
call FlushStoredMission(udg_cache,TiBo_Code())
call AB_DestroyGroup(g)
endif
else
set x=GetItemX(bomb)
set y=GetItemY(bomb)
endif
call SetTextTagPos(tt,x,y,60)
call SetTextTagPermanent(tt,false)
call SetTextTagVelocity(tt,xvel,yvel)
call SetTextTagLifespan(tt,2)
call SetTextTagFadepoint(tt,1)
call Play3DSoundAtPointXY(TiBo_TickSoundPath(),x,y,0,TiBo_TickSoundRange(),100)

if counter>0 and GetWidgetLife(bomb)>0.00 then
call TimerStart(t,TiBo_Periodic(),false,function TimeBomb_Counter)
call StoreReal(udg_cache,s,"counter",counter-TiBo_Periodic())
set t=null
else
call FlushStoredMission(udg_cache,s)
call AB_DestroyTimer(t)
call Play3DSoundAtPointXY(TiBo_ExplodeSoundPath(),x,y,0,TiBo_ExplodeSoundRange(),100)
set a=CreateUnit(Player(14),TiBo_Dummy(),x,y,GetRandomReal(0,360))
call SetUnitPathing(a,false)
call SetUnitX(a,x)
call SetUnitY(a,y)
call SetUnitScale(a,TiBo_ExplodeScale(),TiBo_ExplodeScale(),TiBo_ExplodeScale())
call DestroyEffect(AddSpecialEffectTarget(TiBo_ExplodeMdl(),a,TiBo_ExplodeAttach()))
call U2Null(a,0.5)
set a=null
call PickUpDestructableInCircle(x,y,TiBo_DestroyDestructableArea(),function TimeBomb_DestructableKill)
call PickUpItemsInCircle(x,y,TiBo_ExplodeArea(),function TimeBomb_DestroyBombsInTheNear)
call StoreInteger(udg_cache,TiBo_Code(),"lastOwner",H2I(lastOwner))
set g=GetUnitsInRange(TiBo_ExplodeArea(),x,y,null,true)
call ForGroup(g,function TimeBomb_EnumDamage)
call FlushStoredMission(udg_cache,TiBo_Code())
call AB_DestroyGroup(g)
call RemoveItem(bomb)
endif
endfunction

function Trig_Time_Bomb_Actions takes nothing returns nothing
local timer t =CreateTimer()
local unit u =GetTriggerUnit()
local item b =CreateItem(TiBo_ItemId(),GetUnitX(u),GetUnitY(u))
local string s =H2S(t)

call RemoveItem(GetManipulatedItem())
call SetItemVisible(b,false)
call TriggerSleepAction(0.001)
call SetItemVisible(b,true)
call UnitAddItem(u,b)
call TimerStart(t,0,false,function TimeBomb_Counter)
call StoreInteger(udg_cache,s,"bomb",H2I(b))
call StoreInteger(udg_cache,s,"lastOwner",H2I(u))
call StoreReal(udg_cache,s,"counter",TiBo_MaxTime())

set t=null
endfunction

//===========================================================================
function InitTrig_Time_Bomb takes nothing returns nothing
set gg_trg_Time_Bomb = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Time_Bomb, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Time_Bomb, Condition( function Trig_Time_Bomb_Conditions ) )
call TriggerAddAction( gg_trg_Time_Bomb, function Trig_Time_Bomb_Actions )
endfunction


How would that work? How would I modify it along with the ability to make that happen?
 
Level 2
Joined
May 11, 2007
Messages
24
The spell creates a Time Bomb in your inventory Which you can then click on to arm, which gives it a 10 second timer, which counts down and explodes at the end of the timer.

What I want to to have it have 3 levels of dmg, 300, 450, and 600, reduce the timer to 5 seconds. Then, instead of having it create it in your inventory, I'd like it to create it on the ground invisible, and give the casting hero the option to arm it at any time. Also, A detonated mine should detonate all unarmed bombs in proximity, allowing for some cool chain reaction and domino effects.

Also... what is GUI and where do I learn it? This is the only spell I've been able to create so far, very simple I imagine:

function Trig_Flashfreeze_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A001' ) ) then
return false
endif
return true
endfunction

function Trig_Flashfreeze_Func028002 takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Flashfreeze_Func039002 takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Flashfreeze_Actions takes nothing returns nothing
set udg_CenterFreeze = GetUnitLoc(GetTriggerUnit())
set udg_FreezePoint[15] = PolarProjectionBJ(udg_CenterFreeze, 100.00, 45.00)
set udg_FreezePoint[1] = PolarProjectionBJ(udg_CenterFreeze, 100.00, 90.00)
set udg_FreezePoint[2] = PolarProjectionBJ(udg_CenterFreeze, 100.00, 135.00)
set udg_FreezePoint[3] = PolarProjectionBJ(udg_CenterFreeze, 100.00, 180.00)
set udg_FreezePoint[4] = PolarProjectionBJ(udg_CenterFreeze, 100.00, 225.00)
set udg_FreezePoint[5] = PolarProjectionBJ(udg_CenterFreeze, 100.00, 270.00)
set udg_FreezePoint[6] = PolarProjectionBJ(udg_CenterFreeze, 100.00, 315.00)
set udg_FreezePoint[7] = PolarProjectionBJ(udg_CenterFreeze, 100.00, 360.00)
set udg_FreezePoint[16] = PolarProjectionBJ(udg_CenterFreeze, 250.00, 45.00)
set udg_FreezePoint[8] = PolarProjectionBJ(udg_CenterFreeze, 250.00, 90.00)
set udg_FreezePoint[9] = PolarProjectionBJ(udg_CenterFreeze, 250.00, 135.00)
set udg_FreezePoint[10] = PolarProjectionBJ(udg_CenterFreeze, 250.00, 180.00)
set udg_FreezePoint[11] = PolarProjectionBJ(udg_CenterFreeze, 250.00, 225.00)
set udg_FreezePoint[12] = PolarProjectionBJ(udg_CenterFreeze, 250.00, 270.00)
set udg_FreezePoint[13] = PolarProjectionBJ(udg_CenterFreeze, 250.00, 315.00)
set udg_FreezePoint[14] = PolarProjectionBJ(udg_CenterFreeze, 250.00, 360.00)
call TriggerSleepAction( 0.20 )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[1], bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[2], bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[3], bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[4], bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[5], bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[6], bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[7], bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[15], bj_UNIT_FACING )
call TriggerSleepAction( 0.20 )
call ForGroupBJ( GetUnitsOfPlayerAndTypeId(GetTriggerPlayer(), 'h004'), function Trig_Flashfreeze_Func028002 )
call TriggerSleepAction( 0.20 )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[8], bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[9], bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[10], bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[11], bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[12], bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[13], bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[14], bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'h004', GetTriggerPlayer(), udg_FreezePoint[16], bj_UNIT_FACING )
call TriggerSleepAction( 0.20 )
call ForGroupBJ( GetUnitsOfPlayerAndTypeId(GetTriggerPlayer(), 'h004'), function Trig_Flashfreeze_Func039002 )
call TriggerSleepAction( 0.20 )
call RemoveLocation (udg_FreezePoint[1])
call RemoveLocation (udg_FreezePoint[2])
call RemoveLocation (udg_FreezePoint[3])
call RemoveLocation (udg_FreezePoint[4])
call RemoveLocation (udg_FreezePoint[5])
call RemoveLocation (udg_FreezePoint[6])
call RemoveLocation (udg_FreezePoint[7])
call RemoveLocation (udg_FreezePoint[8])
call RemoveLocation (udg_FreezePoint[9])
call RemoveLocation (udg_FreezePoint[10])
call RemoveLocation (udg_FreezePoint[11])
call RemoveLocation (udg_FreezePoint[12])
call RemoveLocation (udg_FreezePoint[13])
call RemoveLocation (udg_FreezePoint[14])
call RemoveLocation (udg_CenterFreeze)
endfunction

//===========================================================================
function InitTrig_Flashfreeze takes nothing returns nothing
set gg_trg_Flashfreeze = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flashfreeze, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Flashfreeze, Condition( function Trig_Flashfreeze_Conditions ) )
call TriggerAddAction( gg_trg_Flashfreeze, function Trig_Flashfreeze_Actions )
endfunction


I converted it to custom text because I don't how to copy the triggers like I've seen around here, but if you see any leaks, or can also explain to me what leaks are, that'd be great o_O
 
Level 8
Joined
May 13, 2007
Messages
392
GUI triggering is the normal way of triggering, actually mostly called 'basic'. GUI trigger is made like any other tirgger through the Triggers button in WE.... you know... the normal Event, condition and action thingy....

Ok, i didnt explain it at all. But, i could try make this spell you want, but not in Jass triggering (advanced), becouse i dont know it.
 
Level 9
Joined
Jul 27, 2006
Messages
652
Just a few quick points,
1. Violat3r - there are rules againtst full post colouring.
2. Lashkor - Welcome to the hive! I suggest you introduce yourself in the introductions section in offtopic.
3. Please use
JASS:
 tags when posting jass scripts.
4. GUI is not normal, JASS is normal, GUI is JASS made easy and simple.
5. Stick with JASS its better.
6. I havn't been able to go through your scripts but if you want proper JASS help go to the JASS scripting section.
 
Level 3
Joined
Jun 18, 2007
Messages
72
i apologize for going off topic here but i needed to address Kixer's comment about me: Uh.........nope. Believe me i have searched all the rules and no where that i have found does it say anything about full post coloring (if you can find something, then please do let me know). Plus i have a good 47 posts ALL in green and thus far, not one admin has cared ever. Yes i can understand if it were a very long block of text, it can get difficult to read. So if i were to put a giant text block then i would use normal.
 
Level 9
Joined
Jul 27, 2006
Messages
652
[offtopic]
My appologise,
I remembered that along time ago the were rules against that but they must have changed.
 
Status
Not open for further replies.
Top