Euflorium: The Eufloria Community

Eufloria => Eufloria Classic => Eufloria Classic Mods => Topic started by: Aino on February 22, 2011, 09:07:43 PM

Title: Flowers and Mines, how to find them?
Post by: Aino 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?
Title: Re: Flowers and Mines, how to find them?
Post by: Pilchard123 on February 22, 2011, 09:43:47 PM
Asteroid:GetSuperSeedling()?

Not certain, but it sounds logical.
Title: Re: Flowers and Mines, how to find them?
Post by: Aino on February 22, 2011, 10:44:15 PM
Gonna test :)
Title: Re: Flowers and Mines, how to find them?
Post by: Aino on February 22, 2011, 11:40:49 PM
Ok, but how to find Mines?
Title: Re: Flowers and Mines, how to find them?
Post by: Pilchard123 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
Title: Re: Flowers and Mines, how to find them?
Post by: annikk.exe 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.
Title: Re: Flowers and Mines, how to find them?
Post by: annikk.exe 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)
Title: Re: Flowers and Mines, how to find them?
Post by: Aino on February 23, 2011, 12:12:05 AM
Kay :)

Need to do some changes...
Title: Re: Flowers and Mines, how to find them?
Post by: Aino 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 :)
Title: Re: Flowers and Mines, how to find them?
Post by: Aino 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???
Title: Re: Flowers and Mines, how to find them?
Post by: annikk.exe on February 23, 2011, 12:29:11 AM
It returns a random one.  :>
Title: Re: Flowers and Mines, how to find them?
Post by: Aino 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
Title: Re: Flowers and Mines, how to find them?
Post by: annikk.exe on February 23, 2011, 12:38:15 AM
Yup, should do :>
Title: Re: Flowers and Mines, how to find them?
Post by: Aino on February 23, 2011, 12:53:14 AM
But it doesn't -.-
Title: Re: Flowers and Mines, how to find them?
Post by: annikk.exe on February 23, 2011, 12:58:17 AM
Do you get any error message?
Title: Re: Flowers and Mines, how to find them?
Post by: Aino on February 23, 2011, 01:00:19 AM
Ye... Error with Flower.SendTo and I wrote Flower:SendTo() ... What the heck?
Title: Re: Flowers and Mines, how to find them?
Post by: Aino 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 :/
Title: Re: Flowers and Mines, how to find them?
Post by: annikk.exe 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.
Title: Re: Flowers and Mines, how to find them?
Post by: Aino 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 :)