Author Topic: Level help  (Read 2199 times)

0 Members and 1 Guest are viewing this topic.

kmercy

• Seedling
• Thank You
• -Given: 0
• Posts: 34
Re: Level help
« Reply #15 on: July 04, 2011, 01:58:23 AM »
Also how can i get it to randomly generate tree numbers on asteroids cause mines always says 4 for the ones around me -.-
and also i tried making all grays attack an asteroid but failed how would i do that?
« Last Edit: July 04, 2011, 03:01:46 AM by kmercy »

Aino

• Ent
• Thank You
• -Given: 1
• Posts: 1,483
• They'll eat you next!
• Eufloria: Yes
Re: Level help
« Reply #16 on: July 04, 2011, 03:32:44 AM »
About the numbers, were you using developer mode > F12? then it means the level of the tree, you shouldn't mess around the core things of the game? :S

And about the gray, got no idea really :/

kmercy

• Seedling
• Thank You
• -Given: 0
• Posts: 34
Re: Level help
« Reply #17 on: July 04, 2011, 03:49:50 AM »
I mean treecap limit on each asteroid

Aino

• Ent
• Thank You
• -Given: 1
• Posts: 1,483
• They'll eat you next!
• Eufloria: Yes
Re: Level help
« Reply #18 on: July 04, 2011, 03:56:10 AM »
Ok, not that angry now... Treecap limit? there is no real limit, is there?

There is no limit on the treecap, and random is just math.random(val1,val2), but it tends to create very similar numbers, the random is pseudo random, or dependtant on different variables on the computer to make a random value, this might be why you see the same behaviour

Try enlarge the treecap number from 2,4 to 2,20 and see if there are difference, if there is, then you have nothing wrong in the code

Else, we must investigate this closer, despite my depression :/

kmercy

• Seedling
• Thank You
• -Given: 0
• Posts: 34
Re: Level help
« Reply #19 on: July 04, 2011, 04:00:52 AM »
Gonna try set treecap on radius of it now

Aino

• Ent
• Thank You
• -Given: 1
• Posts: 1,483
• They'll eat you next!
• Eufloria: Yes
Re: Level help
« Reply #20 on: July 04, 2011, 04:01:45 AM »
Remember to use math.floor or math.ceil to prevent any crashes or stuff if happening, it may tne dto create decimals...

kmercy

• Seedling
• Thank You
• -Given: 0
• Posts: 34
Re: Level help
« Reply #21 on: July 04, 2011, 04:09:18 AM »
Just used math.random got no crashes tryed it a few times it seems to work sometimes sometimes it 'randomly' doesn't
« Last Edit: July 04, 2011, 04:18:52 AM by kmercy »

Pilchard123

• Tester
• Old Oak
• Thank You
• -Given: 0
• Posts: 899
• Eufloria: Yes
Re: Level help
« Reply #22 on: July 04, 2011, 05:22:01 PM »
Yuo could use a modified rally code to get a massive swarm to attack. Just change the empire ID and the event that triggers it.

annikk.exe

• Achiever
• Ent
• Thank You
• -Given: 0
• Posts: 1,794
Re: Level help
« Reply #23 on: July 05, 2011, 10:09:23 AM »
Treecap limit? there is no real limit, is there?

He means "how do you set the tree cap for each asteroid?"

And the answer is, like this:

Code: [Select]
`GetAsteroid(0).TreeCap = 5`
If you want to randomise it per-asteroid, you would do something like this:

Code: [Select]
`for i = 0,numberofasteroids do GetAsteroid(i).TreeCap = math.random(1,5)end`

annikk.exe

• Achiever
• Ent
• Thank You
• -Given: 0
• Posts: 1,794
Re: Level help
« Reply #24 on: July 05, 2011, 10:25:13 AM »
Quote
i tried making all grays attack an asteroid but failed how would i do that?

