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

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Guide to making levels for Absolute Beginners
« on: February 07, 2010, 05:40:03 AM »
Overwhelmed by the thought of trying to code your own levels?
Don't worry, Fluffy is here to halp.
Follow this guide and you'll be making levels in no time!
(If you actually try everything suggested here for yourself, it will take you about 40-60 mins to learn how to make levels.)

To start with we will create a very simple level, and then learn by adjusting values and playing the level each time to see what has changed.




1.
Click Start




2.
Click on "Run".




3.
Type "notepad.exe" into the box as shown, and click OK.




4.
Notepad opens.




5.
Enter the text shown below into Notepad.
If you would prefer to copy & paste the text instead of typing it out yourself, click the "Spoiler" button below:

(click to show/hide)




6.
Now click "File" in the top left of Notepad, and choose "Save As".




7.
We need to make sure we save it in the right folder.
The picture below shows the correct location of the "Maps" folder.
Use the drop-down box at the top of the "Save As" window to navigate to the right folder.




8.
Give your level a name, and make sure that it ends with ".lua"
Set the file type to All Files.
Set Encoding to ANSI.

Then click the Save button.  Now it's time to check out our level.


9.
Load up Eufloria, choose "Custom Levels" from the main menu, and your new level should be waiting there.
Click on it to try playing it!




10.
When it loads up, this is what it should look like.




11.
If you send a scout to the asteroid next door, you should see that there are enemy seedlings orbiting it.





If you got this far, congratulations - you are through the biggest barrier, which is getting started.  It will be plain sailing from here!
« Last Edit: May 28, 2012, 09:06:17 PM by Eufloria Admin »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #1 on: February 07, 2010, 05:40:34 AM »
Now that we've made a simple level, lets experiment with it by changing some values.



12.
To start with, lets change the number of seedlings that the Player starts with from 90 up to 500.  Make the change indicated below:




13.
Now that we've made the change, it is important that we remember to save the file.  Otherwise our changes won't be apparent when we try to play the level.




14.
Now go back to Eufloria and try loading up the level like before.  You should start with loads of seedlings this time!




15.
Next lets try to change the size of the Player's asteroid.  Make the change indicated below, and don't forget to save the level afterwards by clicking "File" and "Save", like in step 13.




16.
Now load the game up, and lo and behold your asteroid has swollen to epic proportions!




17.
Next lets try changing the maximum number of trees allowed on the Player's asteroid.  Make the change indicated below - make sure you change the right asteroid!  Then save the level again.




18.
Load it up in Eufloria and now we can plant up to 20 trees :>





Now try changing some of the other values yourself.  I would suggest to only change one thing at a time - that way if you accidentally break the level, it's easy to know what to undo to fix the problem.
« Last Edit: February 07, 2010, 08:13:10 AM by annikk.exe »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #2 on: February 07, 2010, 06:28:17 AM »
19.
Hopefully by now you should be getting an idea of how this works.
You can kind of tell what each line means... it doesn't take a genius to work out that "SendDistance" is how far the asteroid can send seedlings.

However, one command is not so obvious, and that is the AddAsteroidWithAttribs command, which as you might guess is used to create asteroids and set their basic attributes.  Lets take a moment to look at that line, because it's a good example to teach us about the other commands as well.



Lets deal with the bits in brackets first.

There are 5 values seperated by commas.

The first two values are the X and Y coordinates of the asteroid - it tells the game where on the map the asteroid is located.  These have to be integers (whole numbers).

This map hopefully gives you an idea of what sort of values you can use.






20.
The next three values are the Energy, Strength, and Speed of the asteroid.



You can use any number between 0 and 1.  So you could have 0.5, or you could have 0.55555 or whatever you like really.




21.
Now that we've dealt with the brackets, lets look at the bit at the start:



The command starts with an "a = ".  The "a" is sort of like the name of the asteroid that we are creating.
Then we can use the various functions and property commands to tell the game what the asteroid is like.

This is what a.TreeCap is doing - we refer to the asteroid called "a", and then we tell the game that "a" has a Tree Cap of...whatever we set it to.






22.

You might notice that we use "a" a second time to make the second asteroid:



It doesn't matter if we use it twice in a row like that.  When we use it to make the second asteroid, we are just telling the game to "forget" which asteroid "a" is, because now this asteroid is called "a".  We just overwrite the old value by declaring a new one.

Then we can set the properties for the second asteroid using the same commands like before, such as "a.TreeCap" and "a:AddSeedlings()" and so on.

Note: You can give each asteroid a unique name if you wish, rather than just re-using "a" all the time.  This can actually be useful if you want to refer to them in your scripts later on.
fluffy = AddAsteroidWithAttribs is perfectly acceptable.  :>  fluffy.TreeCap and other commands will work without problems.



"a." (with a dot) is used to set properties, and "a:" (with a colon) is used for functions.  You must be careful not to mix them up, or the level won't load.
A complete list of the different commands you can use for asteroid properties can be found in the LUA Scripting Reference Sticky.




23.
Finally, the complete command looks like this:

NAME = AddAsteroidWithAttribs(Horizontal Position,Vertical Position,Energy,Strength,Speed)




24.
Now to try adding a new asteroid to your level.

You need to make sure you put it within the bounds of the function LevelSetup().  That is, it must appear after the LevelSetup() command, and before the end command, as shown.



Lets make an asteroid by typing in the code for it where the red arrow indicates.

First we should make a comment to remind ourselves later on that this is Asteroid 2 (remember we had asteroid 0, 1, and this will be asteroid 2).
So type in "-- Asteroid 2" like this:






25.
Now lets type the command to add an asteroid, and pick some values for the new asteroid.
I'll use coordinates 2000, -2000 and energy 0.8, strength 0.6, speed 0.9.






26.
To save some time, I'll copy and paste the commands I used on the previous asteroids.






27.
Now I'll change the values around a bit to make the asteroid the way I want it:






28.
Now lets save the level, load it up, and check out the new roid! :D







29.
There are some other nifty commands you can use in LevelSetup.
A really handy one is SetBackdropColour() which lets you change the background colour using 3 comma-seperated RGB values between 0 and 255.
Lets make the background red!






30.
And the fruits of our work so far....







