Author Topic: Small problem with SendSeedlingsToTarget in waves.  (Read 660 times)

0 Members and 1 Guest are viewing this topic.

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Small problem with SendSeedlingsToTarget in waves.
« on: May 16, 2012, 06:26:10 PM »
So one of my levels is to protect some seedlings. I wanted to keep Pictures secret until a later date for a teaser. But pictures might explain better than words, Maybe...

(click to show/hide)

So there are the asteroids and what I want is a few waves of seedlings sent from asteroid 7 and 8 in a pattern I choose.

So guys, Whadup with this code?

Code: [Select]
function LevelLogic()
StartLevelLogic()

waveonedone = false

GetAsteroid(1).SendDistance = 2500
GetAsteroid(2).SendDistance = 2500
GetAsteroid(3).SendDistance = 2500
GetAsteroid(4).SendDistance = 2500
GetAsteroid(5).SendDistance = 2500
GetAsteroid(6).SendDistance = 2500
GetAsteroid(7).SendDistance = 14000
GetAsteroid(8).SendDistance = 14000

if IsiOS() then
WaitReal(1)
GetAsteroid(8):SendSeedlingsToTarget(3,20,GetAsteroid(3))
waveonedone = true
end

if waveonedone == true then
if IsiOS() then
WaitReal(1)
GetAsteroid(7):SendSeedlingsToTarget(3,40,GetAsteroid(4))
wavetwodone = true
end
end


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

end

It completely misses out

Code: [Select]
[code][code] if IsiOS() then
WaitReal(1)
GetAsteroid(8):SendSeedlingsToTarget(3,20,GetAsteroid(3))
waveonedone = true
end
[/code][/code]

And goes to the second bit? :S
« Last Edit: May 16, 2012, 06:41:53 PM by Tomfloria »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Small problem with SendSeedlingsToTarget in waves.
« Reply #1 on: May 16, 2012, 07:34:19 PM »
Try a fish messagebox?

(point 9)
« Last Edit: May 16, 2012, 07:37:39 PM by annikk.exe »

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Small problem with SendSeedlingsToTarget in waves.
« Reply #2 on: May 16, 2012, 08:12:56 PM »
Code: [Select]
MessageBox("1")

if IsiOS() then
WaitReal(1)
GetAsteroid(8):SendSeedlingsToTarget(3,20,GetAsteroid(3))
WaitReal(10)
waveonedone = true
end

MessageBox("2")

if waveonedone == true then
if IsiOS() then
WaitReal(1)
GetAsteroid(7):SendSeedlingsToTarget(3,40,GetAsteroid(4))
wavetwodone = true
end
end

MessageBox("3")

Right, this is what happens, in order

MessageBox
Waits about 10 game seconds
MessageBox
40 Seedlings sent to Asteroid 4

So from that, the first sendseedlingstotarget is still completely missed out?

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Small problem with SendSeedlingsToTarget in waves.
« Reply #3 on: May 16, 2012, 08:15:49 PM »
Hmmmmm, this does absolutely nothing but show the messagebox...

Code: [Select]
function LevelLogic()
StartLevelLogic()

waveonedone = false

GetAsteroid(1).SendDistance = 2500
GetAsteroid(2).SendDistance = 2500
GetAsteroid(3).SendDistance = 2500
GetAsteroid(4).SendDistance = 2500
GetAsteroid(5).SendDistance = 2500
GetAsteroid(6).SendDistance = 2500
GetAsteroid(7).SendDistance = 14000
GetAsteroid(8).SendDistance = 14000

MessageBox("1")

GetAsteroid(8):SendSeedlingsToTarget(3,20,GetAsteroid(3))

MessageBox("1")


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

end

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Small problem with SendSeedlingsToTarget in waves.
« Reply #4 on: May 16, 2012, 08:46:30 PM »
Code: [Select]
MessageBox("1")

if IsiOS() then
WaitReal(1)
GetAsteroid(8):SendSeedlingsToTarget(3,20,GetAsteroid(3))
WaitReal(10)
waveonedone = true
end

MessageBox("2")

if waveonedone == true then
if IsiOS() then
WaitReal(1)
GetAsteroid(7):SendSeedlingsToTarget(3,40,GetAsteroid(4))
wavetwodone = true
end
end

MessageBox("3")

Right, this is what happens, in order

MessageBox
Waits about 10 game seconds
MessageBox
40 Seedlings sent to Asteroid 4

So from that, the first sendseedlingstotarget is still completely missed out?


I meant try something like this:


Code: [Select]
if IsiOS() then
MessageBox("Fish")
WaitReal(1)
GetAsteroid(8):SendSeedlingsToTarget(3,20,GetAsteroid(3))
waveonedone = true
end

That way, you'll know whether the answer to if IsiOS() is true or false; if it's true, you'll get a Fish.  If it's false, you won't get a Fish.  Understand? :>

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Small problem with SendSeedlingsToTarget in waves.
« Reply #5 on: May 16, 2012, 08:54:01 PM »
I've found something, that it kind of strange, and I'm stuck and confused...

Code: [Select]
if IsiOS() then -- Need to Trap Sprawl
WaitReal(1)
Message("Test 1", true, 1.0, "Left")
WaitMessage(true)
stage = 1
else
MessageBox("01_01")
WaitDialog()
end

if stage == 1 then
GetAsteroid(7):SetGraceTime(0)
GetAsteroid(7):SendSeedlingsToTarget(0,10,GetAsteroid(4))
WaitReal(1)
stage = 2
end

if stage == 2 then
GetAsteroid(8):SetGraceTime(0)
GetAsteroid(8):SendSeedlingsToTarget(0,40,GetAsteroid(4))
end

