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

0 Members and 1 Guest are viewing this topic.

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, 01: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, 12: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: 0
  • Posts: 1,794
Re: Guide to making levels for Absolute Beginners
« Reply #17 on: November 04, 2010, 03: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: 0
  • Posts: 274
Re: Guide to making levels for Absolute Beginners
« Reply #18 on: November 07, 2010, 07:00:20 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.

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 30, 2010, 08:26:22 PM »
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: 0
  • Posts: 1,794
Re: Guide to making levels for Absolute Beginners
« Reply #20 on: December 30, 2010, 09:23:28 PM »
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: 0
  • Posts: 1,794
Re: Guide to making levels for Absolute Beginners
« Reply #21 on: December 30, 2010, 09:28:13 PM »
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 30, 2010, 09:34:29 PM by annikk.exe »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Guide to making levels for Absolute Beginners
« Reply #22 on: December 30, 2010, 09:35:35 PM »
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 30, 2010, 10:00:56 PM »
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: 0
  • Posts: 1,794
Re: Guide to making levels for Absolute Beginners
« Reply #24 on: December 30, 2010, 10:07:42 PM »
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: 0
  • Posts: 1,794
Re: Guide to making levels for Absolute Beginners
« Reply #25 on: December 30, 2010, 10:10:23 PM »
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 30, 2010, 10:10:53 PM »
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: 0
  • Posts: 1,794
Re: Guide to making levels for Absolute Beginners
« Reply #27 on: December 30, 2010, 10:16:05 PM »
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 30, 2010, 10:24:07 PM »
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: 0
  • Posts: 1,794
Re: Guide to making levels for Absolute Beginners
« Reply #29 on: December 30, 2010, 10:25:52 PM »
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 :>