Author Topic: Level design/ Code questions from a beginner  (Read 79721 times)

w4tc

  • Achiever
  • Shrub
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 170
Re: Level design/ Code questions from a beginner
« Reply #200 on: August 05, 2010, 04:50:27 AM »
OYEAAA
that is working =D

but :$ i may only change when you it send
now it also change with if there a born seed is
So there must be a way that that can block

Also :$ i have 2 questions :

how can I that Owner 2 or IA should not be moving with his seeds to ohtere roid
i want it only send a seed of owner 1 or with commend like return to fluffy ( your level ) with that waves ect :o

and i tried to make me defent and dysontree to level up but it dont works? :s
here is an example

(click to show/hide)

InTouch

  • Achiever
  • Seedling
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
Re: Level design/ Code questions from a beginner
« Reply #201 on: August 05, 2010, 07:23:52 AM »
Quote from: annikk.exe link=topic=774.msg6072#msg6072 date=
RE King of the hill win condition.


I'm interpreting your requirements to mean the following, if this is not right, please say so:


Asteroid 0 will be the King of the Hill asteroid.

There will be two timers, they are called playertimer and aitimer.

playertimer ticks up for the player (empire 1) for every second they own the asteroid.
aitimer ticks up for the enemy (empire 2) for every second they own the asteroid.
If neither empire 1 or empire 2 own asteroid 0, no timer will tick up.

If playertimer reaches 180 sec, empire 1 (the player) wins, and the game ends.
If aitimer reaches 180 sec, empire 1 (the player) loses, and the game ends.



Is this correct?  Let me know if it is, and I'll show you how to make a win condition like this.  :>



Actually terrial has found the right code for me and we are currently working on a map using it.
I sent you a pm requesting your help with something

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Level design/ Code questions from a beginner
« Reply #202 on: August 05, 2010, 07:35:36 AM »
Replied.  Best of luck if you decide to go ahead without me, or thanks for your patience if not.  :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Level design/ Code questions from a beginner
« Reply #203 on: August 05, 2010, 08:08:43 AM »
OYEAAA
that is working =D

but :$ i may only change when you it send
now it also change with if there a born seed is
So there must be a way that that can block



Ok, try this code instead:


Code: [Select]
while GameRunning() do

for i = 1,4 do
if GetAsteroid(i):GetNumSeedlings(1) > seednumber[i] and GetAsteroid(i):GetNumTrees() == 0 then
SetBackdropColour(0,255,0)
end
seednumber[i] = GetAsteroid(i):GetNumSeedlings(1)
end


for i = 5,7 do
if GetAsteroid(i):GetNumSeedlings(1) > seednumber[i] and GetAsteroid(i):GetNumTrees() == 0 then
SetBackdropColour(155,0,0)
end
seednumber[i] = GetAsteroid(i):GetNumSeedlings(1)
end


for i = 8,14 do
if GetAsteroid(i):GetNumSeedlings(1) > seednumber[i] and GetAsteroid(i):GetNumTrees() == 0 then
SetBackdropColour(0,0,0)
end
seednumber[i] = GetAsteroid(i):GetNumSeedlings(1)
end


for i = 15,33 do
if GetAsteroid(i):GetNumSeedlings(1) > seednumber[i] and GetAsteroid(i):GetNumTrees() == 0 then
SetBackdropColour(0,0,255)
end
seednumber[i] = GetAsteroid(i):GetNumSeedlings(1)
end



coroutine.yield()
end


Not ideal I guess, but hopefully this will do...

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Level design/ Code questions from a beginner
« Reply #204 on: August 05, 2010, 08:12:15 AM »
Quote
how can I that Owner 2 or IA should not be moving with his seeds to ohtere roid

Script it so that when Empire 2 owns the asteroid, its send distance drops to 0.  When Empire 1 owns the asteroid, its send distance goes back to normal.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Level design/ Code questions from a beginner
« Reply #205 on: August 05, 2010, 08:14:54 AM »
Quote
Code: [Select]
s= c:AddDysonTree() -- DysonTree 1


Try this instead:

Code: [Select]
s = c:AddDysonTree() -- DysonTree 1
Dunno if it will make a difference... but maybe.. :>

w4tc

  • Achiever
  • Shrub
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 170
Re: Level design/ Code questions from a beginner
« Reply #206 on: August 15, 2010, 11:01:21 PM »
sorry annikk that code dont work :$
about this : http://www.dyson-game.com/smf/index.php?topic=774.msg6100#msg6100