wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 08-30-2007, 12:40 AM   #1
Dil999
CUSTOM USER TITLE!!!!!!!!
 
Dil999's Avatar
 
Join Date: Dec 2006
Posts: 740

Dil999 has a spectacular aura about (82)Dil999 has a spectacular aura about (82)Dil999 has a spectacular aura about (82)

Send a message via AIM to Dil999 Send a message via MSN to Dil999 Send a message via Yahoo to Dil999
Default Totally stumped

This trigger should do damage every .10 seconds to every unit in lava. I tried everything to get it to work, and when I but debug messages in I realized, the actions arent even running! Can anyone tell why?
Collapse JASS:
function FirePit_Filter takes nothing returns boolean
    return GetTerrainType(GetUnitX(GetFilterUnit()),GetUnitY(GetFilterUnit())) == 'Dlav' 
endfunction

function FirePit takes nothing returns nothing
    local group g = CreateGroup()
    local unit u
    local PlayerData pd = PlayerData(GetHandleInt(GetOwningPlayer(u),"pd"))
    call BJDebugMsg("running")
    
    call GroupEnumUnitsInRect(g,GetPlayableMapRect(),Filter(function FirePit_Filter))
    
        loop
            set u = FirstOfGroup(g)
            exitwhen u == null
                if not (pd.isfireimmune) and not (pd.isinvuln) then
                    call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_LIFE) - 10.0)
                endif
            call GroupRemoveUnit(g,u)
        endloop
     
    call DestroyGroup(g)
    set u = null
endfunction

function InitTrig_FirePit takes nothing returns nothing
    set gg_trg_FirePit = CreateTrigger()
    call TriggerAddAction(gg_trg_FirePit,function FirePit)
    call TriggerRegisterTimerEvent(gg_trg_FirePit,0.05,true)
endfunction
__________________
Early man walked away as modern man took control.
Their minds weren't all the same, to conquer was his big goal,
So he built his great empire and slaughtered his own kind,
Then he died a confused man, killed himself with his own mind.
Dil999 is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 08-30-2007, 01:07 AM   #2
TaintedReality
User!
 
TaintedReality's Avatar
 
Join Date: Jun 2005
Posts: 849

TaintedReality is a jewel in the rough (159)TaintedReality is a jewel in the rough (159)

AI Tournament #2 - 1st Place

Send a message via MSN to TaintedReality
Default

You use the u variable when it's null.

Collapse JASS:
    local unit u
    local PlayerData pd = PlayerData(GetHandleInt(GetOwningPlayer(-->u<--),"pd"))

That runs before your debug message so that's why you never see it.

Oh and btw, you say it should damage every 0.1 seconds but the trigger seems to be running every 0.05 :).

Last edited by TaintedReality : 08-30-2007 at 01:07 AM.
TaintedReality is offline   Reply With Quote
Old 08-30-2007, 01:11 AM   #3
Dil999
CUSTOM USER TITLE!!!!!!!!
 
Dil999's Avatar
 
Join Date: Dec 2006
Posts: 740

Dil999 has a spectacular aura about (82)Dil999 has a spectacular aura about (82)Dil999 has a spectacular aura about (82)

Send a message via AIM to Dil999 Send a message via MSN to Dil999 Send a message via Yahoo to Dil999
Default

Heres one more thing I cant figure out. This trigger should be changing some global variables and reviving the hero 5 seconds later. It does nothing. I tested and know the trigger is running and the struct is ok.
Collapse JASS:
function Death_Actions takes nothing returns nothing
    local unit u = GetDyingUnit()
    local player p = GetOwningPlayer(u)
    local PlayerData pd = PlayerData(GetHandleInt(p,"pd"))
    local player p2 = pd.killer
    local integer i GetPlayerId(p)
    local integer i2 = GetPlayerId(p2)
    local integer i3 = 0
    
    local real angle = GetRandomReal(0.0,360.0)
    local real distance = GetRandomReal(600.0,2000.0)
    local real x = GetRectCenterX(gg_rct_FirePit) + distance * Cos(angle * bj_DEGTORAD)
    local real y = GetRectCenterY(gg_rct_FirePit) + distance * Sin(angle * bj_DEGTORAD)
    
    call BJDebugMsg(GetPlayerName(p2))
    
    
    call SetPlayerState(p2,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p2,PLAYER_STATE_RESOURCE_GOLD) - 7)
    
    if i != i2 then
        set udg_Kills[i2] = udg_Kills[i2] + 1
        call DisplayTextToForce(GetPlayersAll(),GetPlayerName(p)+ "has died!")
    else
        set udg_Kills[i2] = udg_Kills[i2] - 1
        call DisplayTextToForce(GetPlayersAll(),GetPlayerName(p)+ "has killed himself!")
    endif
    
    
    call LeaderboardSetItemValue(GetLastCreatedLeaderboard(),i2,udg_Kills[i2])
    
    
        if udg_Kills[i2] >= 10 then
            loop
                call CustomDefeatBJ(Player(i3),GetPlayerName(p2)+ "has won!")
                set i3 = i3 + 1
                exitwhen i3 >= 11
            endloop
        endif
    
    call PolledWait(5.0)
    
    call ReviveHero(u,x,y,true)
    call SelectUnitForPlayerSingle(u,GetOwningPlayer(u))
    call PanCameraToForPlayer(GetOwningPlayer(u),x,y)
    
    
    set u = null
    set p = null
    set p2 = null
