Author Topic: Common coding tasks  (Read 2157 times)

0 Members and 1 Guest are viewing this topic.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Common coding tasks
« Reply #30 on: May 19, 2012, 12:43:17 AM »


Excellent :>

We can use that instead of IsiOS() then.. and it will work on both platforms. :>

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Common coding tasks
« Reply #31 on: May 19, 2012, 12:54:34 AM »
I'm going to test that in one of my levels now then :D change all the ISiOS() give me a second

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Common coding tasks
« Reply #32 on: May 19, 2012, 01:06:38 AM »
Sir, could you test this out?

Code: [Select]
function LevelSetup()
--SetBackdropColour(8/255,8/255,20/255)
SetBackdropColour(225/255,225/255,225/255)

--Special thanks to Aino, Pilchard123, Alex and Annikk.exe's Guides and Helps, Without them I wouldn't have been inspired to create this custom iPad
--campaign, also obviously, without the Game, none of this would have been possible. The Creator of this level/story is Tomfloria.
--Remember this though when searching through this code, (Aino) :D I am a beginner, and the code might be messy
--But that isn't my concern, if you can clean it up, so that it works exactly the same, then go ahead, and send me
--a PM on the Eufloria Forums at http://www.dyson-game.com/smf/index.php?board=3.0

if IsThIsThisiOS() then
SetMessageDarkMode(true)
end

if IsThIsThisiOS() then
    Globals():Get("Asteroids"):Set("RadiusPowerRule",2)
Globals():Get("Asteroids"):Set("SizeFromEnergy",230)
Globals():Get("Asteroids"):Set("SizeFromStrength",230)
Globals():Get("Asteroids"):Set("SizeFromSpeed",240)
Globals():Get("Asteroids"):Set("MinCoreHealth",75)
Globals():Get("Asteroids"):Set("MaxCoreHealth",350)
Globals():Get("Asteroids"):Set("CoreHealthPowerRule",2.5)
    Globals():Get("Asteroids"):Set("MinSendDistance",3500)
    Globals():Get("Asteroids"):Set("MaxSendDistance",5500)
    Globals():Get("Asteroids"):Set("SendPowerRule",2.0)
Globals():Get("Asteroids"):Set("SpawnCap", 40)

Globals():Get("Structures"):Set("LevelDuration1",15)
Globals():Get("Structures"):Set("LevelDuration2",30)
Globals():Get("Structures"):Set("LevelDuration3",60)
Globals():Get("Structures"):Set("LevelDuration4",100)
Globals():Get("Structures"):Set("SpawnTime1",15)
Globals():Get("Structures"):Set("SpawnTime2",12)
Globals():Get("Structures"):Set("SpawnTime3",10)
Globals():Get("Structures"):Set("SpawnTime4",8)

Globals():Get("Flowers"):Set("Available",0)

Globals():Get("Game"):Set("EnemyFactionsMin",0)
Globals():Get("Game"):Set("EnemyFactionsMax",0)
Globals():Get("Game"):Set("MinAsteroidSeparation",1500)
Globals():Get("Game"):Set("MaxAsteroidNeighbourDist",6000)
Globals():Get("Game"):Set("GreysProbability",0)

else

Globals.G.Asteroids=(0)
Globals.G.EnemyFactionsMin=(0)
Globals.G.EnemyFactionsMax=(0)
end

