• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[General] Jass Problem

Status
Not open for further replies.
Level 8
Joined
Jul 10, 2018
Messages
383
Sorry for posting too many threads, but this is serious problem and i can't seem to fix it So my jazz code isn't running when putting Turn on This[Trigger_Example]
This is the Trigger Jazz

Code:
function Trig_O97661_Func001C takes nothing returns boolean
return(IsUnitGroupEmptyBJ(GetUnitsInRectOfPlayer(gg_rct_O42202,Player(9)))==true)
endfunction

function Trig_O97661_Func000C takes nothing returns nothing
call DestroyFogModifier(GetLastCreatedFogModifier())
endfunction

function Trig_O97661_Func002C takes nothing returns boolean
if(not(udg_O48120>=2))then
return false
endif
return true
endfunction

function Trig_O97661_Actions takes nothing returns nothing
call DisableTrigger(GetTriggeringTrigger())
set udg_O47978=GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))
call DisplayTimedTextToForce(GetPlayersAll(),10.00,((GetPlayerName(GetOwningPlayer(GetKillingUnitBJ()))+" killed ")+GetUnitName(GetTriggerUnit())))
loop
exitwhen(Trig_O97661_Func001C())
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL,3.00))
endloop
call EndThematicMusicBJ()
call StopMusicBJ(false)
call RemoveWeatherEffectBJ(GetLastCreatedWeatherEffect())
call ForForce(GetPlayersAll(),function Trig_O97661_Func000C)
set udg_O23114[udg_O47978]=(udg_O23114[udg_O47978]+750)
call ModifyGateBJ(bj_GATEOPERATION_OPEN,gg_dest_ATg1_0009)
call QuestSetCompleted(udg_O23214[2],true)
call EnableTrigger(gg_trg_O78299)
if(Trig_O97661_Func002C())then
call DisableTrigger(gg_trg_O76211)
call DestroyTrigger(gg_trg_O76211)
else
call DoNothing()
endif
 
Why are all your variable and trigger names obfuscated? That has got to be a nightmare to work with.

Anyways, your trigger will not run because you don't have an init function creating and setting up the trigger.
Should look a little something like this:
JASS:
function InitTrig_O97661 takes nothing returns nothing
    set gg_trg_O97661 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_O97661, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( gg_trg_O97661, function Trig_O97661_Actions )
endfunction
 
Level 8
Joined
Jul 10, 2018
Messages
383
this is Created
function InitTrig_O97661 takes nothing returns nothing
set gg_trg_O97661=CreateTrigger()
call DisableTrigger(gg_trg_O97661)
call TriggerRegisterUnitEvent(gg_trg_O97661,gg_unit_Nmag_0012,EVENT_UNIT_DEATH)
call TriggerAddAction(gg_trg_O97661,function Trig_O97661_Actions)
endfunction
sorry i didin't include it


Here's the Full Jass Script:
Code:
function Trig_O97661_Func001C takes nothing returns boolean
return(IsUnitGroupEmptyBJ(GetUnitsInRectOfPlayer(gg_rct_O42202,Player(9)))==true)
endfunction

function Trig_O97661_Func000C takes nothing returns nothing
call DestroyFogModifier(GetLastCreatedFogModifier())
endfunction

function Trig_O97661_Func002C takes nothing returns boolean
if(not(udg_O48120>=2))then
return false
endif
return true
endfunction

function Trig_O97661_Actions takes nothing returns nothing
call DisableTrigger(GetTriggeringTrigger())
set udg_O47978=GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))
call DisplayTimedTextToForce(GetPlayersAll(),10.00,((GetPlayerName(GetOwningPlayer(GetKillingUnitBJ()))+" killed ")+GetUnitName(GetTriggerUnit())))
loop
exitwhen(Trig_O97661_Func001C())
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL,3.00))
endloop
call EndThematicMusicBJ()
call StopMusicBJ(false)
call RemoveWeatherEffectBJ(GetLastCreatedWeatherEffect())
call ForForce(GetPlayersAll(),function Trig_O97661_Func000C)
set udg_O23114[udg_O47978]=(udg_O23114[udg_O47978]+750)
call ModifyGateBJ(bj_GATEOPERATION_OPEN,gg_dest_ATg1_0009)
call QuestSetCompleted(udg_O23214[2],true)
call EnableTrigger(gg_trg_O78299)
if(Trig_O97661_Func002C())then
call DisableTrigger(gg_trg_O76211)
call DestroyTrigger(gg_trg_O76211)
else
call DoNothing()
endif
call DestroyTrigger(GetTriggeringTrigger())
endfunction

