• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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
 
Status
Not open for further replies.
Top