Page 1 of 2

Spell help..

Posted: June 19th, 2007, 11:33 am
by namespoofer
mmMmk. So I got Aero to give me some good ownage tips on making spellz in JASS and shit.. (4-5 hours straight lol)

I understand most of it, so I thought I would try something different.. save the unt instead of the location.. And I can't seem to get it to work, and Aero told me to Terrian and not worry about it, aka, figure it out urself on ur own time.. bastard.. -.-
Basically, when you cast meteor storm, it causes infernal births to randomly spawn around you and deal dmg. Aero at least told me what function to use to convert unit to integer to be stored in a game cache..

I cannot figure out why this doesn't work... I'm using these 2 custom functions:

Code: Select all

function H2I takes handle h returns integer
return h
return 0
endfunction

function ReturnUnit takes string title, string tag returns unit
return GetStoredInteger(udg_gc,title,tag)
return null
endfunction


And here is the trigger:

Code: Select all

function metcond takes nothing returns boolean
return GetSpellAbilityId()=='A05C'
endfunction

function mettimer takes nothing returns nothing
local timer t=GetExpiredTimer()
local string s=(I2S(H2I(t)))
local unit u=ReturnUnit(s,"u")
local location l=GetUnitLoc(u)
local real x=GetLocationX(l)
local real y=GetLocationY(l)
local rect r=Rect(-640,384,256,448)
call RemoveLocation(l)
call MoveRectTo(r,x,y)
call DestroyEffect(AddSpecialEffectLocBJ(GetRandomLocInRect(r),"Units\\Demon\\Infernal\\InfernalBirth.mdl"))
call DestroyTimer(t)
call RemoveRect(r)
set l=null
set r=null
set t=null
set u=null
endfunction

function metact takes nothing returns nothing
local unit u=GetTriggerUnit()
local timer t=CreateTimer()
local string s=(I2S(H2I(t)))
local region r
call StoreInteger(udg_gc,s,"playerid",GetPlayerId(GetTriggerPlayer()))
call StoreInteger(udg_gc,s,"u",H2I(u))
call TimerStart(t,.05,true,function mettimer)
call PolledWait(2.50)
call DestroyTimer(t)
call FlushStoredMission(udg_gc,s)
set u=null
set s=""
set t=null   
endfunction

function InitTrig_meteorstorm takes nothing returns nothing
set gg_trg_meteorstorm = CreateTrigger()
call TriggerAddCondition(gg_trg_meteorstorm, Condition(function metcond))
call TriggerAddAction(gg_trg_meteorstorm, function metact)
endfunction


Rundown- unit casts spell, takes unit through 'ReturnUnit' function, stores it as integer, creates timer, starts timer, stores player id, GetStoredUnit gets the unit, gets the location of unit, converts location to xy, creates rect, moves rect to xy, and when timer goes off, creates infernal birth at random spot in rect.. then the clean-up..

K, so, Xantan, don't gimme the run-down on how easy it can be done.. I'm doing this the hard way to learn.. -.-

Spoofzz

Re: Spell help..

Posted: June 19th, 2007, 11:40 am
by Xantan
namespoofer wrote:
K, so, Xantan, don't gimme the run-down on how easy it can be done.. I'm doing this the hard way to learn.. -.-

Spoofzz

Do it yourself then, if you'd like to learn ^^


I'm going to bed, may or may not look at this tomorrow.
peace.

Re: Spell help..

Posted: June 19th, 2007, 11:42 am
by namespoofer
Xantan wrote:
namespoofer wrote:
K, so, Xantan, don't gimme the run-down on how easy it can be done.. I'm doing this the hard way to learn.. -.-

Spoofzz

Do it yourself then, if you'd like to learn ^^


I'm going to bed, may or may not look at this tomorrow.
peace.


But usually you give me the easiest way to do it -.- I have given up on this and want to know what I did wrong =\

I didn't mean don't help me Xantan!!!!! =(

Posted: June 19th, 2007, 3:31 pm
by Sir-Tanks
He's gone for good :)

Posted: June 19th, 2007, 4:18 pm
by Aero
Facking noob
You missed the easiest part

Code: Select all

function InitTrig_meteorstorm takes nothing returns nothing 
set gg_trg_meteorstorm = CreateTrigger()
call TriggerAddCondition(gg_trg_meteorstorm, Condition(function metcond))
call TriggerAddAction(gg_trg_meteorstorm, function metact)
endfunction


call TriggerRegisterAnyUnitEventBJ ? .... Nab -.-

Posted: June 19th, 2007, 7:27 pm
by Bill Gates
haha yes namespoofer you are a facking nab even i knew that :X and im a bigger noob

Posted: June 19th, 2007, 7:42 pm
by Bartimaeus²
13ill_Gates wrote:haha yes namespoofer you are a facking nab even i knew that :X and im a bigger noob


Okay.. I don't think you know JASS at all!

Posted: June 19th, 2007, 7:46 pm
by Bill Gates
hey i know a lil...

Posted: June 19th, 2007, 7:47 pm
by Sir-Tanks
Sure... i bet you dont :wink:

Posted: June 19th, 2007, 7:48 pm
by Bill Gates
oh wait did namespoofer edit his post cause he has what aero has