Lightstalker
New Member
- Reaction score
- 55
1) I'm trying to pick all units of type X and change their ownership to Neutral Extra, but for some strange reason, it is not working.
2) All my quests info are indented... Take this for example:
When in-game, the first line is OK, but every line thereafter is indented.
3) The following trigger is supposed to give gold to players based on how many allied players are on their team:
For some reason, the gold added is always different...
JASS:
private function ChangeOwnership takes nothing returns boolean
local unit u = GetEnumUnit()
call BJDebugMsg(GetUnitName(u))
if GetUnitTypeId(u) == ARMORY or GetUnitTypeId(u) == MARKETPLACE then
call SetUnitOwner(u, Player(bj_PLAYER_NEUTRAL_EXTRA), false)
endif
set u = null
return false
endfunction
private function Init takes nothing returns nothing
call GroupEnumUnitsOfPlayer(TEMPGROUP, Player(PLAYER_NEUTRAL_PASSIVE), Condition(function ChangeOwnership))
endfunction
2) All my quests info are indented... Take this for example:
JASS:
//CREDITS
set q = CreateQuest()
call QuestSetTitle(q, "Credits")
call QuestSetDescription(q, "|cffFFCC00Denu|r: Behemoth skin
|cffFFCC00General Frank|r: Bloodlord, Dragonlord, & Chaos Knight models
|cffFFCC00jigrael|r: Skeletal Archer King model
|cffFFCC00Norinrad|r: High-Elven Champion, Shield Master, & Battle Priest models
|cffFFCC00Sephiroth_VII|r: Dark Mage model & icon
|cffFFCC00unwirklich|r: Enhanced Attributes icons
|nVisit |cff7777AATHUNDERPOWERstudios.co.cc|r for news, strategy guides, and more--all about THUNDERPOWER039;s maps!")
call QuestSetIconPath(q, "ReplaceableTextures\\CommandButtons\\BTNMassTeleport.blp")
call QuestSetRequired(q, false)
call QuestSetDiscovered(q, true)
call QuestSetCompleted(q, false)
set q = null
When in-game, the first line is OK, but every line thereafter is indented.
3) The following trigger is supposed to give gold to players based on how many allied players are on their team:
JASS:
scope Income initializer Init
globals
force INCOMEFORCE = CreateForce()
integer PLAYERAMOUNT = -1
endglobals
private function CountPlayers takes nothing returns nothing
set PLAYERAMOUNT = PLAYERAMOUNT + 1
endfunction
private function PickPlayers takes nothing returns nothing
local player p = GetEnumPlayer()
call ForceEnumAllies(bj_FORCE_ALL_PLAYERS, p, Condition(function True))
call ForForce(INCOMEFORCE, function CountPlayers)
call SetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD) + 500 / PLAYERAMOUNT)
endfunction
private function Actions takes nothing returns nothing
call ForForce(INCOMEFORCE, function PickPlayers)
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t, 15.0, true)
call TriggerAddAction(t, function Actions)
endfunction
endscope
For some reason, the gold added is always different...