31.
Maybe you noticed by now that the asteroid positions don't seem to be quite right.  Because of their large size the game is squashing them apart.
To prevent this behaviour, add this line to each of your asteroids:






32.
Save the level and try playing it.  Now the asteroids are positioned exactly where we specified them in our coordinates.  :>

« Last Edit: February 09, 2010, 03:29:01 AM by annikk.exe »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #3 on: February 07, 2010, 06:31:06 AM »
33.
We have been studying the section called function LevelSetup(), which deals with the creation of the level and all the initial conditions.

Now it's time to have a look at the function LevelLogic() section.  This section lets you make things happen during play, such as scripted events.






34.
To begin with, lets make a Message Box appear after 5 seconds of game time has passed.
The messagebox could contain a greeting, and instructions for the player.


Add this code:
(click to show/hide)




Load up the level to test it out:





35.
So what happened there?  Lets think about this for a minute before we move on.

a.
Well, first we created a variable called Timer (case sensitive!).

We set it to Game Time + 5, and since it is the first thing the game evaluates once it's running, Timer must have a value of 0:05 seconds.


b.
Then we used something called a While loop to create a delay.

We told the game, while the game time is less than Timer, just keep repeating these commands.


c.
The part which tells it the loop has ended is the coroutine.yield() command.

This command tells the game the loop has ended and the game should go back up and check if the conditions of the While statement are still being met.

We don't have any commands in between our While statement and our coroutine.yield().  So basically the game just does nothing for 5 seconds. :>


d.
Once the 5 seconds are up, the While loop exits at the end statement.



e.
Then next thing that happens is that the game pauses, a Message Box appears, and when the player clicks OK, the game unpauses again.





Look at the commands and read over this part a few times if you need to.  It is helpful if you can conceptualise what is going on here.




36.
The level is a bit easy at the moment.  Lets add a scripted event where a bunch of enemy seedlings spawn on Asteroid 1.
I'll make mine 20 seconds after the Message Box appears, and I guess I'll add about... 400 seedlings.
You might notice I've started adding comments as well, to remind myself what each part does later on.



Did you notice we used the :AddSeedlings command in LevelSetup() too?  Most of the commands used there are also usable here.  In this case, we weren't able to refer to it by a name like "a" because "a" had been replaced with a different asteroid, so instead we just tell the game which asteroid we mean with GetAsteroid(ID).  Hence, GetAsteroid(1):AddSeedlings(400) is the command to add 400 seedlings to asteroid 1.




37.
Lets save the level and see if the the enemies spawn correctly. :>







38.
If you would like to make it even more interesting, you can add the following line after:

GetAsteroid(1):SendSeedlingsToTarget(2,400,GetAsteroid(0))

This sends seedlings from Asteroid 1, belonging to player 2... it sends 400 of them, to Asteroid 0.





39.
At the moment, if the player takes over all the asteroids, the game just continues running.  There is no way to "win".

We will create a winning condition and a losing condition, so that the game can actually be won or lost by the player.

Add this code:
(click to show/hide)



There are three new things here.

Quit(true) means the game ends and the player won.
Quit(false) means the game ends and the player lost.

If and then statements.  These check if something is true, and if so, does something.
So if the variable gamewon is equal to 1, then the player is told they have won and the game ends in victory.
But if the variable gamewon is equal to 2, it skips the first If statement and proceeds to the second If statement... resulting in the player being told they have lost, and the game ending in defeat.

You might also notice that in some places we use a single "=", and in other places we use the double: "==".
A single equals sign "=" is used to set values, whereas the double "==" is used to compare values.




40.
Now that we have created the winning and losing code, we need to have some way to trigger the victory or defeat.
For this example, we will say that if Player 1 gets asteroid 1, the player wins (gamewon = 1).  And if Player 2 gets Asteroid 0, the player loses (gamewon = 2).

The easiest way to check this is to use an entirely new function - seperate entirely from function LevelLogic - this new one is called function OnAsteroidTaken, and we place it below everything else.

Add this code:
(click to show/hide)





41.
function OnAsteroidTaken is triggered every time an asteroid changes owner.
We can put If statements in there to check the asteroid and the owner, and if appropriate, change the gamewon variable to either 1 or 2.

Once we change the gamewon variable to something other than 0, the While loop that we made in our function LevelLogic() for the victory/defeat code ends.  Straight after that loop ends, the gamewon variable is evaluated to see whether the player lost or won.  Go and look again at the code in step 39 and make sure you understand how this works.


Now you should understand the mechanism of our victory/defeat detection system.


Lets give it a try:









42.
Now you know enough to begin making your own levels.
I hope you will read the LUA Scripting Reference as well and see all the crazy things it's possible to change in this game, and let your imagination run wild :>


Happy coding,
-Fluffy
« Last Edit: February 09, 2010, 03:22:53 AM by annikk.exe »

cinemabaroque

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
Re: Guide to making levels for Absolute Beginners
« Reply #4 on: February 07, 2010, 07:16:40 AM »
I would also recommend using the SciTE text editor which has a lot of Lua functionality.  If you are running windows you can go to http://luaforwindows.luaforge.net/ and download Lua for Windows which has SciTE and other Lua documentation and examples as well as a Lua command line which is sometimes useful for testing out scripts before you drop them into your game.

It has tabbed windows and color coding specific to Lua.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #5 on: February 07, 2010, 07:46:28 AM »
yeah I use Notepad ++ which I highly recommend.  Does basically the same thing you are describing.  If you are getting serious with your level design it's highly recommended to get one of these programs.  :>

But I felt for a basic guide, advanced text editors were maybe a bit beyond the necessary scope..

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #6 on: February 08, 2010, 02:12:56 AM »
Feedback on this would be great :>

