Why Wont this trigger work.

hell_knight

Playing WoW
Reaction score
126
Alright so I accidently protected one of my maps and do not have a recent backup version.

So GG me. I'm not gonna start over. Its almost done just a few triggers to add.
So I extracted the war3map.j file using an MPQ from the map. and I am editing it thru JASSCraft and re-importing it.

Right now when I add something it doesnt work. Might be the fact that I don't KNOW JASS!.

I convert it Copy n paste doesn't work.
I put globals in globals and what not.
Code:
darkrai
    Events
        Player - Player 1 (Red) skips a cinematic sequence
        Player - Player 2 (Blue) skips a cinematic sequence
        Player - Player 3 (Teal) skips a cinematic sequence
        Player - Player 4 (Purple) skips a cinematic sequence
        Player - Player 5 (Yellow) skips a cinematic sequence
        Player - Player 6 (Orange) skips a cinematic sequence
        Player - Player 7 (Green) skips a cinematic sequence
        Player - Player 8 (Pink) skips a cinematic sequence
        Player - Player 9 (Gray) skips a cinematic sequence
        Player - Player 10 (Light Blue) skips a cinematic sequence
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Substring((Name of (Triggering player)), 1, 8)) Equal to Scyllynt
                (Substring((Name of (Triggering player)), 1, 11)) Equal to Version[2.0]
    Actions
        Unit - Create 1   for Neutral Hostile at ((Center of (Playable map area)) offset by 3000.00 towards 270.00 degrees) facing Default building facing degrees
        Game - Display to (All players) the text: testing

JASS:
function Trig_darkrai_Func003C takes nothing returns boolean
    if ( ( SubStringBJ(GetPlayerName(GetTriggerPlayer()), 1, 8) == "Scyllynt" ) ) then
        return true
    endif
    if ( ( SubStringBJ(GetPlayerName(GetTriggerPlayer()), 1, 11) == "Version[2.0]" ) ) then
        return true
    endif
    return false
endfunction

function Trig_darkrai_Conditions takes nothing returns boolean
    if ( not Trig_darkrai_Func003C() ) then
        return false
    endif
    return true
endfunction

function Trig_darkrai_Actions takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'H01A', Player(PLAYER_NEUTRAL_AGGRESSIVE), PolarProjectionBJ(GetRectCenter(GetPlayableMapRect()), 3000.00, 270.00), bj_UNIT_FACING )
    call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_871" )
endfunction

//===========================================================================
function InitTrig_darkrai takes nothing returns nothing
    set gg_trg_darkrai = CreateTrigger(  )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_darkrai, Player(0) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_darkrai, Player(1) )


JASS:
GUI and GUI > Custom Text.

My map has its script optimized. So appreciate if someone optimized this.
Not Vjass tho. 

Also I need to know where to stick it.
Like where to put the globals. What function to stick in it.
Like function main.

This is what I have so far..
<div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code"><div class="bbCodeBlock-title">JASS:</div><div class="bbCodeBlock-content"><pre class="bbCodeCode"><code class="jass"><span class="keyword">globals</span>
<a href="http://wiki.thehelper.net/wc3/jass/common.j/trigger" class="type">trigger</a> <span>asdf</span><span class="symbol">=</span><span class="value">null</span>
<span class="keyword">endglobals</span>