if IsiOS() then -- Need to Trap Sprawl
WaitReal(1)
Message("Test 2", true, 1.0, "Left")
WaitMessage(true)
stage = 2
else
MessageBox("01_01")
WaitDialog()
end

Message("Test 2", true, 1.0, "Top")

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

That completely works, it sends seedlings from 7 and 8 to Asteroid 4...


But check this out, if it's not Asteroid 4, IT WON'T SEND SEEDLINGS THERE. what?

The send distance of 7 and 8 reaches every asteroid, so why is Asteroid 4 so demanding?

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Small problem with SendSeedlingsToTarget in waves.
« Reply #6 on: May 16, 2012, 08:56:58 PM »
What's the purpose of the IsiOS() thing?

Also, when you start the above level, what does the messagebox say?

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Small problem with SendSeedlingsToTarget in waves.
« Reply #7 on: May 16, 2012, 08:58:57 PM »
I recommend trying the fish test as I described above to find out what the result of IsiOS() is.  That will point you in the right direction.

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Small problem with SendSeedlingsToTarget in waves.
« Reply #8 on: May 16, 2012, 09:04:40 PM »
well iOS is the operating system of the ipad and i've done the fish test, but with how messages with ipad eufloria works

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Small problem with SendSeedlingsToTarget in waves.
« Reply #9 on: May 16, 2012, 09:35:58 PM »
it seems this at the start of levellogic()

Code: [Select]
--GetAsteroid(1).SendDistance = 20000
--GetAsteroid(2).SendDistance = 20000
--GetAsteroid(3).SendDistance = 20000
--GetAsteroid(4).SendDistance = 20000
--GetAsteroid(5).SendDistance = 20000
--GetAsteroid(6).SendDistance = 20000

Was messing things up, and it actually works now by putting a.SendDistance = 20000 in levelsetup

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Small problem with SendSeedlingsToTarget in waves.
« Reply #10 on: May 16, 2012, 09:40:09 PM »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Small problem with SendSeedlingsToTarget in waves.
« Reply #11 on: May 16, 2012, 09:45:01 PM »
Glad you got it working :>  But doesn't that mean that if someone plays it on a PC, the If statement won't trigger?

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Small problem with SendSeedlingsToTarget in waves.
« Reply #12 on: May 16, 2012, 09:48:31 PM »
Well i'm only making it for iPad aren't I, so if someone wanted my custom story mode, they'd have to port it.

For example some stuff that maybe would crash the PC would be this....

Code: [Select]
    Globals():Get("Asteroids"):Set("RadiusPowerRule",4)
Globals():Get("Asteroids"):Set("SizeFromEnergy",530)
Globals():Get("Asteroids"):Set("SizeFromStrength",530)
Globals():Get("Asteroids"):Set("SizeFromSpeed",540)
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",1)

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

and

Code: [Select]
SetBackdropColour(8/255,8/255,20/255)[/code

and

[code] SetDysonTreeButtonAvailable(false)
SetDefenseTreeButtonAvailable(false)
SetFlowerDefenseButtonAvailable(false)
SetFlowerSeederButtonAvailable(false)
SetTerraformingButtonAvailable(true)
SetBeaconButtonAvailable(false)

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

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

SetSendModeButtonAvailable(false)
SetSendModeHoldAvailable(false)
SetSendModeDragAvailable(false)
else
SetTreeInfoAvailable(true)
SetEnemyInfoAvailable(true)
SetCoreInfoAvailable(true)
SetAttribsInfoAvailable(true)
end
[/code]

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Small problem with SendSeedlingsToTarget in waves.
« Reply #13 on: May 17, 2012, 03:40:01 PM »
Code: [Select]
SetBackdropColour(8/255,8/255,20/255)
That would work on PC.

Code: [Select]
SetDysonTreeButtonAvailable(false)
SetDefenseTreeButtonAvailable(false)
SetFlowerDefenseButtonAvailable(false)

These will work.


Code: [Select]
SetFlowerSeederButtonAvailable(false)
SetTerraformingButtonAvailable(true)
SetBeaconButtonAvailable(false)

These ones won't work.



Code: [Select]
if IsiOS() then
IsiOS() doesn't work on PC.


Code: [Select]
SetEnemyInfoAvailable(true)
SetCoreInfoAvailable(true)
SetAttribsInfoAvailable(true)

These ones should work.


Code: [Select]
SetSpeedSwitchAvailable(true)
SetSendModeScoutAvailable(false)
SetSendModeUnitsSelectorAvailable(false)

Don't think these ones will work.

Code: [Select]
SetSendModeButtonAvailable(false)
SetSendModeHoldAvailable(false)
SetSendModeDragAvailable(false)
SetTreeInfoAvailable(true)
SetEnemyInfoAvailable(true)
SetCoreInfoAvailable(true)
SetAttribsInfoAvailable(true)

Not sure about these.




Also,
Code: [Select]
Globals():Get("Asteroids"):Set("SizeFromEnergy",530)
I'm not sure whether this works on PC.  Might do. :>

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
  • First iOS modder :D
Re: Small problem with SendSeedlingsToTarget in waves.
« Reply #14 on: May 17, 2012, 03:54:00 PM »
The whole available buttons which are set as false or true at the levels I knew some would work and some wouldn't. The iOS version has some nice features, terraform allows you to change your asteroids attributes :p at the cost of seedlings and you can only change 1 attribute.

E.g energy, but not speed and strength, or strength, etc....

The Beacon button automatically sends new seedlings to one asteroid, really good feature. You get a really nice effect when you have a few asteroids auto sending the seedlings to a new asteroid, In a few of my levels I purposely achieve this effect.

The flower seeder button is wether the flower pods can create super seedlings, the glowing seedlings, does of not have them?