Rudolf

  • Administrator
  • Old Oak
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 13
  • Posts: 669
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #7 on: February 08, 2010, 02:43:56 AM »
This is an extremely useful level creation guide, many thanks to annik for putting things together. The key thing is to try to replicate these kinds of typical level functionality in a few tryout levels, so you really understand what is going on, and then start to make your own variations. Then you can start to study all the additional things you can do, for example as descibed in the scripting reference thread. (http://www.dyson-game.com/smf/index.php?topic=212.0)

I think this is really going to help loads of people Annik, we should try to get this content on ModDB as well and invite some modders over :-)
I will mail you about this!

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #8 on: February 08, 2010, 03:40:52 AM »
Thanks.  Am still proof-reading/editing.  I replied to your email. :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #9 on: February 09, 2010, 03:40:49 AM »
Just made another raft of changes to it, trying to clarify some bits... changed the greeting text to make more sense with the winning conditions, etc

If anyone is super-bored and happens to be reading through this and notices any continuity errors or anything, please let me know.  :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #10 on: February 15, 2010, 01:21:23 PM »
This has been posted on moddb.com now, but it's still awaiting authorisation.

BC wins

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 39
Re: Guide to making levels for Absolute Beginners
« Reply #11 on: August 12, 2010, 07:07:03 AM »
@annikk.exe



Much much thanks for this guide i really am glad there are great people like you sharing their lvl making wisdom :D  ;D
i noticed some things that were unclear so if i get the time i'll make a list of feedback on the guide :)
thanks again for the guide, us dummies (in lvl making) are really helped by this :D.
Gonna have some lvl fun now :D

P.S. : i worked trough the guide making the lvl (playing around with some values :P).
I got everything to work except for the sending of the reinforcements
the spawning of those 400 seeds and the sending is at the same time and because of that dyson sends all seedling at the planet and then spawns 400.
The result is that only 100 ( the starting ones) seedlings are send at your planet and the 400 reinforcements stay at the enemy's planet.
I tried fixing it by setting a new timer but then it first wait's like 5 seconds before it sends those 400
 ??? ??? ???

BC wins
« Last Edit: August 13, 2010, 05:40:56 AM by BC wins »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #12 on: August 15, 2010, 08:18:30 AM »
Can you post your code, BC?  I'll have a look :>


By the way, is it ok if I post my reply to your PM on the forum?  Then others can benefit from it too :>

BC wins

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 39
Re: Guide to making levels for Absolute Beginners
« Reply #13 on: August 16, 2010, 08:15:47 AM »
ofcourse :)
i'll post a spoiler in that topic :)

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #14 on: August 16, 2010, 04:04:20 PM »
BC's PM and my reply:



Quote
Hi Smiley
i read your guide and made the level ready to make some of my own but for that i am wondering what those global values mean

-- Set Global Values
   Globals.G.Asteroids=(0)
   Globals.G.EnemyFactionsMin=(1)
   Globals.G.EnemyFactionsMax=(1)

you don't explain that in your guide

BC wins


Hi BC,

I'll explain each one :>


Code: [Select]
   Globals.G.Asteroids=(0)
This is the "global minimum number of asteroids".  If you don't specifically create more than this number of asteroids, the game will automatically create some for you.

So for example if you used the a = AddAsteroidWithAttribs(1000,1000,1,1,1) command (those values are just examples) and you used it to make three asteroids, but you set the Globals.G.Asteroids value to be 5, then when you load the game, there will be 5 asteroids there - two of them auto-created by the game due to the Global setting.



Code: [Select]
   Globals.G.EnemyFactionsMin=(1)
The minimum number of enemy factions.
If you don't give any asteroid to the enemy faction and this is set to 1 (like in the above example), the game will automatically make one of the asteroids an AI asteroid, and add some seedlings for it.


Code: [Select]
   Globals.G.EnemyFactionsMax=(1)
Continuing on from the logic above, if you set the Max value to 5, the game would create between 1 and 5 AI player asteroids like the one mentioned above.


The reason these are set to 1, is that in the example map in the beginner's guide, there is one enemy faction.  Since we specifically add this faction, these settings mean no additional AI asteroids are added.


Hope this explains it.  :>

BC wins

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 39
Re: Guide to making levels for Absolute Beginners
« Reply #15 on: August 16, 2010, 09:05:34 PM »
thanks :)
it does
it also explains how a random number of greys appeared on an asteroid i made :)
thx

BC wins

bryseron

  • Seed
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
Re: Guide to making levels for Absolute Beginners
« Reply #16 on: November 04, 2010, 07:51:35 PM »
Very nice tutorial, thank you for taking the time to do so!  I've played around with some of the settings from your example, quite interesting to change the values.  Will mess around with some of the AI stuff later, hope to make a basic level eventually.  And I have no coding experience, you explained it all very well.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #17 on: November 04, 2010, 10:09:24 PM »
Glad to hear this :>  Good luck!  Let us know how you are getting on.. :>

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Guide to making levels for Absolute Beginners
« Reply #18 on: November 08, 2010, 03:00:20 AM »
Very nice tutorial, thank you for taking the time to do so!  I've played around with some of the settings from your example, quite interesting to change the values.  Will mess around with some of the AI stuff later, hope to make a basic level eventually.  And I have no coding experience, you explained it all very well.

i had absolutely zero experience too. and im on my 7th level! it is rather gripping sometime when you get into the design aspects and the fact that you can make anything you like..anything... fun! :) keep playing around - you'll land yourself with a good level, then you can let us lot have a go at it...
:)

AWS

pigpenguin

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
Re: Guide to making levels for Absolute Beginners
« Reply #19 on: December 31, 2010, 04:26:22 AM »
Hello every body I have been lurking round this forum for a while and finally decided to try my hand at making maps. So naturally I started by simply copying and pasting the code from the beginning saved as a .lua and went to go test. Unfortunately I keep getting this error message "[string "chunk"]:1: instant method 'AddSeedlings' requires a non null target object" any one know whats causing this?

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #20 on: December 31, 2010, 05:23:28 AM »
Hello and welcome ! :D

I am super-stoked to see new level designers starting.  :>
I will do my best to help..

Code: [Select]
function LevelSetup()

-- Set Global Values
Globals.G.Asteroids=(0)
Globals.G.EnemyFactionsMin=(1)
Globals.G.EnemyFactionsMax=(1)


-- Asteroid 0 - starting asteroid
a = AddAsteroidWithAttribs(0,0, 0.7,0.6,0.5)
a.Owner = 1
a.TreeCap = 1
a:SetRadius(250)
a.SendDistance = 2500

a:AddSeedlings(90)


