Author Topic: Guide to making levels for Absolute Beginners  (Read 16635 times)

0 Members and 1 Guest are viewing this topic.

Rudolf

  • Administrator
  • Old Oak
  • *****
  • Thank You
  • -Given: 4
  • -Receive: 13
  • Posts: 635
  • Euflorian Ambassador
    • Omni Systems Limited
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #30 on: December 30, 2010, 11:37:55 PM »
I may have another look at colour combinations that set empires apart a bit more. You know what? It is harder than you may think. :-)
-----------------------------------------------------
Rudolf Kremers - Grand Poobah

http://www.omni-labs.com
http://www.rudolfkremers.com
http://rudolfkremers.tumblr.com/

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Guide to making levels for Absolute Beginners
« Reply #31 on: December 30, 2010, 11:44:19 PM »
It would be even better if you could just add specific commands to allow level designers to choose the colour of an empire.. :D

(I gather this would be difficult, though I'm not sure why)

Bonobo

  • Achiever
  • Old Oak
  • ****
  • Thank You
  • -Given: 77
  • -Receive: 8
  • Posts: 629
  • Was born, still alive.
    • German Mac Mailing Lists
  • Eufloria: Yes
Totally [OT] nonsense
« Reply #32 on: December 31, 2010, 02:00:39 AM »
By the way, until about January 5th you can expect responses to any questions within about 1 hour...  ^_^
OK then.

What is the meaning of life?

OK, and the numbers for next week's Lotto, please.

(And I have a lot more questions.)

<g,d&r> & SCNR
Google+
Do you play Go? (aka iGo aka Baduk aka Weiqi)

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Totally [OT] nonsense
« Reply #33 on: December 31, 2010, 02:53:11 AM »
By the way, until about January 5th you can expect responses to any questions within about 1 hour...  ^_^
OK then.

What is the meaning of life?

It's a trick question; it implies theism.  :>


Quote
OK, and the numbers for next week's Lotto, please.

7, 15, 27, 36, 44, 47, 52 and bonus ball 21.

pigpenguin

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
Re: Guide to making levels for Absolute Beginners
« Reply #34 on: December 31, 2010, 03:13:28 AM »
It's a trick question; it implies theism.  :>
Excellent answer the answer 42 would have been also accepted

pigpenguin

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
Re: Guide to making levels for Absolute Beginners
« Reply #35 on: December 31, 2010, 04:43:38 AM »
Hi I'm back again and I have two questions:
The -- defines the line as a comment right? Like the // does in c++?
Also I am interested in changing the parameter for winning to be the number of trees on an asteroid and i know the command to retrieve that number is GetNumTrees() now what im curious about is how when you started the command to figure out if gamewon was 1 or 2 you had to define the function as "OnAsteroidTaken" what would be the function for GetNumTrees()?
Thank you guys for the help its awesome :D
« Last Edit: December 31, 2010, 04:50:16 AM by pigpenguin »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Guide to making levels for Absolute Beginners
« Reply #36 on: December 31, 2010, 04:49:49 AM »
-- does indeed define the rest of the line as a comment.  :>


Regarding the OnAsteroidTaken() function.  The example code I gave was not particularly elegant, I was mainly just trying to show you that you can use that function to run code whenever an asteroid is taken.  :>
For what you want to do, I don't think you'd need to use that function at all.
Instead, just make a While GameRunning() do loop, and then inside that loop you can continously check whether the appropriate asteroid has enough trees to justify a victory.


The GetNumTrees() trees command is designed to be run on an asteroid.

For example:

Code: [Select]
treenumber = GetAsteroid(25):GetNumTrees()
This would declare a variable, which would be equal to the number of trees on Asteroid 25.

Then you can run a check on it and do the victory stuff:


Code: [Select]
if treenumber == 50 then
Pause()
MessageBox("Victory!")
WaitDialog()
Unpause()
Quit(true)
end



Or alternatively, skip out the variable altogether:

Code: [Select]
if GetAsteroid(25):GetNumTrees() == 50 then
Pause()
MessageBox("Victory!")
WaitDialog()
Unpause()
Quit(true)
end


Hope this helps.  :>  6 mins response!  And it's 5am!  lulz :>
« Last Edit: December 31, 2010, 04:53:30 AM by annikk.exe »

pigpenguin

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
Re: Guide to making levels for Absolute Beginners
« Reply #37 on: December 31, 2010, 04:55:57 AM »
And then i could also put something like

Code: [Select]
if GameTime > 300
     Pause()
     MessageBox("You lost")
     WaitDialog()
     Unpause()
     Quit(false)

end

So that they had a loose condition and not have to start a new function at all?


Now why are you up so lat- nvm I guess I stay up that late too :P

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Guide to making levels for Absolute Beginners
« Reply #38 on: December 31, 2010, 05:03:26 AM »
You could indeed.  :>  However, this line would cause it to not load:

Code: [Select]
if GameTime > 300
The reason is that the command is actually GetGameTime()

But yeah, you have the right idea there.  :>

I am up late because I am addicted to coding!!  And Eufloria looks soooo stunning on my new plasma TV.

pigpenguin

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
Re: Guide to making levels for Absolute Beginners
« Reply #39 on: December 31, 2010, 05:04:29 AM »
sweeeeeet thank you

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Guide to making levels for Absolute Beginners
« Reply #40 on: December 31, 2010, 05:05:27 AM »
Let me know if it works :D

Ooh.. you also forgot a then for your if...  :>

pigpenguin

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
Re: Guide to making levels for Absolute Beginners
« Reply #41 on: December 31, 2010, 05:47:09 AM »
ooooh plasma tv + eufloria *drool*
haha I totally missed the "then" :P
i have two quick questions (the seem to pop up in pairs for some reason :P)
First how do you level up trees at the start i know the command is LevelUp() but were do I put that?
Secondly would the set grace time command be like a:SetGraceTime(300) under the asteroid you don't want the ai to touch?
Sorry if im asking too many questions :P
*edit* I also don't know how to make an asteroid uninhabited I put zero in but still a random faction spawned on it :/
« Last Edit: December 31, 2010, 05:53:48 AM by pigpenguin »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Guide to making levels for Absolute Beginners
« Reply #42 on: December 31, 2010, 06:13:49 AM »
Quote
ooooh plasma tv + eufloria *drool*

It's so awesome.


Quote
First how do you level up trees at the start i know the command is LevelUp() but were do I put that?

You run it on a tree.

Suppose you make an asteroid called "a"...

Code: [Select]
a = AddAsteroidWithAttribs(0,0,1,1,1)

Then you make a tree called "s" on the asteroid called "a"...


Code: [Select]
a = AddAsteroidWithAttribs(0,0,1,1,1)
s = a:AddDysonTree()

...then you would level up the tree called "s" like this:

Code: [Select]
a = AddAsteroidWithAttribs(0,0,1,1,1)
s = a:AddDysonTree()
s:LevelUp()


If you want it to level up to full, run the command 3 times:

Code: [Select]
a = AddAsteroidWithAttribs(0,0,1,1,1)
s = a:AddDysonTree()
s:LevelUp()
s:LevelUp()
s:LevelUp()




Quote
Secondly would the set grace time command be like a:SetGraceTime(300) under the asteroid you don't want the ai to touch?

Correct.  :>  Then the AI will not do anything with that asteroid for the first 5 minutes of game time.


Quote
*edit* I also don't know how to make an asteroid uninhabited I put zero in but still a random faction spawned on it :/

If you didn't add the faction, and you set the owner to 0, then it's probably because the game automatically spawns factions unless you put these command somewhere in your function LevelSetup() (usually alongside all your other globals):

Code: [Select]
Globals.G.EnemyFactionsMin=0
Globals.G.EnemyFactionsMax=0

What that does is tells the game to not spawn any empires automatically.  That way only the empires you specifically create will be there when the level loads.  :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Guide to making levels for Absolute Beginners
« Reply #43 on: December 31, 2010, 06:16:33 AM »
Right, I'm going to get some sleep now.  :>

brb 8 hours :P

pigpenguin

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
Re: Guide to making levels for Absolute Beginners
« Reply #44 on: December 31, 2010, 06:20:29 AM »
haha see yah thanks for the help :P i will prolly be asleep when you get back only 10:00 here