True Unbreakable

View previous topic View next topic Go down

True Unbreakable

Post by DanielLC on Tue Feb 15, 2011 7:25 pm

One annoying thing about this game is that "Unbreakable" isn't.

I used a bug in my regenerate script to get something that has the same basic effect. It's just that instead of regenerating, it's plain immortal.

Code:
function isAttached(chip)
  if chip == 0 then
    return true
  end
  return _PARENT(chip) ~= -1
end

function OnFrame()
  for i=2,chips-1 do
    if not isAttached(i) then
      _ADDCHIP(math.random(chips)-1,"COWL","N",180)
      break
    end
  end
end

function OnInit()
  chips=_CHIPS()
end

function OnReset()

end

function OnMode()

end

Or if you want to be able to drop balls and such:
Code:
function isAttached(chip)
  if chip == 0 then
    return true
  end
  return _PARENT(chip) ~= -1
end

WindLevel=0
LastBall=-1

function OnFrame()
   
   if(_SKEYDOWN(0)>0) then
      LastBall=_ADDBALL(0.6, 2, _GETY(2,0)+6+LastBall ,LastBall/10, 0.3)
      _SETOBJCOLOR(LastBall,1,0,1)
   end
   if(_SKEYDOWN(1)>0) then
      WindLevel=WindLevel+1
      if(WindLevel>3) then WindLevel=0 end
      if(WindLevel==0) then _SETWIND(0,0,0) end
      if(WindLevel==1) then _SETWIND(5,0,0) end
      if(WindLevel==2) then _SETWIND(16,0,0) end
      if(WindLevel==3) then _SETWIND(50,0,0) end
   end
   wx,wy,wz=_GETWIND()
   if(WindLevel~=0) then out(0,"Wind = ",wx," ",wy," ",wz) end
   if(LastBall>=0) then out(1,"Ball Count = ",LastBall+1) end

  for i=2,chips-1 do
    if not isAttached(i) then
      _ADDCHIP(math.random(chips)-1,"COWL","N",180)
      break
    end
  end
end

function OnInit()
   WindLevel=0
   LastBall=-1

  chips=_CHIPS()
end

function OnReset()

end


Last edited by DanielLC on Tue Feb 15, 2011 7:33 pm; edited 1 time in total (Reason for editing : Forgot to take some now-useless stuff out.)

DanielLC
Tank
Tank

Posts : 78
Join date : 2010-10-23

View user profile

Back to top Go down

Re: True Unbreakable

Post by bwansy on Wed Feb 16, 2011 5:09 pm

Interesting effect. However, after being under constant fire, RC crashed, and I guess that's because there were too many cowls attached to a single chip.

_________________
A.K.A. Bernard

bwansy
Admin

Posts : 170
Join date : 2010-07-15

View user profile http://rigidchips.forum-motion.com

Back to top Go down

Re: True Unbreakable

Post by DanielLC on Thu Feb 17, 2011 12:34 am

I'm not on the right operating system right now, but you could try this:

Code:
function isAttached(chip)
  if chip == 0 then
    return true
  end
  return _PARENT(chip) ~= -1
end

function OnFrame()
  for i=2,chips-1 do
    if not isAttached(i) then
      x=_ADDCHIP(math.random(chips)-1,"COWL","N",180)
      _BYE(x)
      break
    end
  end
end

function OnInit()
  chips=_CHIPS()
end

function OnReset()

end

function OnMode()

end

Perhaps dropping the cowl will help.

DanielLC
Tank
Tank

Posts : 78
Join date : 2010-10-23

View user profile

Back to top Go down

Re: True Unbreakable

Post by mober on Fri Jan 20, 2012 3:19 pm

i cant git it to work
avatar
mober
Tank
Tank

Posts : 64
Join date : 2012-01-17

View user profile

Back to top Go down

Re: True Unbreakable

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum