Author Topic: Lua scripting in Eufloria - reference  (Read 17230 times)

0 Members and 1 Guest are viewing this topic.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: Lua scripting in Eufloria - reference
« Reply #45 on: March 30, 2011, 05:14:04 PM »
Any way to select each and every seed in the whole game?

Like:

Code: [Select]
for i = 1,NumSeedlings() do --NumSeedlings can be a variable by adding all the current seeds frome ach empire in the game, thats not the problem :)
if Agent(i) ~= nil then
x = Agent(i).position.X   --position.X is existing for all game enitites, so I guess that would work if you can call each and every agent alone :)
--make a variable containing x, if there is anything like this, is there then possible to track(if the seeds are on move) where they are going(asteroid wise)?
end
end

Now I am asking before I have experimented though... as usual -.-

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: Lua scripting in Eufloria - reference
« Reply #46 on: March 30, 2011, 07:56:33 PM »
Just brainstorming, but here goes:

Get the number of empires, the number of asteroids, and the number of seedlings on each asteroid.

At EVERY roid, run a FOR loop for each empire, for the number of their seedlings on that roid. This loop would pick up a specific seedling, there is a way of doing this, but I'm not sure how just atm. Add this collected seedling to a variable.

This variable will hold all seedlings.


...


Maybe.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: Lua scripting in Eufloria - reference
« Reply #47 on: March 30, 2011, 08:16:36 PM »
o.O...

Just do a for loop for all empires and NumSeedlings?

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: Lua scripting in Eufloria - reference
« Reply #48 on: March 30, 2011, 08:56:02 PM »
Or that, either way. Why did I not think of that?

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Lua scripting in Eufloria - reference
« Reply #49 on: March 31, 2011, 10:46:11 AM »
I recall there is a way to access an inbuilt array of seedlings, organised per asteroid.  Can't remember offhand how to do it though.
If you make your own array and store the seedlings in it, you could then run commands on them even if they are mid-flight between two asteroids.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: Lua scripting in Eufloria - reference
« Reply #50 on: March 31, 2011, 01:16:52 PM »
Thats exactly what I need for my save code, but now I need to know how to write into a file... IO crashes, so I don't know how...
« Last Edit: March 31, 2011, 01:47:02 PM by Aino »

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: Lua scripting in Eufloria - reference
« Reply #51 on: April 02, 2011, 09:54:31 PM »
Is there any possibl way to find the Empire color? Like GetEmpire(faction).Colo(u)r

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: Lua scripting in Eufloria - reference
« Reply #52 on: April 03, 2011, 06:57:14 PM »
GetLeafColour()

Ask Annikk about it, he was working with it a while ago.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Lua scripting in Eufloria - reference
« Reply #53 on: April 04, 2011, 11:29:06 AM »
I did not find an elegant solution to that.  My experiments with GetLeafColour() met with limited success.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: Lua scripting in Eufloria - reference
« Reply #54 on: April 04, 2011, 01:32:10 PM »
Ok, I'll try and see :)

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: Lua scripting in Eufloria - reference
« Reply #55 on: April 20, 2011, 09:14:19 AM »
Hmm, I need that Seedling/Agent thing again >.<

Anyone remember?

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: Lua scripting in Eufloria - reference
« Reply #56 on: May 04, 2011, 08:32:55 PM »
What is all of these?

Quote
DrawSprite Know that one
DrawLine
DrawEnergyLine
DrawBox
DrawCore
DrawTexturedLine2
DrawTexturedLine
DrawRoot
DrawPolyLine
DrawPolygon
DrawLineTest Guess it is jsut a test, so...

Are they usable, or? And if so, how do you use them(I know thay should either be in LevelDraw() or ScreenDraw(), but I am talking about the arguments it needs)?
« Last Edit: May 04, 2011, 09:41:02 PM by Aino »

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: Lua scripting in Eufloria - reference
« Reply #57 on: May 04, 2011, 09:35:01 PM »
Draw sprite draws...a sprite!

There's a list of them somewhere around, iirc.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: Lua scripting in Eufloria - reference
« Reply #58 on: May 04, 2011, 09:36:22 PM »
Lol, forgot to strikeout DrawSprite, I use it way to often to not know what it is :)

Edit: My 500th post :O

hitman271

  • Shoot
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 22
Re: Lua scripting in Eufloria - reference
« Reply #59 on: August 05, 2011, 05:50:44 PM »
Any word on DrawPolygon? Is there a way to determine a lua's functions arguments?!