endfunction



function Death_Conditions takes nothing returns boolean
    return GetUnitTypeId(GetTriggerUnit()) == 'O001'
endfunction

function InitTrig_Death takes nothing returns nothing
    set gg_trg_Death = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Death, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Death, Condition( function Death_Conditions ) )
    call TriggerAddAction( gg_trg_Death, function Death_Actions )
endfunction
__________________
Early man walked away as modern man took control.
Their minds weren't all the same, to conquer was his big goal,
So he built his great empire and slaughtered his own kind,
Then he died a confused man, killed himself with his own mind.

Last edited by Dil999 : 08-30-2007 at 03:32 AM.
Dil999 is offline   Reply With Quote
Old 08-30-2007, 11:34 PM   #4
Dil999
CUSTOM USER TITLE!!!!!!!!
 
Dil999's Avatar
 
Join Date: Dec 2006
Posts: 740

Dil999 has a spectacular aura about (82)Dil999 has a spectacular aura about (82)Dil999 has a spectacular aura about (82)

Send a message via AIM to Dil999 Send a message via MSN to Dil999 Send a message via Yahoo to Dil999
Default

*bumb because I edited the above post*
__________________
Early man walked away as modern man took control.
Their minds weren't all the same, to conquer was his big goal,
So he built his great empire and slaughtered his own kind,
Then he died a confused man, killed himself with his own mind.
Dil999 is offline   Reply With Quote
Old 08-31-2007, 01:30 AM   #5
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

Nothing at all happens? Is the player's gold subtracted? Does the debug message show?
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 08-31-2007, 02:02 AM   #6
Dil999
CUSTOM USER TITLE!!!!!!!!
 
Dil999's Avatar
 
Join Date: Dec 2006
Posts: 740

Dil999 has a spectacular aura about (82)Dil999 has a spectacular aura about (82)Dil999 has a spectacular aura about (82)

Send a message via AIM to Dil999 Send a message via MSN to Dil999 Send a message via Yahoo to Dil999
Default

The debug message plays and the player's gold is subtracted. After that it does nothing.
__________________
Early man walked away as modern man took control.
Their minds weren't all the same, to conquer was his big goal,
So he built his great empire and slaughtered his own kind,
Then he died a confused man, killed himself with his own mind.
Dil999 is offline   Reply With Quote
Old 08-31-2007, 02:22 AM   #7
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)

Default

put an "=" between i and its value when you declare it.
__________________
Ammorth is offline   Reply With Quote
Old 08-31-2007, 02:29 AM   #8
Dil999
CUSTOM USER TITLE!!!!!!!!
 
Dil999's Avatar
 
Join Date: Dec 2006
Posts: 740

Dil999 has a spectacular aura about (82)Dil999 has a spectacular aura about (82)Dil999 has a spectacular aura about (82)

Send a message via AIM to Dil999 Send a message via MSN to Dil999 Send a message via Yahoo to Dil999
Default

Jesus... I have no idea why vJass syntax checker isnt correcting that, either.
__________________
Early man walked away as modern man took control.
Their minds weren't all the same, to conquer was his big goal,
So he built his great empire and slaughtered his own kind,
Then he died a confused man, killed himself with his own mind.
Dil999 is offline   Reply With Quote
Old 08-31-2007, 02:29 AM   #9
NightBreeze
User
 
Join Date: Jun 2006
Posts: 86

NightBreeze is on a distinguished road (16)

Default

What happened to syntax checking? ^^
NightBreeze is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 11:08 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services