-- Asteroid 1
a = AddAsteroidWithAttribs(2000,0, 0.3,0.3,0.3)
a.Owner = 2
a.TreeCap = 2
a:SetRadius(450)
a.SendDistance = 2500

a:AddSeedlings(100)

end



function LevelLogic()

end


Is this the code you mean?  I tried it just now and it didn't seem to produce any error messages..

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #21 on: December 31, 2010, 05:28:13 AM »
The error message means roughly "hey, what is going on?  I can't add seedlings to something that isn't an asteroid.."

It's a response to a command to Add Seedlings to some asteroid.  Evidently the asteroid as referenced does not exist, which is why the error message talks about it being "nil".
Nil is the default value of all variables before it they have been declared.  Nil is different to 0, which is an integer or float with value 0, as opposed to Nil which means "no value".

I suspect what is going on is that you have a line like this:

Code: [Select]
a:AddSeedlings(20)
But you haven't created an asteroid to be called "a".  So it's trying to add seedlings to something that it doesn't know what it is.... if that makes sense.  :>

So it throws that error message up.


The code in the guide should be correct.  Did you type it out yourself, in which case did you maybe forget a line or something?
« Last Edit: December 31, 2010, 05:34:29 AM by annikk.exe »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #22 on: December 31, 2010, 05:35:35 AM »
By the way, until about January 5th you can expect responses to any questions within about 1 hour...  ^_^

pigpenguin

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
Re: Guide to making levels for Absolute Beginners
« Reply #23 on: December 31, 2010, 06:00:56 AM »
Thanks for the help (way faster then on any other forum I have been on usually a day :P) any way I did it both ways  typed it out and copied it :/
Word for word the code i have is this

Code: [Select]
function LevelSetup()
--Set Global Values
Globals.G.Asteroids=(0)
Globals.G.EnemyFactionsMin=(1)
Globals.G.EnemyFactionsMax=(1)


--Asteroid 0 - starting asteroid
a = AddAsteroidWithAttribs(0,0, 0.7,0.5,0.4)
a.Owner = 1
a.TreeCap = 4
a:SetRadius(250)
a.SendDistance = 2500

a:AddSeedlings(90)

--Asteroid 1
a = AddAsteroidWithAttribs(2000,0, 0.2, 0.2, 0.2)
a.Owner = 2
a.Treecap = 2
a:SetRadius(450)
a.SendDistance = 2500

a.AddSeedlings(10)

end

function LevelLogic()

end

I looked and I don't see a missing line or a misspelling :/

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #24 on: December 31, 2010, 06:07:42 AM »
Code: [Select]
a.AddSeedlings(10)
This bit is wrong.  :>

It should be a colon, not a full stop.  :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #25 on: December 31, 2010, 06:10:23 AM »
Working now? :D

If not, can you attach the lua file to your next reply please :>

pigpenguin

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
Re: Guide to making levels for Absolute Beginners
« Reply #26 on: December 31, 2010, 06:10:53 AM »
Haha oops :P sorry I missed that part weird though I dunno why when I copied and pasted it didn't work... Yeah I have a map :D Its as amazing as when I got a hello world out of c++ :D

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #27 on: December 31, 2010, 06:16:05 AM »
w00t :>

Let us know how you're getting on! :D

pigpenguin

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
Re: Guide to making levels for Absolute Beginners
« Reply #28 on: December 31, 2010, 06:24:07 AM »
Haha alright messing around with all the variables (1000 seedlings sounds like enough :P) How ever i tried to add a third asteroid under owner three and it spawned seedlings and fought owner 2 but it was the same colour as owner 2. Does it default red unless you tell it other wise?

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #29 on: December 31, 2010, 06:25:52 AM »
The colours are random each time you play.  Unfortunately sometimes different empires spawn with very similar colours, and it can be hard to tell them apart.
To avoid confusion, try turning on Team Symbols in the Eufloria Options menu :>


I have a plan to possibly build a module that coders can simply copy and paste into their levels that would allow you to choose a specific colour for each empire.  However, I've not started writing it yet, and there are many obstacles.  Watch this space :>

Rudolf

  • Administrator
  • Old Oak
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 13
  • Posts: 669
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #30 on: December 31, 2010, 07:37:55 AM »
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. :-)

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #31 on: December 31, 2010, 07:44:19 AM »
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: 139
  • -Receive: 12
  • Posts: 670
  • Eufloria: Yes
Totally [OT] nonsense
« Reply #32 on: December 31, 2010, 10: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

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Totally [OT] nonsense
« Reply #33 on: December 31, 2010, 10: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, 11: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, 12:43:38 PM »
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, 12:50:16 PM by pigpenguin »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #36 on: December 31, 2010, 12:49:49 PM »
-- 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, 12:53:30 PM 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, 12:55:57 PM »
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: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #38 on: December 31, 2010, 01:03:26 PM »
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, 01:04:29 PM »
sweeeeeet thank you

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #40 on: December 31, 2010, 01:05:27 PM »
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, 01:47:09 PM »
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, 01:53:48 PM by pigpenguin »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #42 on: December 31, 2010, 02:13:49 PM »
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: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #43 on: December 31, 2010, 02:16:33 PM »
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, 02:20:29 PM »
haha see yah thanks for the help :P i will prolly be asleep when you get back only 10:00 here

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Guide to making levels for Absolute Beginners
« Reply #45 on: January 01, 2011, 08:39:24 AM »
\ And Eufloria looks soooo stunning on my new plasma TV.

pics?? ;D

Avaguard

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 40
Re: Guide to making levels for Absolute Beginners
« Reply #46 on: January 26, 2011, 03:38:23 AM »
okay currently making a map............. i just gotta get this global stuff right   :-\

Widget

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 97
Re: Guide to making levels for Absolute Beginners
« Reply #47 on: January 26, 2011, 06:19:55 AM »
I've finally got round to going through this and it's a brilliant tutorial, you're a great teacher annikk  ;)

Once I've found some time for a couple of "levels" (to make sure I properly understand the concepts in here) I'll move on and see how I do with your intermediate guide. Thankyou for all this work. I wouldn't have considered looking at the level making process without your guides here.

