Even if all settings are set to "never" the Phantom will be revealed.
Tested twice.
Forged Alliance Forever Forums
function PhantomMainThread()
# cur.config.declare = ScenarioInfo.Options.PhantomDeclareTime
# cur.config.vote = cur.config.declare - (1 * 60)
#Bugfix #1: Removed cummulative addition of reveal times
cur.config.reveal1 = (tonumber(ScenarioInfo.Options.PhantomRevealTime1) * 60)
cur.config.reveal2 = (tonumber(ScenarioInfo.Options.PhantomRevealTime2) * 60)
cur.config.reveal3 = (tonumber(ScenarioInfo.Options.PhantomRevealTime3) * 60)
#Old Code
#cur.config.reveal1 = cur.config.declare + (tonumber(ScenarioInfo.Options.PhantomRevealTime1) * 60)
#cur.config.reveal2 = cur.config.reveal1 + (tonumber(ScenarioInfo.Options.PhantomRevealTime2) * 60)
#cur.config.reveal3 = cur.config.reveal2 + (tonumber(ScenarioInfo.Options.PhantomRevealTime3) * 60)
...original function continues...
function DoneShowingPhantoms(cnt)
if(cnt == 0) then
Sync.pAlert("All Phantoms have been revealed.")
end
if(cnt == 1) then
Sync.pAlert("Revealable Phantoms are now known. One more remains hidden.")
else
Sync.pAlert("Revealable Phantoms are now known. "..cnt.." more remain hidden.")
end
end
function PhantomRevealThread()
LOG('starting phantom reveal thread')
# WaitSeconds(cur.config.reveal1)
pRevealed = {
phant1 = nil,
phant2 = nil,
phant3 = nil
}
local maxPhants = table.getn(cur.phantoms)
#BugFix 2: Rearranged reveal logic to correctly handle all scenarios
#Assumptions: Once we encounter a reveal time of zero, it is assumed that all revelations are done.
# i.e. If phantom 1's reveal time is Never, then phantoms 2 and 3 will not be revealed either.
#Build a table to use in our loop
local revealtimes = {}
revealtimes[1] = cur.config.reveal1
revealtimes[2] = cur.config.reveal2
revealtimes[3] = cur.config.reveal3
for index, p in cur.phantoms do
#If reveal time is "never", break from this thread...
if(revealtimes[index] == 0) then
DoneShowingPhantoms(maxPhants - index + 1)
do return end
else
WaitSeconds(revealtimes[index])
Sync.pAlert = { ArmyBrains[p].Nickname.." is a phantom!", "KILL HIM." }
LOG('revealed phantom: ', ArmyBrains[p].Nickname)
end
if(index == 1) then
pRevealed.phant1 = ArmyBrains[p].Nickname
end
if(index == 2) then
pRevealed.phant2 = ArmyBrains[p].Nickname
end
if(index == 3) then
pRevealed.phant3 = ArmyBrains[p].Nickname
end
Sync.pRevealed = pRevealed
LOG('syncing from sim')
end
WaitSeconds(10)
Sync.pAlert("All Phantoms have been revealed.")
end
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
Ze_PilOt wrote:If you want something to happen, do it yourself.
Users browsing this forum: No registered users and 1 guest