• 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.

Requires issue

Status
Not open for further replies.
Scopes are inherently libraries that require all other libraries, so to speak. Assuming that, one would not need to append a requires keyword after a scope, since they would end up being required in the first place.

Do note that the definition of a scope in vJASS isn't exactly what I defined it to be, but how it behaves in the context of the compiler.

Now, for goldmineIncome, I am assuming it isn't a library, since the details surrounding that are unclear.
 
Level 12
Joined
Dec 2, 2016
Messages
733
Scopes are inherently libraries that require all other libraries, so to speak. Assuming that, one would not need to append a requires keyword after a scope, since they would end up being required in the first place.

Do note that the definition of a scope in vJASS isn't exactly what I defined it to be, but how it behaves in the context of the compiler.

Now, for goldmineIncome, I am assuming it isn't a library, since the details surrounding that are unclear.

goldmineIncome is a library



JASS:
library goldmineIncome requires libMisc, utilsGameplay, libSetup {

 public integer gameMinutes=1;
public function OnTimer60EXPBalance() {

  gameMinutes = gameMinutes + 1;
}


private function OnGameStarted() -> boolean {
  integer i;
 TimerStart(CreateTimer(), 60, true, function OnTimer60EXPBalance);
  return false;
}

private function onInit() {
  trigger trg = TriggerCreateOnGameStart();
  TriggerAddCondition(trg, Condition(function OnGameStarted));
}


}



This is the full other script that requires goldmineIncome

JASS:
scope spawnHellHounds initializer activate requires goldmineIncome
//initializer OnInit

globals

public trigger spawner
integer hellDamage = 5
endglobals





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


function spawnHell takes nothing returns nothing

    if ( checker() ) then
        call CreateNUnitsAtLocFacingLocBJ( 1, 'n008', GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), GetSpellTargetLoc() )
        call AddSpecialEffectTargetUnitBJ( "head", GetLastCreatedUnit(), "Environment\\LargeBuildingFire\\LargeBuildingFire2.mdl" )
        call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", GetSpellTargetLoc() )
        set udg_TempPoint = GetSpellTargetLoc()
        call UnitApplyTimedLifeBJ( 5.00, 'BTLF', GetLastCreatedUnit() )
       call ClearSelectionForPlayer( GetOwningPlayer(GetTriggerUnit()) )
       call SelectUnitAddForPlayer( GetLastCreatedUnit(), GetOwningPlayer(GetTriggerUnit()) )
        call RemoveLocation(udg_TempPoint)
       
       // Below applies damage abilities scaling upon gametime
       if (gameMinutes > 18 and gameMinutes <24) then
       call UnitAddAbilityBJ( 'A048', GetTriggerUnit() )
       elseif (gameMinutes > 18 and gameMinutes <24) then
       call UnitAddAbilityBJ( 'A049', GetTriggerUnit() )
       elseif (gameMinutes > 24) then
       call UnitAddAbilityBJ( 'A04A', GetTriggerUnit() )
       endif
       //call BlzSetUnitBaseDamage( GetLastCreatedUnit(), 1000*hellDamage, 0 )
    else
    endif
endfunction




function activate takes nothing returns nothing
    set spawner = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(spawner, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
    call TriggerAddAction(spawner, function spawnHell)
endfunction






endscope
 
Level 12
Joined
Dec 2, 2016
Messages
733
From my experience, and what I implied from the statement above, you don't need a requires goldmineIncome statement in your scope.

So, the script goes from this:

JASS:
scope spawnHellHounds initializer active requires goldmineIncome

to this:

JASS:
scope spawnHellHounds initializer activate
Oh ok thanks!
 
Status
Not open for further replies.
Top