Bonobo

  • Achiever
  • Old Oak
  • ****
  • Thank You
  • -Given: 139
  • -Receive: 12
  • Posts: 670
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #48 on: January 26, 2011, 08:45:31 AM »
Okay then, here I am.

As you may remember, I’m on an iMac, and when I play Eufloria, it is in a Parallels Desktop Virtual Machine w/ Vista. For now I’d like to stay with TextWrangler, a free Mac coding editor I’m already quite comfortable with. Lua colouring etc. included.

And now, when saving the first file, I have other choices than in step 8 your first post. Please see attached images:

1st image shows the settings as I have copied them from a level of yours.
2nd image shows the line break options
3rd image shows encoding options

Since I copied the options in the 1st image from your file I guess all is well, but [s|being a perseedtionist[/s] I just want to be sure.

OK or not OK?

TIA, Tom


<edit>

BTW <brag mode> I copied all the code by hand, didn’t cut’n’paste. I mean, IF I want to learn it’s best to train my fingertips’ nerve connection to brains, right? Once I’ve understood some more THEN I can make me my macros etc., I know how to do THAT. </bragmode> <back to humble coding n00b>

</edit>
« Last Edit: January 26, 2011, 08:52:02 AM by Bonobo »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #49 on: January 26, 2011, 10:31:33 AM »
okay currently making a map............. i just gotta get this global stuff right   :-\

Post up with any specific problems you are having and I'll see if I can help out.  :>  It's quite tricky getting started, don't worry, everyone has the same problems including me when I started.  :>
All the global commands are listed here and if you want to see what the default values are, just open up "default.xml" in a text editor.  You can find this file in your Eufloria folder.




I've finally got round to going through this and it's a brilliant tutorial, you're a great teacher annikk  ;)

Thanks! :D


Quote
Once I've found some time for a couple of "levels" (to make sure I properly understand the concepts in here) I'll move on and see how I do with your intermediate guide. Thankyou for all this work. I wouldn't have considered looking at the level making process without your guides here.

It's great to hear that.  :>  Obviously the purpose of writing the tutorials was to encourage more people to start making levels.  Looking forward to seeing your first initial experiments!



Okay then, here I am.

About time! ^_^

Quote
As you may remember, I’m on an iMac, and when I play Eufloria, it is in a Parallels Desktop Virtual Machine w/ Vista. For now I’d like to stay with TextWrangler, a free Mac coding editor I’m already quite comfortable with. Lua colouring etc. included.

Sounds good.  :>


Quote
And now, when saving the first file, I have other choices than in step 8 your first post. Please see attached images:

1st image shows the settings as I have copied them from a level of yours.
2nd image shows the line break options
3rd image shows encoding options

Since I copied the options in the 1st image from your file I guess all is well, but [s|being a perseedtionist[/s] I just want to be sure.

OK or not OK?

Hmm, you know, I'm really not sure.  I always used Ansi in Notepad, but I just checked and Notepad++ gives no such option.
I suppose one way to find out would be to open one of the level files that have been posted on these forums, and see what the settings for that are.
The other method would just be to try random settings until you find something that works.  :>

The settings you have in the screenshots look like they would probably work fine.  Whatever the default settings were is likely to be fine, I'd imagine.  :>


Quote
<edit>BTW <brag mode> I copied all the code by hand, didn’t cut’n’paste. I mean, IF I want to learn it’s best to train my fingertips’ nerve connection to brains, right? Once I’ve understood some more THEN I can make me my macros etc., I know how to do THAT. </bragmode> <back to humble coding n00b>

hehe, it's funny, a lot of people seem to want to do that.  :>  I guess it is good practice, getting used to writing things out in the correct syntax.  However, it does also mean that your initial maps are prone to throwing up errors - one minor typo like a comma instead of a full stop can cause the whole thing to not work.  If you have any problems with the code from the initial steps of the demo crashing, I'd recommend just using the copy and paste method so that you don't get stuck on the early steps.  Don't worry, there will be lots of opportunities to type out code by hand later on, I assure you!!

Avaguard

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 40
Re: Guide to making levels for Absolute Beginners
« Reply #50 on: January 27, 2011, 04:21:37 AM »
okay map is doing ok........ quick Question how do u make 1 specific asteroid reach all mainly just trying to get the send distances right on things :P

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #51 on: January 27, 2011, 04:57:06 AM »
During LevelSetup(), you will have code for each asteroid that looks something like this:


Code: [Select]
a = AddAsteroidWithAttribs(0,0,0.6,0.4,0.2)
a.owner = 1
a.radius = 500
a.SendDistance = 1500
a.TreeCap = 0
a.Name = "Fluffy"

a:AddSeedlings(50)


Find the asteroid that you want to be able to reach everything, and just change "a.SendDistance" to something big, like 10000.
If you don't have a Send Distance command, add one! :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #52 on: January 27, 2011, 06:17:20 AM »
Is that what you meant?

Avaguard

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 40
Re: Guide to making levels for Absolute Beginners
« Reply #53 on: January 27, 2011, 06:55:45 AM »
TY got it 1 mo thing what kind of AI command is it or how much. to make the enemy send all available ::) seedlings to attack u

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #54 on: January 28, 2011, 02:02:34 AM »
It must be ANSI, not UTF-8. That was one of the major problems I had with EUCLiD (which is still going, by the way) at the beginning.

I think. Fairly certain.

EDIT:

http://www.dyson-game.com/smf/index.php?topic=830.msg4956#msg4956

Avaguard

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 40
Re: Guide to making levels for Absolute Beginners
« Reply #55 on: January 28, 2011, 06:04:02 AM »
hmmm well Never mind i know that it will take me for ever to do this my map do to my intellect IL just try to make it differen

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #56 on: January 28, 2011, 07:00:10 AM »
TY got it 1 mo thing what kind of AI command is it or how much. to make the enemy send all available ::) seedlings to attack u

There's not really any commands that tell the ai directly what to do, but there are various global settings you can adjust to change the overall ai behaviour.

Alternatively you can use the sendSeedlingsToTarget command on specific asteroids to force those seedlings to attack. It sounds like that might be the most suitable approach for your level.
The guide shows you how to do this in the closing steps. Let me know if you need a hand with it. :>