function InitTrig_O97661 takes nothing returns nothing
set gg_trg_O97661=CreateTrigger()
call DisableTrigger(gg_trg_O97661)
call TriggerRegisterUnitEvent(gg_trg_O97661,gg_unit_Nmag_0012,EVENT_UNIT_DEATH)
call TriggerAddAction(gg_trg_O97661,function Trig_O97661_Actions)
endfunction
 
Last edited:
Use jass tags when posting JASS code:
[code=jass]Code goes here[/code]

call DisableTrigger(gg_trg_O97661)
You are disabling the trigger immediately after creating it.
Unless you're enabling it again from somewhere else, the trigger cannot run when the unit dies.
Illidan(Evil)X said:
Why are all your variable and trigger names obfuscated?
 
The action
  • Trigger - Turn off (<SomeTrigger>)
is equivalent of calling the native
DisableTrigger(<SomeTrigger>)
in JASS.

You are disabling the trigger right after creating it in your InitTrig function.
Therefore, unless you remove that line or re-enable it (turn it on) somewhere before the unit dies, the trigger simply won't run.
Illidan(Evil)X said:
Why are all your variable and trigger names obfuscated?
 
Level 8
Joined
Jul 10, 2018
Messages
383
The action
  • Trigger - Turn off (<SomeTrigger>)
is equivalent of calling the native
DisableTrigger(<SomeTrigger>)
in JASS.

You are disabling the trigger right after creating it in your InitTrig function.
Therefore, unless you remove that line or re-enable it (turn it on) somewhere before the unit dies, the trigger simply won't run.
So i removed the Disable Trigger now all my Triggers and Functions don't work as they used to? i mean Entering a region won't put me where i'm supposed to.Just the regions Rest of the Triggers aren't affected.
 
What exactly did you do? Removing this one line of code should not break your map.
Replace your code with this:
JASS:
function Trig_O97661_Func001C takes nothing returns boolean
    return (IsUnitGroupEmptyBJ(GetUnitsInRectOfPlayer(gg_rct_O42202, Player(9))) == true)
endfunction

function Trig_O97661_Func000C takes nothing returns nothing
    call DestroyFogModifier(GetLastCreatedFogModifier())
endfunction

function Trig_O97661_Func002C takes nothing returns boolean
    if (not(udg_O48120 >= 2)) then
        return false
    endif
    return true
endfunction

function Trig_O97661_Actions takes nothing returns nothing
    call DisableTrigger(GetTriggeringTrigger())
    set udg_O47978=GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))
    call DisplayTimedTextToForce(GetPlayersAll(), 10.00, ((GetPlayerName(GetOwningPlayer(GetKillingUnitBJ())) + " killed ")+GetUnitName(GetTriggerUnit())))
    loop
        exitwhen(Trig_O97661_Func001C())
        call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 3.00))
    endloop
    call EndThematicMusicBJ()
    call StopMusicBJ(false)
    call RemoveWeatherEffectBJ(GetLastCreatedWeatherEffect())
    call ForForce(GetPlayersAll(), function Trig_O97661_Func000C)
    set udg_O23114[udg_O47978] = (udg_O23114[udg_O47978] + 750)
    call ModifyGateBJ(bj_GATEOPERATION_OPEN, gg_dest_ATg1_0009)
    call QuestSetCompleted(udg_O23214[2], true)
    call EnableTrigger(gg_trg_O78299)
    if (Trig_O97661_Func002C()) then
        call DisableTrigger(gg_trg_O76211)
        call DestroyTrigger(gg_trg_O76211)
    else
        call DoNothing()
    endif
    call DestroyTrigger(GetTriggeringTrigger())