If you want the greys at a specific asteroid (EG roid #3) to attack another specific asteroid (EG roid #5) here is how you do it:

Code: [Select]
`GetAsteroid(3):SendSeedlingsToTarget(0,1000,GetAsteroid(5))`
That will send up to 1000 seeds from 3 to 5.

If you wanted to send all the greys on all the asteroids in the level to attack one specific asteroid, EG Asteroid #3, here is how you would do that:

Code: [Select]
`for i = 0,numberofasteroids do GetAsteroid(i):SendSeedlingsToTarget(0,1000,GetAsteroid(3))end`

AWS

• Achiever
• Arboreal Being
• Thank You
• -Given: 0
• Posts: 274
Re: Level help
« Reply #25 on: July 05, 2011, 09:35:11 PM »
Actually, a 'common error messages' section to annikk's bugfixing guide could be useful. Want me to try to write one?

any news on this?

Aino

• Ent
• Thank You
• -Given: 1
• Posts: 1,483
• They'll eat you next!
• Eufloria: Yes
Re: Level help
« Reply #26 on: July 05, 2011, 09:46:12 PM »
any news on this?

I could do it myself, though... I'm not good with explaining long stuff Dx

Aino

• Ent
• Thank You
• -Given: 1
• Posts: 1,483
• They'll eat you next!
• Eufloria: Yes
Re: Level help
« Reply #27 on: July 06, 2011, 02:12:31 AM »
Whats wrong in this code: ??

Code: [Select]
` ReinforcementsAllowed = false CommandoCenterAllowed = false SetBackdropColour(166,146,150) Globals.G.EnemyFactionsMin=(0) Globals.G.EnemyFactionsMax=(0) Globals.G.GreysProbability=0 -- Asteroid 0 a = AddAsteroidWithAttribs(-4002, -3992, 0.9,0.8,0.8) a.Moveable = false a.radius = 1009 a.Owner = 2 a:AddSeedlings(23) a.SendDistance = 8394 -- Asteroid 1 a = AddAsteroidWithAttribs(-1048, -4562, 0.3,0.3,0.2) a.Moveable = false a.radius = 288 a.SendDistance = 2327 -- Asteroid 2 a = AddAsteroidWithAttribs(-1324, -2292, 0.2,0.3,0.3) a.Moveable = false a.radius = 272 a.SendDistance = 3473 -- Asteroid 3 a = AddAsteroidWithAttribs(-4707, -1426, 0.4,0.5,0.4) a.Moveable = false a.radius = 586 a.SendDistance = 2634 -- Asteroid 4 a = AddAsteroidWithAttribs(-7, 7, 0.6,0.6,0.5) a.Moveable = false a.Owner = 1 a:AddSeedlings(35) a.radius = 301 a.SendDistance = 1802 -- Asteroid 5 a = AddAsteroidWithAttribs(-4005, 1012, 0.4,0.5,0.4) a.Moveable = false a.radius = 471 a.SendDistance = 2653 -- Asteroid 6 a = AddAsteroidWithAttribs(-957, 3012, 0.5,0.4,0.4) a.Moveable = false a.radius = 365 a.SendDistance = 4221 -- Asteroid 7 a = AddAsteroidWithAttribs(1640, 2205, 0.5,0.5,0,6) a.Moveable = false a.radius = 363 a.SendDistance = 2817 -- Asteroid 8 a = AddAsteroidWithAttribs(1713, -108, 0.5,0.8,0.5) a.Moveable = false a.radius = 384 a.SendDistance = 2487 SetFlowerDefenseButtonAvailable(false) SetFlowerSeederButtonAvailable(false) StartupText = "Stop n Fight" StartupRed = 0.1 StartupGreen = 0.5 StartupBlue = 0.5 OpeningText = "We have encountered an obstacle in our race for the... Uhh, I never mentioned anything, ok! We have atleast encountered an asteroidbelt, would be nice to capture it!" MapTime = nil Win = "all" AIType = "normal" StartCondition = "Map03" Condition = "Map03" LostMessage = "Our enemy defeated us, try again!" WinMessage = "They were piece of cake to conquer. Let's move on and hope we don't need to crush more enemies though!"`
And yessss, lots of spoils

annikk.exe

• Achiever
• Ent
• Thank You
• -Given: 0
• Posts: 1,794
Re: Level help
« Reply #28 on: July 06, 2011, 09:10:18 AM »
Code: [Select]
`MapTime = nil`
Why is that there?  Did you mean it equals 0?

• Ent
• Thank You
• -Given: 1