Widget

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 97
Re: Guide to making levels for Absolute Beginners
« Reply #57 on: January 29, 2011, 12:09:16 AM »
I've been intending to bodge together a very basic level with a (hopefully!) interesting layout. Pitched to my ability as a total novice, basically. The trouble I'm having is figuring out the values for the layout.

I've found to my relief that I can remember enough Pythagorean theorems to calculate some of the location values based on the intended distance between asteroids but I'm having trouble visualising what I'm working towards. Other than buying some graph paper to plot things out on (which I'll be doing this weekend) are there any tips anyone could offer to help me along?

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #58 on: January 29, 2011, 01:15:19 AM »
It's usually best to sit and draw out your idea on paper.  I find that helps a lot.


A way to do it visually would be to just chuck the right number of asteroids in, then play the game and turn on Developer Mode, move the asteroids to the right positions from the console, then record the positions and use those in your LevelSetup.

Turn on Developer Mode with CTRL-D.
Press F12 to show the Asteroid ID numbers.

Now open up the console by pressing tilde (`), which is the key to the left of "1".

You should now be able to fire commands directly into the game, and see the results immdietately.
For example, if you notice that Asteroid 1 is too far to the west, you can move it by typing this command into the console:

Code: [Select]
GetAsteroid(1):MoveBy(500,0)
That would move it slightly east.  :>

You can use those commands on all the asteroids until you're happy with the visual layout of the level.
Now it will be time to record the positions of everything so that you can put those coordinates into your levelsetup, so they will load in these positions from now on.
To do that, use these commands:

Code: [Select]
MessageBox(GetAsteroid(1).position.x)
Code: [Select]
MessageBox(GetAsteroid(1).position.y)
That will tell you the X and Y of each asteroid.  Just edit the initial X and Y of each asteroid in your LevelSetup so that it corresponds to this.

Slightly long winded but if you _need_ to see it visually this method might work good for you!
« Last Edit: January 29, 2011, 01:18:29 AM by annikk.exe »

Widget

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 97
Re: Guide to making levels for Absolute Beginners
« Reply #59 on: January 29, 2011, 01:19:31 AM »
Thankyou! I'll try that out and see if I find that more intuitive than the alternative  :)

Avaguard

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 40
Re: Guide to making levels for Absolute Beginners
« Reply #60 on: January 29, 2011, 09:21:30 AM »
Okay very near to being done  :D  ;D but  :P still got some more to do thought

Avaguard

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 40
Re: Guide to making levels for Absolute Beginners
« Reply #61 on: January 29, 2011, 10:05:55 AM »
LAST question ... (maybe) how do i make all the asteroids visible  :P

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #62 on: January 29, 2011, 01:45:37 PM »
Code: [Select]
GetAsteroid(0):Reveal(1)
That makes asteroid 0 visible to player 1.  :>

You can either do a whole bunch of those commands at the end of your LevelSetup or the start of your LevelLogic, or a possibly better way of doing it is to just include it when you're declaring your asteroids.
EG:

Code: [Select]
a = AddAsteroidWithAttribs(0,0,0.5,0.5,0.5)
a.owner = 1
a.treecap = 3
a.radius = 400
a:Reveal(1)

Avaguard

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 40
Re: Guide to making levels for Absolute Beginners
« Reply #63 on: January 30, 2011, 06:38:38 PM »
MY map is done BUT you never really clarified how to post them :D :P

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #64 on: January 30, 2011, 09:20:53 PM »
Save map as a Lua file, attach it to a post.


Widget

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 97
Re: Guide to making levels for Absolute Beginners
« Reply #65 on: February 03, 2011, 04:49:33 AM »
Blimey, this is getting to be really fiddly... which attributes does the game auto-adjust to make a map playable? Is it only the send distance or will it play with others aswell? Finally, is there any way to stop it doing that other than not setting send distances until everything's in place?

Edit: I think I've answered my own question. I should've hammered down some new values for more objects before I tried to look at send radius, I guess. The only possible issue at this point is the scale of the map. The seedlings were bigger than I assumed so it's already 15k by 18k and probably needs to grow substantially again. Will that sort of size be an issue once the map's more populated? Be a shame to build something that would lag purely due to ignorance  :P

Oh! And thankyou for the rapid reply annikk. I'm sorry for the barrage of really simple questions but you've been an enormous help.
« Last Edit: February 03, 2011, 05:08:38 AM by Widget »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #66 on: February 03, 2011, 05:06:23 AM »
Quote
which attributes does the game auto-adjust to make a map playable?  Is it only the send distance or will it play with others aswell?

If you've set a.Moveable = false, then it will only adjust the send distance.
If a.Moveable = true or if you don't specify it one way or the other, it will adjust send distance and the X/Y coordinates of the asteroid.


Quote
Finally, is there any way to stop it doing that other than not setting send distances until everything's in place?

My preferred method is to set my Send Distances at the top of LevelLogic, before my while GameRunning() do loop starts.  :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #67 on: June 18, 2011, 12:25:10 AM »
Okay then, here I am.

How did you get on with this in the end, Bonobo? :>
As you're not churning out maps I'm guessing your progress faltered along the way at some point.  Did you just get tired of it, or did you get stuck on something specific?  Lots of support is available if you ever want to give it another try.. :>

Bonobo

  • Achiever
  • Old Oak
  • ****
  • Thank You
  • -Given: 139
  • -Receive: 12
  • Posts: 670
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #68 on: June 18, 2011, 01:17:58 AM »
Dear Annikk,
How did you get on with this in the end, Bonobo? :>
Although my nickname is “Bonobo” I’d prefer you & folks call me Tom :)

Quote
As you're not churning out maps I'm guessing your progress faltered along the way at some point.  Did you just get tired of it, or did you get stuck on something specific?
I got stuck in Real Life (as you may have read in some other thread, thrombosis and stuff). And although I still read every post here, it’s been over one or two months that I’ve played Eufloria … it’s annoying me always having to fire up Parallels Desktop to play it; starting the Windows VM is a PITA, takes half an hour sometimes, I don’t have the time and patience for this. After it’s up, the Windows VM runs fine & fast, but the wait for everything is not fine. I may be more motivated once a Mac OS X version is out … though then there still will be the Real Life issue.

Quote
Lots of support is available if you ever want to give it another try.. :>
Thank you, Annikk, I know this forum and all you fine folks are VERY helpful and friendly, I guess that’s what keeps me reading here even if I am not currently playing.

BTW I’ll have an iPad 2 soon, one of my clients thought it might be a nice idea to give me one for my Mac support <happy happy joy joy> I wonder whether that version, once it comes out, will also allow to load user-generated maps and whether the maps you guys are churning out here will be compatible …

And, Annikk, thanks for remembering me and for asking, I’m touched :)

Greetings, Tom

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #69 on: June 18, 2011, 01:54:13 AM »
I don't remember reading about the thrombosis. Are you okay now?

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #70 on: June 18, 2011, 02:01:25 AM »
Real Life? Tried that game, it sucks...

Jk :P

Bonobo

  • Achiever
  • Old Oak
  • ****
  • Thank You
  • -Given: 139
  • -Receive: 12
  • Posts: 670
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #71 on: June 18, 2011, 07:38:27 AM »
I don't remember reading about the thrombosis. Are you okay now?
Well … they say I’ll have to wear these friggin compression stockings until EOL  >:( and the thrombosis will stay; I could be lucky if it dissolves by time. Currently I must inject some Heparin derivate (leech juice, sort of) twice daily <graaaaah> and this while I abhor injections. And worse, they want to switch me to Marcumar, another anticoagulant whis IMHO is an elixir of the devil. But I guess I’ll have to take it, anything is better than getting another thrombosis or, even worse, pulmonary embolism or the like.

But what I can tell you all: DON’T SIT TOO MUCH, don’t sit too long, MOVE at least once an hour, DO NOT SIT WITH LEGS CROSSED cause it interrupts the bloodflow. And, well, don’t smoke <cough>. You definitely don’t want to wear these stockings.


Real Life? Tried that game, it sucks...

Jk :P
:D As long as one has not yet set their own controls settings, shortcuts and all.

- DON’T LIVE WITH DEFAULT SETTINGS!

- NO CHEATS! Won’t work.

- Overclocking is harmful.

<nk>

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #72 on: June 18, 2011, 07:43:55 AM »
Good advice and rulles, Tom :P

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #73 on: June 18, 2011, 09:31:55 AM »
Hello Tom :>

Quote
I got stuck in Real Life (as you may have read in some other thread, thrombosis and stuff).

I have to admit, I completely had not noticed/heard anything about that...  I'm sorry to hear about the rough time you are having :/  I don't blame you for not playing Eufloria much.  I can imagine it would be the last thing on my mind, were I in your position.


Quote
I know this forum and all you fine folks are VERY helpful and friendly, I guess that’s what keeps me reading here even if I am not currently playing.

I think it's as supportive as it is because we're still such a small community... those that actually do some coding.. so we're always very eager to help when someone starts learning how to do it.  :>
Maybe we'll get more coders once the PSN thing goes live, hopefully we'll be able to retain the supportive atmosphere though.

Quote
BTW I’ll have an iPad 2 soon, one of my clients thought it might be a nice idea to give me one for my Mac support <happy happy joy joy> I wonder whether that version, once it comes out, will also allow to load user-generated maps and whether the maps you guys are churning out here will be compatible …

I hope levels have cross-platform compatability too!  We should really ask A&R about that to be honest..

Quote
And, Annikk, thanks for remembering me and for asking, I’m touched :)

No worries :>

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #74 on: June 26, 2011, 08:06:07 AM »
I really hope a wild map coder appears soon D:

The forums could need it, And I'm quite annoyed by the amount of guests but no users too, but I don't really mind it either... I like to talk: maybe noticed xD
(click to show/hide)

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #75 on: June 27, 2011, 09:53:27 AM »
Annikk: Add the console error message... Just atleast notify it on the first page!

This way, it might not bug every guest map creator or so :)

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #76 on: June 27, 2011, 04:20:32 PM »
Yes that is a good idea.  I should do a whole section on troubleshooting really.

In the mean time, to anyone wondering, the tilde key (`) opens the console, where some error messages are displayed... and CTRL-D enables developer mode, allowing you to use F1-F12 for different useful functions.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #77 on: July 05, 2011, 10:39:24 PM »
Planning to update this soon.