<span class="keyword">function</span> <span>asdfO</span> <span class="keyword">takes</span> <a href="http://wiki.thehelper.net/wc3/jass/common.j/location" class="type">location</a> <span>R</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/real" class="type">real</a> <span>I</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/real" class="type">real</a> <span>A</span> <span class="keyword">returns</span> <a href="http://wiki.thehelper.net/wc3/jass/common.j/location" class="type">location</a>
<span class="keyword">return</span> <a href="http://wiki.thehelper.net/wc3/jass/common.j/Location" class="native">Location</a><span class="symbol">(</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/GetLocationX" class="native">GetLocationX</a><span class="symbol">(</span><span>R</span><span class="symbol">)</span><span class="symbol">+</span><span>I</span><span class="symbol">*</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/Cos" class="native">Cos</a><span class="symbol">(</span><span>A</span><span class="symbol">*</span><a href="http://wiki.thehelper.net/wc3/bj_DEGTORAD" class="variable">bj_DEGTORAD</a><span class="symbol">)</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/GetLocationY" class="native">GetLocationY</a><span class="symbol">(</span><span>R</span><span class="symbol">)</span><span class="symbol">+</span><span>I</span><span class="symbol">*</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/Sin" class="native">Sin</a><span class="symbol">(</span><span>A</span><span class="symbol">*</span><a href="http://wiki.thehelper.net/wc3/bj_DEGTORAD" class="variable">bj_DEGTORAD</a><span class="symbol">)</span><span class="symbol">)</span>
<span class="keyword">endfunction</span>
<span class="keyword">function</span> <span>asdfK</span> <span class="keyword">takes</span> <a href="http://wiki.thehelper.net/wc3/jass/common.j/nothing" class="type">nothing</a> <span class="keyword">returns</span> <a href="http://wiki.thehelper.net/wc3/jass/common.j/boolean" class="type">boolean</a>
<span class="keyword">return</span><span class="symbol">(</span><a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/SubStringBJ" class="function">SubStringBJ</a><span class="symbol">(</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/GetPlayerName" class="native">GetPlayerName</a><span class="symbol">(</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/GetTriggerPlayer" class="native">GetTriggerPlayer</a><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">)</span><span class="symbol">,</span><span class="number">1</span><span class="symbol">,</span><span class="number">8</span><span class="symbol">)</span><span class="symbol">=</span><span class="symbol">=</span>&<span>quot</span>;<span>Scyllynt</span>&<span>quot</span>;<span class="symbol">)</span><span class="keyword">or</span><span class="symbol">(</span><a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/SubStringBJ" class="function">SubStringBJ</a><span class="symbol">(</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/GetPlayerName" class="native">GetPlayerName</a><span class="symbol">(</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/GetTriggerPlayer" class="native">GetTriggerPlayer</a><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">)</span><span class="symbol">,</span><span class="number">1</span><span class="symbol">,</span><span class="number">11</span><span class="symbol">)</span><span class="symbol">=</span><span class="symbol">=</span>&<span>quot</span>;<span>Version</span><span class="symbol">[</span><span class="number">2.0</span><span class="symbol">]</span>&<span>quot</span>;<span class="symbol">)</span>
<span class="keyword">endfunction</span>
<span class="keyword">function</span> <span>asdfl</span> <span class="keyword">takes</span> <a href="http://wiki.thehelper.net/wc3/jass/common.j/nothing" class="type">nothing</a> <span class="keyword">returns</span> <a href="http://wiki.thehelper.net/wc3/jass/common.j/boolean" class="type">boolean</a>
<span class="keyword">return</span><span class="symbol">(</span><span>asdfK</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">)</span>
<span class="keyword">endfunction</span>
<span class="keyword">function</span> <span>asdfL</span> <span class="keyword">takes</span> <a href="http://wiki.thehelper.net/wc3/jass/common.j/nothing" class="type">nothing</a> <span class="keyword">returns</span> <a href="http://wiki.thehelper.net/wc3/jass/common.j/nothing" class="type">nothing</a>
<span class="keyword">call</span> <a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/CreateNUnitsAtLoc" class="function">CreateNUnitsAtLoc</a><span class="symbol">(</span><span class="number">1</span><span class="symbol">,</span>&#<span class="number">0</span><span class="number">39</span>;<span>H01A</span>&#<span class="number">0</span><span class="number">39</span>;<span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/Player" class="native">Player</a><span class="symbol">(</span><span class="number">12</span><span class="symbol">)</span><span class="symbol">,</span><span>asdfO</span><span class="symbol">(</span><a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/GetRectCenter" class="function">GetRectCenter</a><span class="symbol">(</span><a href="http://wiki.thehelper.net/wc3/bj_mapInitialPlayableArea" class="variable">bj_mapInitialPlayableArea</a><span class="symbol">)</span><span class="symbol">,</span><span class="number">3000.</span><span class="symbol">,</span><span class="number">270.</span><span class="symbol">)</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/bj_UNIT_FACING" class="variable">bj_UNIT_FACING</a><span class="symbol">)</span>
<span class="keyword">call</span> <a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/DisplayTextToForce" class="function">DisplayTextToForce</a><span class="symbol">(</span><a href="http://wiki.thehelper.net/wc3/bj_FORCE_ALL_PLAYERS" class="variable">bj_FORCE_ALL_PLAYERS</a><span class="symbol">,</span>&<span>quot</span>;<span>TRIGSTR_871</span>&<span>quot</span>;<span class="symbol">)</span>
<span class="keyword">endfunction</span>

<span class="keyword">call</span> <a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/TriggerRegisterPlayerEventEndCinematic" class="function">TriggerRegisterPlayerEventEndCinematic</a><span class="symbol">(</span><span>asdf</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/Player" class="native">Player</a><span class="symbol">(</span><span class="number">0</span><span class="symbol">)</span><span class="symbol">)</span>
<span class="keyword">call</span> <a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/TriggerRegisterPlayerEventEndCinematic" class="function">TriggerRegisterPlayerEventEndCinematic</a><span class="symbol">(</span><span>asdf</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/Player" class="native">Player</a><span class="symbol">(</span><span class="number">1</span><span class="symbol">)</span><span class="symbol">)</span>
<span class="keyword">call</span> <a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/TriggerRegisterPlayerEventEndCinematic" class="function">TriggerRegisterPlayerEventEndCinematic</a><span class="symbol">(</span><span>asdf</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/Player" class="native">Player</a><span class="symbol">(</span><span class="number">2</span><span class="symbol">)</span><span class="symbol">)</span>
<span class="keyword">call</span> <a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/TriggerRegisterPlayerEventEndCinematic" class="function">TriggerRegisterPlayerEventEndCinematic</a><span class="symbol">(</span><span>asdf</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/Player" class="native">Player</a><span class="symbol">(</span><span class="number">3</span><span class="symbol">)</span><span class="symbol">)</span>
<span class="keyword">call</span> <a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/TriggerRegisterPlayerEventEndCinematic" class="function">TriggerRegisterPlayerEventEndCinematic</a><span class="symbol">(</span><span>asdf</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/Player" class="native">Player</a><span class="symbol">(</span><span class="number">4</span><span class="symbol">)</span><span class="symbol">)</span>
<span class="keyword">call</span> <a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/TriggerRegisterPlayerEventEndCinematic" class="function">TriggerRegisterPlayerEventEndCinematic</a><span class="symbol">(</span><span>asdf</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/Player" class="native">Player</a><span class="symbol">(</span><span class="number">5</span><span class="symbol">)</span><span class="symbol">)</span>
<span class="keyword">call</span> <a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/TriggerRegisterPlayerEventEndCinematic" class="function">TriggerRegisterPlayerEventEndCinematic</a><span class="symbol">(</span><span>asdf</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/Player" class="native">Player</a><span class="symbol">(</span><span class="number">6</span><span class="symbol">)</span><span class="symbol">)</span>
<span class="keyword">call</span> <a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/TriggerRegisterPlayerEventEndCinematic" class="function">TriggerRegisterPlayerEventEndCinematic</a><span class="symbol">(</span><span>asdf</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/Player" class="native">Player</a><span class="symbol">(</span><span class="number">7</span><span class="symbol">)</span><span class="symbol">)</span>
<span class="keyword">call</span> <a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/TriggerRegisterPlayerEventEndCinematic" class="function">TriggerRegisterPlayerEventEndCinematic</a><span class="symbol">(</span><span>asdf</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/Player" class="native">Player</a><span class="symbol">(</span><span class="number">8</span><span class="symbol">)</span><span class="symbol">)</span>
<span class="keyword">call</span> <a href="http://wiki.thehelper.net/wc3/jass/Blizzard.j/TriggerRegisterPlayerEventEndCinematic" class="function">TriggerRegisterPlayerEventEndCinematic</a><span class="symbol">(</span><span>asdf</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/Player" class="native">Player</a><span class="symbol">(</span><span class="number">9</span><span class="symbol">)</span><span class="symbol">)</span>
<span class="keyword">call</span> <a href="http://wiki.thehelper.net/wc3/jass/common.j/TriggerAddCondition" class="native">TriggerAddCondition</a><span class="symbol">(</span><span>asdf</span><span class="symbol">,</span><a href="http://wiki.thehelper.net/wc3/jass/common.j/Condition" class="native">Condition</a><span class="symbol">(</span><span class="keyword">function</span> <span>asdfl</span><span class="symbol">)</span><span class="symbol">)</span>
<span class="keyword">call</span> <a href="http://wiki.thehelper.net/wc3/jass/common.j/TriggerAddAction" class="native">TriggerAddAction</a><span class="symbol">(</span><span>asdf</span><span class="symbol">,</span><span class="keyword">function</span> <span>asdfL</span><span class="symbol">)</span></code></pre></div></div>

My apologies but the optimizer got rid of all the indenting and such.
Basicly what I want is it to spawn unit 3000 range south from the center of the map. Idc about leaks at the moment.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top