endfunction

function InitTrig_O97661 takes nothing returns nothing
    set gg_trg_O97661 = CreateTrigger()
    //call DisableTrigger(gg_trg_O97661)
    call TriggerRegisterUnitEvent(gg_trg_O97661, gg_unit_Nmag_0012, EVENT_UNIT_DEATH)
    call TriggerAddAction(gg_trg_O97661, function Trig_O97661_Actions)
endfunction
Also, what's up with these variable and trigger names?
 
Level 8
Joined
Jul 10, 2018
Messages
383
What exactly did you do? Removing this one line of code should not break your map.
Replace your code with this:
JASS:
function Trig_O97661_Func001C takes nothing returns boolean
    return (IsUnitGroupEmptyBJ(GetUnitsInRectOfPlayer(gg_rct_O42202, Player(9))) == true)
endfunction

function Trig_O97661_Func000C takes nothing returns nothing
    call DestroyFogModifier(GetLastCreatedFogModifier())
endfunction

function Trig_O97661_Func002C takes nothing returns boolean
    if (not(udg_O48120 >= 2)) then
        return false
    endif
    return true
endfunction

function Trig_O97661_Actions takes nothing returns nothing
    call DisableTrigger(GetTriggeringTrigger())
    set udg_O47978=GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))
    call DisplayTimedTextToForce(GetPlayersAll(), 10.00, ((GetPlayerName(GetOwningPlayer(GetKillingUnitBJ())) + " killed ")+GetUnitName(GetTriggerUnit())))
    loop
        exitwhen(Trig_O97661_Func001C())
        call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 3.00))
    endloop
    call EndThematicMusicBJ()
    call StopMusicBJ(false)
    call RemoveWeatherEffectBJ(GetLastCreatedWeatherEffect())
    call ForForce(GetPlayersAll(), function Trig_O97661_Func000C)
    set udg_O23114[udg_O47978] = (udg_O23114[udg_O47978] + 750)
    call ModifyGateBJ(bj_GATEOPERATION_OPEN, gg_dest_ATg1_0009)
    call QuestSetCompleted(udg_O23214[2], true)
    call EnableTrigger(gg_trg_O78299)
    if (Trig_O97661_Func002C()) then
        call DisableTrigger(gg_trg_O76211)
        call DestroyTrigger(gg_trg_O76211)
    else
        call DoNothing()
    endif
    call DestroyTrigger(GetTriggeringTrigger())
endfunction

function InitTrig_O97661 takes nothing returns nothing
    set gg_trg_O97661 = CreateTrigger()
    //call DisableTrigger(gg_trg_O97661)
    call TriggerRegisterUnitEvent(gg_trg_O97661, gg_unit_Nmag_0012, EVENT_UNIT_DEATH)
    call TriggerAddAction(gg_trg_O97661, function Trig_O97661_Actions)
endfunction
Also, what's up with these variable and trigger names?
Putting // won't solve the Problem,The trigger wasn't functioning well so i had to disable it and make it into a GUI, as for the The names That's another story.
 
Level 8
Joined
Jul 10, 2018
Messages
383
Then you're going to have to be more specific.
In your original post you made it sound like the trigger didn't run.
Do tell. I'm very curious as to why you've done this to yourself.
Well i didin't do this, There's a tool made by my friends that Make similar Scripts from maps by using only The war3.j it will copy the scripts and make similar to your maps but doesn't name them after your or that will cause the map be corrupted and get all Scripts to lose it's proper Functions thats include Items/Units as for the tool they decide when to release it or not not my CONCERN.it's not Private i think
It's basically like Deprotection tool except it doesn't include that many Resources from the map itself

But actually it turned out to be CRAP you need to make your own map from the Scrap in order to know things how it works and how it meant to work when it's not working i will start my own project coz this one didin't turn out to be good.
 
Last edited:
Status
Not open for further replies.
Top