The new version will have the following changes:

1.  Will direct people who finish the basic guide to the troubleshooting and intermediary guides.
2.  Will teach the While GameRunning() do method of creating win/loss conditions, timed message boxes, etc.
3.  Will explicitly mention in the beginning that code is executed top-to-bottom, line-by-line.
4.  Reduce number of globals in the sample map to the absolute bare minimum.
5.  Explicitly mention Notepad++ about halfway through, continue the second half of the guide using Notepad++.
6.  Encourage people to copy and paste the initial code, rather than trying to type it themselves "to get used to it", and inevitably making a typo which prevents the level loading.
7.  Introduce the Fluffy character better.  :>
8.  More humour.
9.  Introduce "a" as "a variable" rather than "sort of like the name".  Explain variables.
10.  Spend some time trying to convince people that "basic" levels are really cool, and they should make some of those and release them to get very comfortable with the basics of coding, before trying anything crazy.
11. Briefly explain what comments are.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #78 on: July 05, 2011, 10:45:30 PM »
Ok the only global that seems to be needed 100% is Globals.G.Asteroids


Here is the minimum code:

Code: [Select]
function LevelSetup()

-- Set Global Values
Globals.G.Asteroids=(0)



-- Asteroid 0 - starting asteroid
a = AddAsteroidWithAttribs(0,0, 0.7,0.6,0.5)
a.Owner = 1
a.TreeCap = 1
a:SetRadius(250)
a.SendDistance = 2500

a:AddSeedlings(90)


-- Asteroid 1
a = AddAsteroidWithAttribs(2000,0, 0.3,0.3,0.3)
a.Owner = 2
a.TreeCap = 2
a:SetRadius(450)
a.SendDistance = 2500

a:AddSeedlings(100)

end



function LevelLogic()