--0 Starting Asteroid
a = AddAsteroidWithAttribs(5000,2000, math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 1
a.TreeCap = 3
s = a:AddDysonTree()
s = a:AddDysonTree()
a:AddSeedlings(30)
a.Moveable = false

--1
a = AddAsteroidWithAttribs(math.random(-4000,9000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 3
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--2
a = AddAsteroidWithAttribs(math.random(-4000,9000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 2
a:SetGraceTime(1000)
s = a:AddDysonTree()
s = a:AddDefenseTree()
a:AddSeedlings(math.random(20,40))
a.Moveable = true
a:Hide(1)

--3
a = AddAsteroidWithAttribs(math.random(-4000,15000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 3
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--4
a = AddAsteroidWithAttribs(math.random(-4000,15000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 1
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--5
a = AddAsteroidWithAttribs(math.random(-4000,15000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 3
a.Moveable = true
a:SetGraceTime(0)
a:AddSeedlings(math.random(20,40))
s = a:AddDefenseTree()
s:LevelUp()
s:LevelUp()
s = a:AddDefenseTree()
s:LevelUp()
s:LevelUp()
s = a:AddDysonTree()
s:LevelUp()
s:LevelUp()
a:Hide(1)

--6
a = AddAsteroidWithAttribs(math.random(-10000,-3000),math.random(2000,8000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--7
a = AddAsteroidWithAttribs(math.random(-10000,-3000),math.random(2000,8000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--8
a = AddAsteroidWithAttribs(math.random(-10000,-3000),math.random(2000,8000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(2,4)
a.Moveable = true
a:SetGraceTime(4000)
a:AddSeedlings(math.random(20,40))
a:SetRadius(math.random(500,1000))
s = a:AddDefenseTree()
s:LevelUp()
s:LevelUp()
s = a:AddDysonTree()
s:LevelUp()
s:LevelUp()
a:Hide(1)

--9
a = AddAsteroidWithAttribs(math.random(-10000,-3000),math.random(2000,8000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--10
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:SetGraceTime(200)
s = a:AddDysonTree()
s = a:AddDysonTree()
s = a:AddDefenseTree()
a:AddSeedlings(math.random(20,40))
a:Hide(1)

--11
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 1
a.TreeCap = 0
a:SetProtected(true)
s = a:AddDefenseTree()
s = a:AddDefenseTree()
s = a:AddDefenseTree()
a.Moveable = true
a:Hide(1)

--12
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a:SetGraceTime(50)
s = a:AddDefenseTree()
s = a:AddDefenseTree()
s = a:AddDefenseTree()
a:AddSeedlings(math.random(20,40))
a.Moveable = true
a:Hide(1)

--13
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--14
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(3,4)
a.Moveable = true
a:SetGraceTime(200)
s = a:AddDysonTree()
s = a:AddDysonTree()
s = a:AddDefenseTree()
a:AddSeedlings(math.random(20,40))
a:Hide(1)

--15
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--16
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--17  Enemy Sprawl Asteroid
a = AddAsteroidWithAttribs(math.random(-30000,-25000),math.random(-20000,-10000), math.random(10,10) / 10,math.random(10,10) / 10,math.random(10,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 6
a.Moveable = true
a:Hide(1)
a:SetGraceTime(9999999)
a:AddSeedlings(math.random(40,60))
a:SetRadius(1500)

SetDysonTreeButtonAvailable(true)
SetDefenseTreeButtonAvailable(true)
SetFlowerDefenseButtonAvailable(false)
SetFlowerSeederButtonAvailable(false)
SetTerraformingButtonAvailable(false)
SetBeaconButtonAvailable(false)

if IsThIsThisiOS() then
SetEnemyInfoAvailable(true)
SetCoreInfoAvailable(true)
SetAttribsInfoAvailable(true)

SetSpeedSwitchAvailable(true)
SetSendModeScoutAvailable(true)
SetSendModeUnitsSelectorAvailable(true)

SetSendModeButtonAvailable(true)
SetSendModeHoldAvailable(true)
SetSendModeDragAvailable(true)
else
SetTreeInfoAvailable(true)
SetEnemyInfoAvailable(true)
SetCoreInfoAvailable(true)
SetAttribsInfoAvailable(true)
end

SetCameraPosition(5000,2000)

end

function LevelLogic()
StartLevelLogic()

foundAsteroidbarron11 = 0

GetAsteroid(17):AddDysonTree()
GetAsteroid(17):AddDysonTree()
GetAsteroid(17):AddDysonTree()
GetAsteroid(17):AddDefenseTree()
GetAsteroid(17):AddDefenseTree()
GetAsteroid(17):AddDefenseTree()

CheckConditions()
WaitReal(4)
SetBackdropColour(8/255,8/255,20/255)

if IsThIsThisiOS() then -- Offerings
SelectionClear()
WaitReal(2)
SetLevelDim(true)
Message("-Ordered Strike-", true, 1.0, "Top")
WaitMessage(true)
SetLevelDim(false)
else
MessageBox("-Ordered Strike-")
WaitDialog()
end

if IsThIsThisiOS() then -- Use The Seedlings
WaitReal(1)
Message("Use the seedlings I have given you to conquer this belt.", true, 1.0, "Top")
WaitMessage(true)
else
MessageBox("Use the seedlings I have given you to conquer this belt.")
WaitDialog()
end

while foundAsteroidbarron11 == 0 do
CheckConditions()
coroutine.yield()
end

if IsThisiOS() then -- Beacon
WaitReal(1)
Message("You have found an Unstable Asteroid,~Click on any asteroid you own, and press the {u57345} Beacon Button", true, 1.0, "Top")
SetBeaconButtonAvailable(true)
WaitMessage(true)
else
MessageBox("You have found an Unstable Asteroid,~Click on any asteroid you own, and press the {u57345} Beacon Button")
WaitDialog()
end

if IsThisiOS() then -- Beacon Explination
WaitReal(1)
Message("Then Select the Unstable Asteroid~This will send any newly created seedlings to this Asteroid automatically.", true, 1.0, "Top")
SetBeaconButtonAvailable(true)
WaitMessage(true)
else
MessageBox("Then Select the Unstable Asteroid~This will send any newly created seedlings to this Asteroid automatically.")
WaitDialog()
end

while GameRunning() do
CheckConditions()
coroutine.yield()
end

end

function CheckConditions()
if gameFinished then
return
end

if GetEmpire(1):GetNumOwnedAsteroids() == GetNumAsteroids() then
if IsThisiOS() then
GameOver(true, "")
Message("You successfully taken this belt.~Well Done", true, 1.0, "Centre")
WaitMessage(false)
WaitDialog()
Quit(true)
else
MessageBox("You successfully taken this belt.~Well Done")
GameOver(true, "")
Quit(true)
end
end

if GetEmpire(1).NumDysonTrees == 0 and GetEmpire(1).NumSeedlings == 0 then
if IsThisiOS() then
GameOver(false, "")
Message("You have failed to complete the tasks.", true, 1.0, "Centre")
WaitMessage(false)
WaitDialog()
Quit(false)
else
MessageBox("You have failed to complete the tasks.")
GameOver(false, "")
Quit(false)
end
end
end

function OnAsteroidRevealed(id, owner)
if id == 11 then
foundAsteroidbarron11 = 1
end
end

function IsThIsThisiOS()
if GetScreenWidth() == 2048 or GetScreenWidth() == 1024 then
if GetScreenHeight() == 1536 or GetScreenHeight() == 768 then
return true
else
return false
end
else
return false
end
end

It works fine on my iPad

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Common coding tasks
« Reply #33 on: May 19, 2012, 01:13:44 AM »
Also would you mind telling me what the PC version currently offers

Dyson Tree
Defense Tree
Terraforming Tree
Beacon Tree
Flower Pod
Flower Pod that makes Defense Pods
Flower Pod that makes super seedlings (glowing ones)

Just because my Custom Story, actually has a story to it, and it makes use of the features available in the iOS version, if were cross platforming levels from iPad to PC, then I'd have to create another story line, similar but without mentioning certain stuff, which is alright I guess, but annoying :P

BUT! since I know I can do this now, I will update that level that I posted on the forums to be tested, as I really need feedback, I'll do it tomorrow so that it works with PC users properly

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Common coding tasks
« Reply #34 on: May 19, 2012, 01:19:35 AM »
Been looking through my Tower Defense type level, and wanted to ask you a question

Code: [Select]
if IsThisiOS() and stage == 1 then --20 Seedlings, 2 Asteroids, All At Once
WaitReal(25)
GetAsteroid(7):SetGraceTime(0)
GetAsteroid(7):SendSeedlingsToTarget(0,10,GetAsteroid(3))
GetAsteroid(8):SetGraceTime(0)
GetAsteroid(8):SendSeedlingsToTarget(0,10,GetAsteroid(4))
GetAsteroid(7):SetGraceTime(99999999)
GetAsteroid(8):SetGraceTime(99999999)
WaitReal(1)
stage = 2
else
--NEEDS EDITING FOR PC VERSION, NEED TO CREATE DELAY WHICH MATCHES WaitReal(25)
end

How would I make a similar delay WaitReal(25) for PC?

or should I just paste this at the bottom?

Code: [Select]
function WaitReal(t)
t = t + GetRealTime()
while GetRealTime() < t do
CheckConditions()
coroutine.yield()
end
end

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: Common coding tasks
« Reply #35 on: May 19, 2012, 09:01:07 AM »
I hate to keep telling you that you've overkilled some stuff, but that IsThisiOS() function is a little big and unwieldy, surely? It also makes some nasty assumptions. Does the crash-prevention stuff that I posted somewhere work?

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Common coding tasks
« Reply #36 on: May 23, 2012, 10:09:07 AM »
Sir, could you test this out?

Code: [Select]
function LevelSetup()
--SetBackdropColour(8/255,8/255,20/255)
SetBackdropColour(225/255,225/255,225/255)

--Special thanks to Aino, Pilchard123, Alex and Annikk.exe's Guides and Helps, Without them I wouldn't have been inspired to create this custom iPad
--campaign, also obviously, without the Game, none of this would have been possible. The Creator of this level/story is Tomfloria.
--Remember this though when searching through this code, (Aino) :D I am a beginner, and the code might be messy
--But that isn't my concern, if you can clean it up, so that it works exactly the same, then go ahead, and send me
--a PM on the Eufloria Forums at http://www.dyson-game.com/smf/index.php?board=3.0

if IsThIsThisiOS() then
SetMessageDarkMode(true)
end

if IsThIsThisiOS() then
    Globals():Get("Asteroids"):Set("RadiusPowerRule",2)
Globals():Get("Asteroids"):Set("SizeFromEnergy",230)
Globals():Get("Asteroids"):Set("SizeFromStrength",230)
Globals():Get("Asteroids"):Set("SizeFromSpeed",240)
Globals():Get("Asteroids"):Set("MinCoreHealth",75)
Globals():Get("Asteroids"):Set("MaxCoreHealth",350)
Globals():Get("Asteroids"):Set("CoreHealthPowerRule",2.5)
    Globals():Get("Asteroids"):Set("MinSendDistance",3500)
    Globals():Get("Asteroids"):Set("MaxSendDistance",5500)
    Globals():Get("Asteroids"):Set("SendPowerRule",2.0)
Globals():Get("Asteroids"):Set("SpawnCap", 40)

Globals():Get("Structures"):Set("LevelDuration1",15)
Globals():Get("Structures"):Set("LevelDuration2",30)
Globals():Get("Structures"):Set("LevelDuration3",60)
Globals():Get("Structures"):Set("LevelDuration4",100)
Globals():Get("Structures"):Set("SpawnTime1",15)
Globals():Get("Structures"):Set("SpawnTime2",12)
Globals():Get("Structures"):Set("SpawnTime3",10)
Globals():Get("Structures"):Set("SpawnTime4",8)

Globals():Get("Flowers"):Set("Available",0)

Globals():Get("Game"):Set("EnemyFactionsMin",0)
Globals():Get("Game"):Set("EnemyFactionsMax",0)
Globals():Get("Game"):Set("MinAsteroidSeparation",1500)
Globals():Get("Game"):Set("MaxAsteroidNeighbourDist",6000)
Globals():Get("Game"):Set("GreysProbability",0)

else

Globals.G.Asteroids=(0)
Globals.G.EnemyFactionsMin=(0)
Globals.G.EnemyFactionsMax=(0)
end

--0 Starting Asteroid
a = AddAsteroidWithAttribs(5000,2000, math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 1
a.TreeCap = 3
s = a:AddDysonTree()
s = a:AddDysonTree()
a:AddSeedlings(30)
a.Moveable = false

--1
a = AddAsteroidWithAttribs(math.random(-4000,9000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 3
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--2
a = AddAsteroidWithAttribs(math.random(-4000,9000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 2
a:SetGraceTime(1000)
s = a:AddDysonTree()
s = a:AddDefenseTree()
a:AddSeedlings(math.random(20,40))
a.Moveable = true
a:Hide(1)

--3
a = AddAsteroidWithAttribs(math.random(-4000,15000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 3
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--4
a = AddAsteroidWithAttribs(math.random(-4000,15000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 1
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--5
a = AddAsteroidWithAttribs(math.random(-4000,15000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 3
a.Moveable = true
a:SetGraceTime(0)
a:AddSeedlings(math.random(20,40))
s = a:AddDefenseTree()
s:LevelUp()
s:LevelUp()
s = a:AddDefenseTree()
s:LevelUp()
s:LevelUp()
s = a:AddDysonTree()
s:LevelUp()
s:LevelUp()
a:Hide(1)

--6
a = AddAsteroidWithAttribs(math.random(-10000,-3000),math.random(2000,8000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--7
a = AddAsteroidWithAttribs(math.random(-10000,-3000),math.random(2000,8000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--8
a = AddAsteroidWithAttribs(math.random(-10000,-3000),math.random(2000,8000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(2,4)
a.Moveable = true
a:SetGraceTime(4000)
a:AddSeedlings(math.random(20,40))
a:SetRadius(math.random(500,1000))
s = a:AddDefenseTree()
s:LevelUp()
s:LevelUp()
s = a:AddDysonTree()
s:LevelUp()
s:LevelUp()
a:Hide(1)

--9
a = AddAsteroidWithAttribs(math.random(-10000,-3000),math.random(2000,8000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--10
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:SetGraceTime(200)
s = a:AddDysonTree()
s = a:AddDysonTree()
s = a:AddDefenseTree()
a:AddSeedlings(math.random(20,40))
a:Hide(1)

--11
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 1
a.TreeCap = 0
a:SetProtected(true)
s = a:AddDefenseTree()
s = a:AddDefenseTree()
s = a:AddDefenseTree()
a.Moveable = true
a:Hide(1)

--12
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a:SetGraceTime(50)
s = a:AddDefenseTree()
s = a:AddDefenseTree()
s = a:AddDefenseTree()
a:AddSeedlings(math.random(20,40))
a.Moveable = true
a:Hide(1)

--13
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--14
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(3,4)
a.Moveable = true
a:SetGraceTime(200)
s = a:AddDysonTree()
s = a:AddDysonTree()
s = a:AddDefenseTree()
a:AddSeedlings(math.random(20,40))
a:Hide(1)

--15
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--16
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--17  Enemy Sprawl Asteroid
a = AddAsteroidWithAttribs(math.random(-30000,-25000),math.random(-20000,-10000), math.random(10,10) / 10,math.random(10,10) / 10,math.random(10,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 6
a.Moveable = true
a:Hide(1)
a:SetGraceTime(9999999)
a:AddSeedlings(math.random(40,60))
a:SetRadius(1500)

SetDysonTreeButtonAvailable(true)
SetDefenseTreeButtonAvailable(true)
SetFlowerDefenseButtonAvailable(false)
SetFlowerSeederButtonAvailable(false)
SetTerraformingButtonAvailable(false)
SetBeaconButtonAvailable(false)

if IsThIsThisiOS() then
SetEnemyInfoAvailable(true)
SetCoreInfoAvailable(true)
SetAttribsInfoAvailable(true)

SetSpeedSwitchAvailable(true)
SetSendModeScoutAvailable(true)
SetSendModeUnitsSelectorAvailable(true)

SetSendModeButtonAvailable(true)
SetSendModeHoldAvailable(true)
SetSendModeDragAvailable(true)
else
SetTreeInfoAvailable(true)
SetEnemyInfoAvailable(true)
SetCoreInfoAvailable(true)
SetAttribsInfoAvailable(true)
end

SetCameraPosition(5000,2000)

end

function LevelLogic()
StartLevelLogic()

foundAsteroidbarron11 = 0

GetAsteroid(17):AddDysonTree()
GetAsteroid(17):AddDysonTree()
GetAsteroid(17):AddDysonTree()
GetAsteroid(17):AddDefenseTree()
GetAsteroid(17):AddDefenseTree()
GetAsteroid(17):AddDefenseTree()

CheckConditions()
WaitReal(4)
SetBackdropColour(8/255,8/255,20/255)

if IsThIsThisiOS() then -- Offerings
SelectionClear()
WaitReal(2)
SetLevelDim(true)
Message("-Ordered Strike-", true, 1.0, "Top")
WaitMessage(true)
SetLevelDim(false)
else
MessageBox("-Ordered Strike-")
WaitDialog()
end

if IsThIsThisiOS() then -- Use The Seedlings
WaitReal(1)
Message("Use the seedlings I have given you to conquer this belt.", true, 1.0, "Top")
WaitMessage(true)
else
MessageBox("Use the seedlings I have given you to conquer this belt.")
WaitDialog()
end

while foundAsteroidbarron11 == 0 do
CheckConditions()
coroutine.yield()
end

if IsThisiOS() then -- Beacon
WaitReal(1)
Message("You have found an Unstable Asteroid,~Click on any asteroid you own, and press the {u57345} Beacon Button", true, 1.0, "Top")
SetBeaconButtonAvailable(true)
WaitMessage(true)
else
MessageBox("You have found an Unstable Asteroid,~Click on any asteroid you own, and press the {u57345} Beacon Button")
WaitDialog()
end

if IsThisiOS() then -- Beacon Explination
WaitReal(1)
Message("Then Select the Unstable Asteroid~This will send any newly created seedlings to this Asteroid automatically.", true, 1.0, "Top")
SetBeaconButtonAvailable(true)
WaitMessage(true)
else
MessageBox("Then Select the Unstable Asteroid~This will send any newly created seedlings to this Asteroid automatically.")
WaitDialog()
end

while GameRunning() do
CheckConditions()
coroutine.yield()
end

end

function CheckConditions()
if gameFinished then
return
end

if GetEmpire(1):GetNumOwnedAsteroids() == GetNumAsteroids() then
if IsThisiOS() then
GameOver(true, "")
Message("You successfully taken this belt.~Well Done", true, 1.0, "Centre")
WaitMessage(false)
WaitDialog()
Quit(true)
else
MessageBox("You successfully taken this belt.~Well Done")
GameOver(true, "")
Quit(true)
end
end

if GetEmpire(1).NumDysonTrees == 0 and GetEmpire(1).NumSeedlings == 0 then
if IsThisiOS() then
GameOver(false, "")
Message("You have failed to complete the tasks.", true, 1.0, "Centre")
WaitMessage(false)
WaitDialog()
Quit(false)
else
MessageBox("You have failed to complete the tasks.")
GameOver(false, "")
Quit(false)
end
end
end

function OnAsteroidRevealed(id, owner)
if id == 11 then
foundAsteroidbarron11 = 1
end
end

function IsThIsThisiOS()
if GetScreenWidth() == 2048 or GetScreenWidth() == 1024 then
if GetScreenHeight() == 1536 or GetScreenHeight() == 768 then
return true
else
return false
end
else
return false
end
end

It works fine on my iPad

Doesn't work fine on my PC I'm afraid.




As the error message says, Line 170 contains the problem:

Code: [Select]
--11
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 1
a.TreeCap = 0
a:SetProtected(true)
s = a:AddDefenseTree()
s = a:AddDefenseTree()
s = a:AddDefenseTree()
a.Moveable = true
a:Hide(1)

The line a:SetProtected(true) is causing a problem.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Common coding tasks
« Reply #37 on: May 23, 2012, 10:11:08 AM »
I don't think SetProtected works on PC.
What is the command supposed to do?

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Common coding tasks
« Reply #38 on: May 23, 2012, 10:19:14 AM »
Here's a tidied version.
Haven't changed any code, just tidied up the tabs and stuff. :>


Code: [Select]
function LevelSetup()
--SetBackdropColour(8/255,8/255,20/255)
SetBackdropColour(225/255,225/255,225/255)

--Special thanks to Aino, Pilchard123, Alex and Annikk.exe's Guides and Helps, Without them I wouldn't have been inspired to create this custom iPad
--campaign, also obviously, without the Game, none of this would have been possible. The Creator of this level/story is Tomfloria.
--Remember this though when searching through this code, (Aino) :D I am a beginner, and the code might be messy
--But that isn't my concern, if you can clean it up, so that it works exactly the same, then go ahead, and send me
--a PM on the Eufloria Forums at http://www.dyson-game.com/smf/index.php?board=3.0

if IsThIsThisiOS() then
SetMessageDarkMode(true)
end

if IsThIsThisiOS() then
Globals():Get("Asteroids"):Set("RadiusPowerRule",2)
Globals():Get("Asteroids"):Set("SizeFromEnergy",230)
Globals():Get("Asteroids"):Set("SizeFromStrength",230)
Globals():Get("Asteroids"):Set("SizeFromSpeed",240)
Globals():Get("Asteroids"):Set("MinCoreHealth",75)
Globals():Get("Asteroids"):Set("MaxCoreHealth",350)
Globals():Get("Asteroids"):Set("CoreHealthPowerRule",2.5)
Globals():Get("Asteroids"):Set("MinSendDistance",3500)
Globals():Get("Asteroids"):Set("MaxSendDistance",5500)
Globals():Get("Asteroids"):Set("SendPowerRule",2.0)
Globals():Get("Asteroids"):Set("SpawnCap", 40)

Globals():Get("Structures"):Set("LevelDuration1",15)
Globals():Get("Structures"):Set("LevelDuration2",30)
Globals():Get("Structures"):Set("LevelDuration3",60)
Globals():Get("Structures"):Set("LevelDuration4",100)
Globals():Get("Structures"):Set("SpawnTime1",15)
Globals():Get("Structures"):Set("SpawnTime2",12)
Globals():Get("Structures"):Set("SpawnTime3",10)
Globals():Get("Structures"):Set("SpawnTime4",8)

Globals():Get("Flowers"):Set("Available",0)

Globals():Get("Game"):Set("EnemyFactionsMin",0)
Globals():Get("Game"):Set("EnemyFactionsMax",0)
Globals():Get("Game"):Set("MinAsteroidSeparation",1500)
Globals():Get("Game"):Set("MaxAsteroidNeighbourDist",6000)
Globals():Get("Game"):Set("GreysProbability",0)

else

Globals.G.Asteroids=(0)
Globals.G.EnemyFactionsMin=(0)
Globals.G.EnemyFactionsMax=(0)
end

--0 Starting Asteroid
a = AddAsteroidWithAttribs(5000,2000, math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 1
a.TreeCap = 3
s = a:AddDysonTree()
s = a:AddDysonTree()
a:AddSeedlings(30)
a.Moveable = false

--1
a = AddAsteroidWithAttribs(math.random(-4000,9000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 3
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--2
a = AddAsteroidWithAttribs(math.random(-4000,9000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 2
a:SetGraceTime(1000)
s = a:AddDysonTree()
s = a:AddDefenseTree()
a:AddSeedlings(math.random(20,40))
a.Moveable = true
a:Hide(1)

--3
a = AddAsteroidWithAttribs(math.random(-4000,15000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 3
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--4
a = AddAsteroidWithAttribs(math.random(-4000,15000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 1
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--5
a = AddAsteroidWithAttribs(math.random(-4000,15000),math.random(1000,3000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 3
a.Moveable = true
a:SetGraceTime(0)
a:AddSeedlings(math.random(20,40))
s = a:AddDefenseTree()
s:LevelUp()
s:LevelUp()
s = a:AddDefenseTree()
s:LevelUp()
s:LevelUp()
s = a:AddDysonTree()
s:LevelUp()
s:LevelUp()
a:Hide(1)

--6
a = AddAsteroidWithAttribs(math.random(-10000,-3000),math.random(2000,8000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--7
a = AddAsteroidWithAttribs(math.random(-10000,-3000),math.random(2000,8000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--8
a = AddAsteroidWithAttribs(math.random(-10000,-3000),math.random(2000,8000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(2,4)
a.Moveable = true
a:SetGraceTime(4000)
a:AddSeedlings(math.random(20,40))
a:SetRadius(math.random(500,1000))
s = a:AddDefenseTree()
s:LevelUp()
s:LevelUp()
s = a:AddDysonTree()
s:LevelUp()
s:LevelUp()
a:Hide(1)

--9
a = AddAsteroidWithAttribs(math.random(-10000,-3000),math.random(2000,8000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--10
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:SetGraceTime(200)
s = a:AddDysonTree()
s = a:AddDysonTree()
s = a:AddDefenseTree()
a:AddSeedlings(math.random(20,40))
a:Hide(1)

--11
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 1
a.TreeCap = 0
a:SetProtected(true)
s = a:AddDefenseTree()
s = a:AddDefenseTree()
s = a:AddDefenseTree()
a.Moveable = true
a:Hide(1)

--12
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a:SetGraceTime(50)
s = a:AddDefenseTree()
s = a:AddDefenseTree()
s = a:AddDefenseTree()
a:AddSeedlings(math.random(20,40))
a.Moveable = true
a:Hide(1)

--13
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--14
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(3,4)
a.Moveable = true
a:SetGraceTime(200)
s = a:AddDysonTree()
s = a:AddDysonTree()
s = a:AddDefenseTree()
a:AddSeedlings(math.random(20,40))
a:Hide(1)

--15
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--16
a = AddAsteroidWithAttribs(math.random(-30000,-10000),math.random(-20000,-10000), math.random(1,10) / 10,math.random(1,10) / 10,math.random(1,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = math.random(1,4)
a.Moveable = true
a:Hide(1)
a:SetRadius(math.random(500,1000))

--17  Enemy Sprawl Asteroid
a = AddAsteroidWithAttribs(math.random(-30000,-25000),math.random(-20000,-10000), math.random(10,10) / 10,math.random(10,10) / 10,math.random(10,10) / 10) --BARRENROID
a.Owner = 0
a.TreeCap = 6
a.Moveable = true
a:Hide(1)
a:SetGraceTime(9999999)
a:AddSeedlings(math.random(40,60))
a:SetRadius(1500)

SetDysonTreeButtonAvailable(true)
SetDefenseTreeButtonAvailable(true)
SetFlowerDefenseButtonAvailable(false)
SetFlowerSeederButtonAvailable(false)
SetTerraformingButtonAvailable(false)
SetBeaconButtonAvailable(false)

if IsThIsThisiOS() then
SetEnemyInfoAvailable(true)
SetCoreInfoAvailable(true)
SetAttribsInfoAvailable(true)

SetSpeedSwitchAvailable(true)
SetSendModeScoutAvailable(true)
SetSendModeUnitsSelectorAvailable(true)

SetSendModeButtonAvailable(true)
SetSendModeHoldAvailable(true)
SetSendModeDragAvailable(true)
else
SetTreeInfoAvailable(true)
SetEnemyInfoAvailable(true)
SetCoreInfoAvailable(true)
SetAttribsInfoAvailable(true)
end

SetCameraPosition(5000,2000)

end

function LevelLogic()
StartLevelLogic()

foundAsteroidbarron11 = 0

GetAsteroid(17):AddDysonTree()
GetAsteroid(17):AddDysonTree()
GetAsteroid(17):AddDysonTree()
GetAsteroid(17):AddDefenseTree()
GetAsteroid(17):AddDefenseTree()
GetAsteroid(17):AddDefenseTree()

CheckConditions()
WaitReal(4)
SetBackdropColour(8/255,8/255,20/255)

if IsThIsThisiOS() then -- Offerings
SelectionClear()
WaitReal(2)
SetLevelDim(true)
Message("-Ordered Strike-", true, 1.0, "Top")
WaitMessage(true)
SetLevelDim(false)
else
MessageBox("-Ordered Strike-")
WaitDialog()
end

if IsThIsThisiOS() then -- Use The Seedlings
WaitReal(1)
Message("Use the seedlings I have given you to conquer this belt.", true, 1.0, "Top")
WaitMessage(true)
else
MessageBox("Use the seedlings I have given you to conquer this belt.")
WaitDialog()
end

while foundAsteroidbarron11 == 0 do
CheckConditions()
coroutine.yield()
end

if IsThisiOS() then -- Beacon
WaitReal(1)
Message("You have found an Unstable Asteroid,~Click on any asteroid you own, and press the {u57345} Beacon Button", true, 1.0, "Top")
SetBeaconButtonAvailable(true)
WaitMessage(true)
else
MessageBox("You have found an Unstable Asteroid,~Click on any asteroid you own, and press the {u57345} Beacon Button")
WaitDialog()
end

if IsThisiOS() then -- Beacon Explination
WaitReal(1)
Message("Then Select the Unstable Asteroid~This will send any newly created seedlings to this Asteroid automatically.", true, 1.0, "Top")
SetBeaconButtonAvailable(true)
WaitMessage(true)
else
MessageBox("Then Select the Unstable Asteroid~This will send any newly created seedlings to this Asteroid automatically.")
WaitDialog()
end

while GameRunning() do
CheckConditions()
coroutine.yield()
end

end

function CheckConditions()
if gameFinished then
return
end

if GetEmpire(1):GetNumOwnedAsteroids() == GetNumAsteroids() then
if IsThisiOS() then
GameOver(true, "")
Message("You successfully taken this belt.~Well Done", true, 1.0, "Centre")
WaitMessage(false)
WaitDialog()
Quit(true)
else
MessageBox("You successfully taken this belt.~Well Done")
GameOver(true, "")
Quit(true)
end
end

if GetEmpire(1).NumDysonTrees == 0 and GetEmpire(1).NumSeedlings == 0 then
if IsThisiOS() then
GameOver(false, "")
Message("You have failed to complete the tasks.", true, 1.0, "Centre")
WaitMessage(false)
WaitDialog()
Quit(false)
else
MessageBox("You have failed to complete the tasks.")
GameOver(false, "")
Quit(false)
end
end
end

function OnAsteroidRevealed(id, owner)
if id == 11 then
foundAsteroidbarron11 = 1
end
end

function IsThIsThisiOS()
if GetScreenWidth() == 2048 or GetScreenWidth() == 1024 then
if GetScreenHeight() == 1536 or GetScreenHeight() == 768 then
return true
else
return false
end
else
return false
end
end



By the way, I've noticed you always specify the background colour like this:


Code: [Select]
SetBackdropColour(225/255,225/255,225/255)
Do you realise that will just resolve to SetBackdropColour(0.88,0.88,0.88) ?
Because 225 divided by 255 = 0.88

So you'll end up with an amount that is slightly below 1.
Since 0 = no colour and 255 = full colour, you'll end up with a black background.  Actually it will be very very very dark grey, but probably indistinguishable from black.


You can also just wrote the command like this:

Code: [Select]
SetBackdropColour(0,0,0)
That just sets the background to jet black.  And it makes the command shorter and tidier.  :>  There's no need to use those divides..

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Common coding tasks
« Reply #39 on: May 23, 2012, 11:04:27 AM »
I don't know why the backdrop is like that, but Alex used it, but I don't know, I'll try single ones because it doesn't divide the colours :P

SetProtected(true) means no matter what the grace time is, that asteroid will never be attacked

My bad, it does divide the colours, just done singles.
« Last Edit: May 23, 2012, 11:19:23 AM by Tomfloria »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Common coding tasks
« Reply #40 on: May 23, 2012, 11:46:56 AM »
I don't know why the backdrop is like that, but Alex used it, but I don't know, I'll try single ones because it doesn't divide the colours :P

SetProtected(true) means no matter what the grace time is, that asteroid will never be attacked

My bad, it does divide the colours, just done singles.

SetProtected doesn't exist on PC.
Hmm.  How important is that command?  Does the level not work properly without it?

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Common coding tasks
« Reply #41 on: May 23, 2012, 12:04:11 PM »
It's just a quick way of restricting the seedlings from attacking a certain asteroid, it's not needed at all really, you could just change GraceTime's Manually throughout the level and if you wanted seedlings to attack places you could pre-define it.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Common coding tasks
« Reply #42 on: May 23, 2012, 12:40:35 PM »
Cool.  :>  In that case I'd suggest to remove that command entirely, or at least only run it if IsThisiOS() returns true.  That will make it work on PC too. :>

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Common coding tasks
« Reply #43 on: May 23, 2012, 03:42:51 PM »
Well i'm just focusing on iPad levels till it's done, then i'll go through it all and change stuff, because I might need to change the storyline, which if thats the case, I'd keep it iPad only, but then make custom random levels for iPad and PC compatible. (I have a few corkers I don't think anyones done before, which will twist the way this games played ;), if it's not been done :D )

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Common coding tasks
« Reply #44 on: May 24, 2012, 11:56:21 AM »
Fair dos :>


Forum is quiet today..  meh.. need codes..