Author Topic: Flowers and Mines, how to find them?  (Read 12984 times)

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Flowers and Mines, how to find them?
« on: February 22, 2011, 09:07:43 PM »
Ok, I know that you can sue:
Code: [Select]
Tree = GetAsteroid(i):GetRandomDysonTree()
if Tree ~= nil then
Flower = Tree:GetSuperSeedling()
to find flowers on trees, but what about roids when the flowers/mines are plucked already?

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Flowers and Mines, how to find them?
« Reply #1 on: February 22, 2011, 09:43:47 PM »
Asteroid:GetSuperSeedling()?

Not certain, but it sounds logical.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Flowers and Mines, how to find them?
« Reply #2 on: February 22, 2011, 10:44:15 PM »
Gonna test :)

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Flowers and Mines, how to find them?
« Reply #3 on: February 22, 2011, 11:40:49 PM »
Ok, but how to find Mines?

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Flowers and Mines, how to find them?
« Reply #4 on: February 22, 2011, 11:50:32 PM »
GetMine()

Needs an empire as a parameter, though it may just use the 'roid's current owner by default.

READ:
http://www.dyson-game.com/smf/index.php?topic=212.0

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Flowers and Mines, how to find them?
« Reply #5 on: February 22, 2011, 11:58:29 PM »
I use two different methods:


1.  If I used Flower = Tree:GetSuperSeedling() to Pluck the flower, then I just continue to refer to that flower as Flower.  Or, if I know there will be lots of flowers, I refer to it as an array - Flower.

2.  If it's an arbitrary flower that hasn't been named yet, I check each asteroid and try to assign any flowers on it to a variable such as Flower using the GetFlower(int faction) command.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Flowers and Mines, how to find them?
« Reply #6 on: February 23, 2011, 12:00:36 AM »
By the way, both GetFlower(int faction) and GetMine(int faction) must be run on an asteroid.

EG: Flower = GetAsteroid(j):GetFlower(i)

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Flowers and Mines, how to find them?
« Reply #7 on: February 23, 2011, 12:12:05 AM »
Kay :)

Need to do some changes...

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Flowers and Mines, how to find them?
« Reply #8 on: February 23, 2011, 12:20:24 AM »
But in the frist place, how do I find mines?

EDIT: Forgot the stuff some lines above :)
« Last Edit: February 23, 2011, 12:26:46 AM by Aino »

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Flowers and Mines, how to find them?
« Reply #9 on: February 23, 2011, 12:28:12 AM »
GetMine()

Needs an empire as a parameter, though it may just use the 'roid's current owner by default.

READ:
http://www.dyson-game.com/smf/index.php?topic=212.0

But will that return all of the mines/flowers? Or just one???

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Flowers and Mines, how to find them?
« Reply #10 on: February 23, 2011, 12:29:11 AM »
It returns a random one.  :>

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Flowers and Mines, how to find them?
« Reply #11 on: February 23, 2011, 12:33:17 AM »
Mhm... so this code will work?
Code: [Select]
if CCFPriority[i] > CCFPriority[Neighbour[j]] and CCBarrier[i] == false and GetAsteroid(i).owner == 1 then
CCFPriority[i] = CCFPriority[Neighbour[j]] + 1
if GetAsteroid(i):GetNumFlowers(1) > 0 then
CCFlower = GetAsteroid(i):GetFlower(1)
CCFlower:SendTo(Neighbour[j])
end
end

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Flowers and Mines, how to find them?
« Reply #12 on: February 23, 2011, 12:38:15 AM »
Yup, should do :>

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Flowers and Mines, how to find them?
« Reply #13 on: February 23, 2011, 12:53:14 AM »
But it doesn't -.-

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Flowers and Mines, how to find them?
« Reply #14 on: February 23, 2011, 12:58:17 AM »
Do you get any error message?

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Flowers and Mines, how to find them?
« Reply #15 on: February 23, 2011, 01:00:19 AM »
Ye... Error with Flower.SendTo and I wrote Flower:SendTo() ... What the heck?

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Flowers and Mines, how to find them?
« Reply #16 on: February 24, 2011, 06:57:02 AM »
Annikk I'lls end the code, please try to help... it's the last thing before the release :/

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Flowers and Mines, how to find them?
« Reply #17 on: February 28, 2011, 11:36:19 PM »
Any luck with this? I've not had time to try this myself as I've been busy with work. I'm actually in Abu dhabi at the moment. Flying home tonight.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Flowers and Mines, how to find them?
« Reply #18 on: March 01, 2011, 12:18:50 AM »
Nope... Want it to work, but no succes :/

My coding sudenly dropped, after I encountered that problem, a new update for Minecraft came and I sudenly stopped... Hope I will code again soon though :)