end

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #79 on: July 06, 2011, 12:15:20 AM »
Looking good :)

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #80 on: July 06, 2011, 02:10:55 AM »
2.  Will teach the While GameRunning() do method of creating win/loss conditions, timed message boxes, etc.
Also, you may want to mention that OnAsteroidTaken() can be used, particularly for conquest maps, and is easier on CPU time.


5.  Explicitly mention Notepad++ about halfway through, continue the second half of the guide using Notepad++.
Don't forget other ones around. I always find N++ crashes. Programmers Notepad is good too, though not as feature-rich as N++.


8.  More humour.
Always good.

10.  Spend some time trying to convince people that "basic" levels are really cool, and they should make some of those and release them to get very comfortable with the basics of coding, before trying anything crazy.

YES!

Enola

  • Guest
Re: Guide to making levels for Absolute Beginners
« Reply #81 on: July 17, 2011, 10:04:03 AM »
This is what I need, thank you for sharing.

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #82 on: July 17, 2011, 05:54:38 PM »
Possible bot-feeding, but dump this post when Enola's status is confirmed.

Enola, I denounce thee as a spam bot. Why do you have a link to the Nike site in your sig? That is the only evidence I have, but I'm being cautious.
« Last Edit: July 17, 2011, 06:03:06 PM by Pilchard123 »

Bonobo

  • Achiever
  • Old Oak
  • ****
  • Thank You
  • -Given: 139
  • -Receive: 12
  • Posts: 670
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #83 on: July 17, 2011, 09:24:36 PM »
@Pilchard: I assume you have reported the post?

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #84 on: July 18, 2011, 04:05:11 AM »
Nope, everything else seemed okay...

Location and email were fairly sensible (null and a personal address). The post content was reasonable too, though a little bot-ish...

Evanue

  • Seed
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
Re: Guide to making levels for Absolute Beginners
« Reply #85 on: April 28, 2012, 10:42:34 PM »
It is a ban thing that I can not see the pictures.


 :'( :'( :'( :'( :'( :'( :'(

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
Re: Guide to making levels for Absolute Beginners
« Reply #86 on: May 03, 2012, 06:06:15 AM »
Any chance doing this for the iPad? I'm sure the code is slightly different sometimes, but for a beginner it's hard to start.

EDIT:: Just been messing about, because iPad loads the text differently i'm guessing, because all the text is stored in a lang.csv file.
« Last Edit: May 03, 2012, 06:27:28 AM by Tomfloria »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #87 on: May 07, 2012, 09:16:05 PM »
Buy me an iPad and it's a deal! :>

Actually I think most of this stuff is relevant to iPad too.  I've not done any coding for a long time so I'd need to check out what the new API is like, and what has all changed.

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #88 on: May 07, 2012, 09:33:48 PM »
There's a new API? When was this around?

EDIT: Also, HI! Still no challengers to your AI yet. I'll be working in earnest after my exams are over, so look out.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #89 on: May 07, 2012, 10:06:38 PM »
Well I see there are new built in functions such as IsiOS... so it looks like the API has had an overhaul.  I'm not sure what has all changed.

I think IAI will remain unbeaten for a long time.  It would take a very smart AI to beat it, the model is just very apt for Eufloria..
It's certainly validating every time I come here and it's still king :>

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
Re: Guide to making levels for Absolute Beginners
« Reply #90 on: May 09, 2012, 03:19:40 AM »
It's basic stuff but Annikk, DO ADVANCED GUIDE PLEASE

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #91 on: May 14, 2012, 11:52:55 PM »
There's an intermediate guide.  Have you read that? :>


There is no "guide" to advanced coding.  If you're ready for it, you can start advanced coding by yourself. :>  If you've built levels using all the techniques in the Intermediate guide then you are officially Advanced. :>

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
Re: Guide to making levels for Absolute Beginners
« Reply #92 on: May 15, 2012, 12:53:08 AM »
Yeah i've read that, remember i'm using the iPad version :D limited stuff, but most of you're stuff has really helped me, but i've had to change it to work with ios.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #93 on: May 15, 2012, 01:17:04 AM »
You are the first, Sir.  The first of us coders to write levels for iOS.  I'd say you have every right to call that advanced. :>

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
Re: Guide to making levels for Absolute Beginners
« Reply #94 on: May 15, 2012, 01:32:09 AM »
Really? hahah, wooooo, I wouldn't say it's that different, but I don't like to toot my own horn, I'd prefer to be a beginner thats always learning than a know it all :)

PS - not saying you're a know it all haha

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Guide to making levels for Absolute Beginners
« Reply #95 on: May 15, 2012, 01:53:57 AM »
PS - not saying you're a know it all haha

SHHHHH!

Annikk does know everything, he just pretends to be human!

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
Re: Guide to making levels for Absolute Beginners
« Reply #96 on: May 15, 2012, 02:26:35 AM »
PS - not saying you're a know it all haha

SHHHHH!

Annikk does know everything, he just pretends to be human!

Haha, thats Annikk!

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Guide to making levels for Absolute Beginners
« Reply #97 on: May 15, 2012, 02:39:21 AM »
Shush :p  go read my post about camera transitions. :P

Tomfloria

  • Shrub
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 232
Re: Guide to making levels for Absolute Beginners
« Reply #98 on: May 15, 2012, 03:04:54 AM »
I've read it, I'm waiting till i've implimented it before I reply, Just need to finish my 6th level then I'll add it to my first level. :P

SweetCandyGrimm

  • Grimm
  • Shoot
  • *
  • Thank You
  • -Given: 1
  • -Receive: 1
  • Posts: 23
Re: Guide to making levels for Absolute Beginners
« Reply #99 on: September 04, 2012, 12:52:37 AM »
just wanted to take back my last post.. i read thru a few others with the same issues and realized i had to scroll the spoiler code. XD just finished the basic run thru... now to start figuring out the actual stuff to make it level worth playing.. wish me luck.. this is my first time scripting :) maybe if i can pick up some of the basics.. i'll look into a college course for it when im finished with me GED (we get actual free classes and cant take the real test till we get a 9.0 on all parts of the TABE, which im thankfull for.. less money being wasted ja kno :D )

and ty annik.exe for all the help.. i've loved Eufloria for a few yrs now.. and to any lo's or lettes around WHOOP WHOOP