--For everything: EffectClock,beat; DiffuseRamp; EffectColor1; EffectColor2; EffectOffset; EffectDelay becomes:
	      --effectclock,"beat"; diffuseramp; effectcolor1; effectcolor2; effectoffset; effect_hold_at_full -Kid
return Def.ActorFrame{
  Name= "actor_pib",
  Def.ActorFrame{
    Name= "actor_qib",
    LoadActor('../../mawaru_nue_ch0.lua') .. {
      Name= "actor_rib",
      File= "../../mawaru_nue_ch0.lua",
    },
    LoadActor('../../mawaru_nue_ch1.lua') .. {
      Name= "actor_sib",
      File= "../../mawaru_nue_ch1.lua",
    },
    LoadActor('../../mawaru_nue_ch2.lua') .. {
      Name= "actor_tib",
      File= "../../mawaru_nue_ch2.lua",
    },
    LoadActor('../../mawaru_nue_ch3.lua') .. {
      Name= "actor_uib",
      File= "../../mawaru_nue_ch3.lua",
    },
    LoadActor('../../mawaru_nue_ch4.lua') .. {
      Name= "actor_vib",
      File= "../../mawaru_nue_ch4.lua",
    },
    LoadActor('../../mawaru_nue_ch5.lua') .. {
      Name= "actor_wib",
      File= "../../mawaru_nue_ch5.lua",
    },
    Def.Quad{
      Name= "actor_xib",
      InitCommand= function(self)
			
			mawaru_nue_rot = {90,0,180,-90}
		
			mawaru_nue_p1r = {}
			mawaru_nue_p2r = {}
			
			mawaru_nue_p1speed = 2;
			mawaru_nue_p2speed = -2;
			
			mawaru_nue_colspeeds = {{1,1,1,1},{1,1,1,1}}
			
			mawaru_nue_p1a = {{},{},{}}
			mawaru_nue_p1ptr = {1,1,1}
			mawaru_nue_p2a = {{},{},{}}
			mawaru_nue_p2ptr = {1,1,1}
			
			mawaru_nue_score = {0,0}
			mawaru_nue_numhidden = {2,2,2,2,4,10}
			mawaru_nue_hidden = {{{72,2},{76,2}},{{70,2},{73,1}},{{69,2},{72.5,0}},{{69,1},{72.5,1}},
						{
							{69,0},
							{72.5,1},
							{73,3},
							{73.5,1},
						},
						{
							{65,1},
							{65.5,2},
							{69,1},
							{69,3},
							{69.5,0},
							{69.5,2},
							{73,0},
							{73,3},
							{73.5,1},
							{73.5,2},
						},
					};
			mawaru_nue_stepped = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
			
			function mawaru_nue_step(pn,dir)
				if mawaru_difficulty[pn] == -1 then return end
				
				for i,v in pairs(mawaru_nue_hidden[ mawaru_difficulty[pn]+1 ]) do
					if mawaru_nue_stepped[pn][i] == 0 and dir == v[2] and math.abs(GAMESTATE:GetSongBeat()-v[1]) < 0.25 then
						mawaru_nue_score[pn] = mawaru_nue_score[pn]+1
						mawaru_nue_stepped[pn][i] = 1
					end
				end
				
			end
		
			function mawaru_nue_quantize(beat)
				local r = beat-math.floor(beat)
				if r == 0 then return 1
				elseif r == 0.5 then return 2
				else return 3 end
			end
			
			function mawaru_nue_ishidden(beat,pn)
				if mawaru_difficulty[pn] == -1 then return false end
				for i=1,table.getn(mawaru_nue_hidden[ mawaru_difficulty[pn]+1 ]) do
					if mawaru_nue_hidden[ mawaru_difficulty[pn]+1 ][i][1] == beat then
						return true
					end
				end
				return false
			end
			
			function mawaru_nue_placenote(pn,beat,col)
				
				local group = pn
				local a = _G['mawaru_nue_p'..group..'a'][mawaru_nue_quantize(beat)][ _G['mawaru_nue_p'..group..'ptr'][mawaru_nue_quantize(beat)] ]
				
				col = col+1
				local speed = _G['mawaru_nue_p'..group..'speed']*mawaru_nue_colspeeds[group][col];
				
				a.active = true;
				a.col = col;
				a.alpha = 0;
				a.glow = 1;
				a.targ = beat
				a.zoom = 1;
				
				local b = a.actor
				
				if b then
					if not mawaru_nue_ishidden(beat,pn) then
						b:visible(true);
					else
						b:visible(false);
					end
					b:x(_G['mawaru_nue_p'..group..'r'][col]:GetX())
					b:diffusealpha(1)
					b:glow(1,1,1,0);
					b:y((4*64*speed)+_G['mawaru_nue_p'..group..'r'][col]:GetY());
					b:z(_G['mawaru_nue_p'..group..'r'][col]:GetZ());
					b:zoom(1);
					b:rotationz(mawaru_nue_rot[col])
				end
				
				_G['mawaru_nue_p'..group..'ptr'][mawaru_nue_quantize(beat)] = _G['mawaru_nue_p'..group..'ptr'][mawaru_nue_quantize(beat)]+1
				if _G['mawaru_nue_p'..group..'ptr'][mawaru_nue_quantize(beat)] > table.getn(_G['mawaru_nue_p'..group..'a'][mawaru_nue_quantize(beat)]) then
					_G['mawaru_nue_p'..group..'ptr'][mawaru_nue_quantize(beat)] = 1
				end
				
			end
			
			function mawaru_nue_arroweffects(obj,targ,pf)
				local beat = GAMESTATE:GetSongBeat()
				obj:addx(_G['mawaru_nue_fp_sinewavep'..pf]:GetX()*math.sin((targ-beat)*math.pi*_G['mawaru_nue_fp_sineperiodp'..pf]:GetX()));
				obj:addy(_G['mawaru_nue_fp_sinewavep'..pf]:GetY()*math.sin((targ-beat)*math.pi*_G['mawaru_nue_fp_sineperiodp'..pf]:GetY()));
				obj:addz(_G['mawaru_nue_fp_sinewavep'..pf]:GetZ()*math.sin((targ-beat)*math.pi*_G['mawaru_nue_fp_sineperiodp'..pf]:GetZ()));
				
				local fPixelOffsetFromCenter = 0;
					
				local fBeatStrength = 0.5;
				
				if mawaru_difficulty[pf] < 3 then
					fBeatStrength = 0
				elseif mawaru_difficulty[pf] == 4 then
					fBeatStrength = 1.5
				elseif mawaru_difficulty[pf] == 5 then
					fBeatStrength = 3
				end
				
				local fAccelTime = 0.2;
				local fTotalTime = 0.5;
				
				local fYOffset = (targ-beat)*80*_G['mawaru_nue_p'..pf..'speed'];
	
				-- If the song is really fast, slow down the rate, but speed up the
				-- acceleration to compensate or it'll look weird.
				
				local fBPM = 160;
				
				local fBeat = GAMESTATE:GetSongBeat()*2 + fAccelTime;
				
				local bEvenBeat = false;
				if math.mod(math.floor(fBeat),2) == 0 then
					bEvenBeat = true;
				end
				
				--who wrote this!?

				fBeat = fBeat-math.floor( fBeat );
				fBeat = fBeat+1;
				fBeat = fBeat-math.floor( fBeat );
				
				--what the fuck is this code!

				--if( fBeat >= fTotalTime )
				--break;
				
				if fBeat<fTotalTime then
					local fAmount = 0;
					if fBeat < fAccelTime then
						fAmount = scale( fBeat, 0.0, fAccelTime, 0.0, 1.0);
						fAmount = fAmount*fAmount;
					else 
						--fBeat < fTotalTime
						fAmount = scale( fBeat, fAccelTime, fTotalTime, 1.0, 0.0);
						fAmount = 1 - (1-fAmount) * (1-fAmount);
					end

					if bEvenBeat then
						fAmount = fAmount*-1;
					end

					local fShift = 20.0*fAmount*math.sin( (fYOffset/15.0) + (math.pi/2) );
					--fPixelOffsetFromCenter += fEffects[PlayerOptions__EFFECT_BEAT] * fShift;
					fPixelOffsetFromCenter = fPixelOffsetFromCenter+(fBeatStrength * fShift);
					
					obj:addx(fPixelOffsetFromCenter);
				end
			end
			
			function mawaru_nue_update()
				local beat = GAMESTATE:GetSongBeat()
				for pf=1,2 do
					if GAMESTATE:IsPlayerEnabled(pf-1) then
						for q=1,3 do
							for i=1,table.getn(_G['mawaru_nue_p'..pf..'a'][q]) do
								local a = _G['mawaru_nue_p'..pf..'a'][q][i]
								if a.active and beat > mod_firstSeenBeat+1 then
									
									local speed = _G['mawaru_nue_p'..pf..'speed']*mawaru_nue_colspeeds[pf][a.col];
									local b = a.actor
									
									local x = b:GetX()-(_G['mawaru_nue_p'..pf..'r'][a.col]:GetX())
									local y = b:GetY()-(math.max(a.targ-beat,0)*64*speed)+_G['mawaru_nue_p'..pf..'r'][a.col]:GetY()
									local z = b:GetZ()-(_G['mawaru_nue_p'..pf..'r'][a.col]:GetZ())
									
									if math.sqrt((x*x)+(y*y)+(z*z)) < 20 then
										b:linear(0.02);
									end
									
									b:x(_G['mawaru_nue_p'..pf..'r'][a.col]:GetX())
									b:diffusealpha(a.alpha)
									b:glow(1,1,1,a.glow);
									b:y((math.max(a.targ-beat,0)*64*speed)+_G['mawaru_nue_p'..pf..'r'][a.col]:GetY());
									b:z(_G['mawaru_nue_p'..pf..'r'][a.col]:GetZ());
									b:zoom(a.zoom)
									b:rotationz(mawaru_nue_rot[a.col])
									
									mawaru_nue_arroweffects(b,a.targ,pf)
									
									if a.alpha < 1 then
										a.alpha = a.alpha+0.2;
									else
										a.alpha = 1
										if a.glow > 0 then
											a.glow = a.glow-0.2
										else
											a.glow = 0;
										end
									end
									
									if a.targ-beat <= 0 then
										b:visible(false);
										a.active = false;
									end
									
								end
							end
						end
					end
				end
			end
			
		end,
      KillCommand= function(self)
			--any cleanup, if necessary
		end,
      StartCommand= function(self)
			
			mawaru_nue_cur = {1,1}
			
			mawaru_nue_p1speed = mawaru_speedmod[1]*0.75
			mawaru_nue_p2speed = mawaru_speedmod[2]*0.75
			
			for pn=1,2 do
				if GAMESTATE:IsPlayerEnabled(pn-1) then
					if mawaru_reverse[pn] > 1 then
						_G['mawaru_nue_p'..pn]:y(480-112)
						_G['mawaru_nue_p'..pn..'speed'] = _G['mawaru_nue_p'..pn..'speed']*-1;
					end
					_G['mawaru_nue_p'..pn]:addx(-2);
					_G['mawaru_nue_p'..pn]:addy(2);
				else
					_G['mawaru_nue_p'..pn]:visible(false);
				end
			end
			
			self:sleep(0.02);
			self:queuecommand('Update');

		end,
      UpdateCommand= function(self)
			
			--game logic
			
			local beat = GAMESTATE:GetSongBeat()
			
			for pn=1,2 do
			
				if GAMESTATE:IsPlayerEnabled(pn-1) then
				
					local chart = _G['mawaru_nue_ch'..mawaru_difficulty[pn] ]
					while mawaru_nue_cur[pn] <= table.getn(chart) and beat > chart[ mawaru_nue_cur[pn] ][1]-4 do
						mawaru_nue_placenote(pn, chart[mawaru_nue_cur[pn] ][1],chart[mawaru_nue_cur[pn] ][2])
						mawaru_nue_cur[pn] = mawaru_nue_cur[pn]+1;
					end
					
					_G['mawaru_nue_text'..pn]:settext(mawaru_nue_score[pn]..'/'..mawaru_nue_numhidden[ mawaru_difficulty[pn]+1 ])
					
				end
				
			end
			
			mawaru_nue_update();
			
			self:sleep(0.02);
			if mawaru_curgame == 1 and mawaru_gamestate == 1 then
				self:queuecommand('Update');
			end
			
		end,
    },
    Def.ActorFrame{
      Name= "actor_yib",--Unconverted x & y pos. -Kid
      InitCommand= function(self) mawaru_nue_p2 = self end,
      OnCommand= cmd(x,480;y,112;fov,80),
      Def.ActorFrame{
        Name= "actor_zib",--Unconverted x pos. -Kid
        OnCommand= cmd(x,-96;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2r,self) end,
        Def.Sprite{
          Name= "actor_Aib",
          Frames= {
            {Frame= 0, Delay= 1},
            {Frame= 1, Delay= 1},
            {Frame= 2, Delay= 1},
            {Frame= 3, Delay= 1},
        },
          HideG2MessageCommand= cmd(linear,0.1;diffusealpha,0),
          OnCommand= cmd(visible,false;rotationz,90;addx,1;addy,1;
			effectclock,"beat";diffuseramp;effectcolor1,0.4,0.4,0.4,1;effectcolor2,1,1,1,1,1;
			effectperiod,0.5;effect_hold_at_full,0.5;effectoffset,0.05;sleep,0.02),
          ShowG2MessageCommand= cmd(linear,0.1;diffusealpha,1),
          Texture= "./receptor 4x1.png",
        },
      },
      Def.ActorFrame{
        Name= "actor_Bib",--Unconverted x pos. -Kid
        OnCommand= cmd(x,-32;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2r,self) end,
        Def.Sprite{
          Name= "actor_Cib",
          Frames= {
            {Frame= 0, Delay= 1},
            {Frame= 1, Delay= 1},
            {Frame= 2, Delay= 1},
            {Frame= 3, Delay= 1},
        },
          HideG2MessageCommand= cmd(linear,0.1;diffusealpha,0),
          OnCommand= cmd(visible,false;rotationz,0;addx,1;addy,1;
			effectclock,"beat";diffuseramp;effectcolor1,0.4,0.4,0.4,1;effectcolor2,1,1,1,1,1;
			effectperiod,0.5;effect_hold_at_full,0.5;effectoffset,0.05;sleep,0.02),
          ShowG2MessageCommand= cmd(linear,0.1;diffusealpha,1),
          Texture= "./receptor 4x1.png",
        },
      },
      Def.ActorFrame{
        Name= "actor_Dib",--Unconverted x pos. -Kid
        OnCommand= cmd(x,32;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2r,self) end,
        Def.Sprite{
          Name= "actor_Eib",
          Frames= {
            {Frame= 0, Delay= 1},
            {Frame= 1, Delay= 1},
            {Frame= 2, Delay= 1},
            {Frame= 3, Delay= 1},
        },
          HideG2MessageCommand= cmd(linear,0.1;diffusealpha,0),
          OnCommand= cmd(visible,false;rotationz,180;addx,1;addy,1;
			effectclock,"beat";diffuseramp;effectcolor1,0.4,0.4,0.4,1;effectcolor2,1,1,1,1,1;
			effectperiod,0.5;effect_hold_at_full,0.5;effectoffset,0.05;sleep,0.02),
          ShowG2MessageCommand= cmd(linear,0.1;diffusealpha,1),
          Texture= "./receptor 4x1.png",
        },
      },
      Def.ActorFrame{
        Name= "actor_Fib",--Unconverted x pos. -Kid
        OnCommand= cmd(x,96;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2r,self) end,
        Def.Sprite{
          Name= "actor_ajb",
          Frames= {
            {Frame= 0, Delay= 1},
            {Frame= 1, Delay= 1},
            {Frame= 2, Delay= 1},
            {Frame= 3, Delay= 1},
        },
          HideG2MessageCommand= cmd(linear,0.1;diffusealpha,0),
          OnCommand= cmd(visible,false;rotationz,-90;addx,1;addy,1;
			effectclock,"beat";diffuseramp;effectcolor1,0.4,0.4,0.4,1;effectcolor2,1,1,1,1,1;
			effectperiod,0.5;effect_hold_at_full,0.5;effectoffset,0.05;sleep,0.02),
          ShowG2MessageCommand= cmd(linear,0.1;diffusealpha,1),
          Texture= "./receptor 4x1.png",
        },
      },
      Def.Model{
        Name= "actor_bjb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_cjb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_djb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_ejb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_fjb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_gjb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_hjb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_ijb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_jjb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_kjb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_ljb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_mjb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_njb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_ojb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_pjb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_qjb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_rjb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_sjb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_tjb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_ujb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_vjb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_wjb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_xjb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_yjb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p2a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
    },
    Def.ActorFrame{
      Name= "actor_zjb",
      InitCommand= function(self) mawaru_nue_p1 = self end,
      OnCommand= cmd(x,160;y,112;fov,80),--Unconverted x & y pos. -Kid
      Def.ActorFrame{
        Name= "actor_Ajb",--Unconverted x pos. -Kid
        OnCommand= cmd(x,-96;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1r,self) end,
        Def.Sprite{
          Name= "actor_Bjb",
          Frames= {
            {Frame= 0, Delay= 1},
            {Frame= 1, Delay= 1},
            {Frame= 2, Delay= 1},
            {Frame= 3, Delay= 1},
        },
          HideG1MessageCommand= cmd(linear,0.1;diffusealpha,0),
          OnCommand= cmd(visible,false;rotationz,90;addx,1;addy,1;
			effectclock,"beat";diffuseramp;effectcolor1,0.4,0.4,0.4,1;effectcolor2,1,1,1,1,1;
			effectperiod,0.5;effect_hold_at_full,0.5;effectoffset,0.05;sleep,0.02),
          ShowG1MessageCommand= cmd(linear,0.1;diffusealpha,1),
          Texture= "./receptor 4x1.png",
        },
      },
      Def.ActorFrame{
        Name= "actor_Cjb",
        OnCommand= cmd(x,-32;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1r,self) end,
        Def.Sprite{
          Name= "actor_Djb",
          Frames= {
            {Frame= 0, Delay= 1},
            {Frame= 1, Delay= 1},
            {Frame= 2, Delay= 1},
            {Frame= 3, Delay= 1},
        },
          HideG1MessageCommand= cmd(linear,0.1;diffusealpha,0),
          OnCommand= cmd(visible,false;rotationz,0;addx,1;addy,1;
			effectclock,"beat";diffuseramp;effectcolor1,0.4,0.4,0.4,1;effectcolor2,1,1,1,1,1;
			effectperiod,0.5;effect_hold_at_full,0.5;effectoffset,0.05;sleep,0.02),
          ShowG1MessageCommand= cmd(linear,0.1;diffusealpha,1),
          Texture= "./receptor 4x1.png",
        },
      },
      Def.ActorFrame{
        Name= "actor_Ejb",
        OnCommand= cmd(x,32;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1r,self) end,
        Def.Sprite{
          Name= "actor_Fjb",
          Frames= {
            {Frame= 0, Delay= 1},
            {Frame= 1, Delay= 1},
            {Frame= 2, Delay= 1},
            {Frame= 3, Delay= 1},
        },
          HideG1MessageCommand= cmd(linear,0.1;diffusealpha,0),
          OnCommand= cmd(visible,false;rotationz,180;addx,1;addy,1;
			effectclock,"beat";diffuseramp;effectcolor1,0.4,0.4,0.4,1;effectcolor2,1,1,1,1,1;
			effectperiod,0.5;effect_hold_at_full,0.5;effectoffset,0.05;sleep,0.02),
          ShowG1MessageCommand= cmd(linear,0.1;diffusealpha,1),
          Texture= "./receptor 4x1.png",
        },
      },
      Def.ActorFrame{
        Name= "actor_akb",
        OnCommand= cmd(x,96;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1r,self) end,
        Def.Sprite{
          Name= "actor_bkb",
          Frames= {
            {Frame= 0, Delay= 1},
            {Frame= 1, Delay= 1},
            {Frame= 2, Delay= 1},
            {Frame= 3, Delay= 1},
        },
          HideG1MessageCommand= cmd(linear,0.1;diffusealpha,0),
          OnCommand= cmd(visible,false;rotationz,-90;addx,1;addy,1;
			effectclock,"beat";diffuseramp;effectcolor1,0.4,0.4,0.4,1;effectcolor2,1,1,1,1,1;
			effectperiod,0.5;effect_hold_at_full,0.5;effectoffset,0.05;sleep,0.02),
          ShowG1MessageCommand= cmd(linear,0.1;diffusealpha,1),
          Texture= "./receptor 4x1.png",
        },
      },
      Def.Model{
        Name= "actor_ckb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_dkb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_ekb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_fkb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_gkb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_hkb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_ikb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_jkb",
        Bones= "arrows/4th/4arrowmesh.txt",
        Materials= "arrows/4th/4th.txt",
        Meshes= "arrows/4th/4arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[1],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_kkb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_lkb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_mkb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_nkb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_okb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_pkb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_qkb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_rkb",
        Bones= "arrows/8th/8arrowmesh.txt",
        Materials= "arrows/8th/8th.txt",
        Meshes= "arrows/8th/8arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[2],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_skb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_tkb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_ukb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_vkb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_wkb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_xkb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_ykb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
      Def.Model{
        Name= "actor_zkb",
        Bones= "arrows/12th/16arrowmesh.txt",
        Materials= "arrows/12th/16th.txt",
        Meshes= "arrows/12th/16arrowmesh.txt",
        OnCommand= cmd(visible,false;sleep,0.02;queuecommand,"SetMe"),
        SetMeCommand= function(self) table.insert(mawaru_nue_p1a[3],{actor=self,active=false,targ=0,col=0}); end,
      },
    },
    Def.Quad{
      Name= "actor_Akb",
      InitCommand= function(self) mawaru_nue_fp_sinewavep1 = self end,
      OnCommand= cmd(visible,false;x,0),--Unconverted x pos. -Kid
    },
    Def.Quad{
      Name= "actor_Bkb",
      InitCommand= function(self) mawaru_nue_fp_sinewavep2 = self end,
      OnCommand= cmd(visible,false;x,0),--Unconverted x pos. -Kid
    },
    Def.Quad{
      Name= "actor_Ckb",--Unconverted x & y pos. -Kid
      InitCommand= function(self) mawaru_nue_fp_sineperiodp1 = self end,
      OnCommand= cmd(visible,false;x,1;y,1;z,1),
    },
    Def.Quad{
      Name= "actor_Dkb",--Unconverted x & y pos. -Kid
      InitCommand= function(self) mawaru_nue_fp_sineperiodp2 = self end,
      OnCommand= cmd(visible,false;x,1;y,1;z,1),
    },
    Def.BitmapText{
      Name= "actor_Ekb",
      Font= "_eurostile outline",
      InitCommand= function(self) mawaru_nue_text1=self end,--Unconverted x & y pos. -Kid
      OnCommand= cmd(shadowlength,0;x,160;y,320),
      Text= "",
    },
    Def.BitmapText{
      Name= "actor_Fkb",
      Font= "_eurostile outline",
      InitCommand= function(self) mawaru_nue_text2=self end,--Unconverted x & y pos. -Kid
      OnCommand= cmd(shadowlength,0;x,480;y,320),
      Text= "",
    },
    Def.Sprite{
      Name= "actor_alb",--Unconverted x & y pos. -Kid
      OnCommand= cmd(x,320;y,240;zoom,1.5),
      Texture= "nue 4x1.png",
    },
    --Renamed Do commands to work with the main lua's input handler. -Kid
    Def.Quad{
      Name= "actor_blb",
      DoDownCommand= function(self)
			mawaru_nue_step(1,1)
		end,
      DoLeftCommand= function(self)
			mawaru_nue_step(1,0)
		end,
      DoRightCommand= function(self)
			mawaru_nue_step(1,3)
		end,
      DoUpCommand= function(self)
			mawaru_nue_step(1,2)
		end,
      StepDownP1MessageCommand= cmd(queuecommand,"DoDown"),
      StepLeftP1MessageCommand= cmd(queuecommand,"DoLeft"),
      StepP1DownPressMessageCommand= cmd(queuecommand,"DoDown"),
      StepP1DownPressedMessageCommand= cmd(queuecommand,"DoDown"),
      StepP1LeftPressMessageCommand= cmd(queuecommand,"DoLeft"),
      StepP1LeftPressedMessageCommand= cmd(queuecommand,"DoLeft"),
      StepP1RightPressMessageCommand= cmd(queuecommand,"DoRight"),
      StepP1RightPressedMessageCommand= cmd(queuecommand,"DoRight"),
      StepP1UpPressMessageCommand= cmd(queuecommand,"DoUp"),
      StepP1UpPressedMessageCommand= cmd(queuecommand,"DoUp"),
      StepRightP1MessageCommand= cmd(queuecommand,"DoRight"),
      StepUpP1MessageCommand= cmd(queuecommand,"DoUp"),
    },
    Def.Quad{
      Name= "actor_clb",
      DoDownCommand= function(self)
			mawaru_nue_step(2,1)
		end,
      DoLeftCommand= function(self)
			mawaru_nue_step(2,0)
		end,
      DoRightCommand= function(self)
			mawaru_nue_step(2,3)
		end,
      DoUpCommand= function(self)
			mawaru_nue_step(2,2)
		end,
      StepDownP2MessageCommand= cmd(queuecommand,"DoDown"),
      StepLeftP2MessageCommand= cmd(queuecommand,"DoLeft"),
      StepP2DownPressMessageCommand= cmd(queuecommand,"DoDown"),
      StepP2DownPressedMessageCommand= cmd(queuecommand,"DoDown"),
      StepP2LeftPressMessageCommand= cmd(queuecommand,"DoLeft"),
      StepP2LeftPressedMessageCommand= cmd(queuecommand,"DoLeft"),
      StepP2RightPressMessageCommand= cmd(queuecommand,"DoRight"),
      StepP2RightPressedMessageCommand= cmd(queuecommand,"DoRight"),
      StepP2UpPressMessageCommand= cmd(queuecommand,"DoUp"),
      StepP2UpPressedMessageCommand= cmd(queuecommand,"DoUp"),
      StepRightP2MessageCommand= cmd(queuecommand,"DoRight"),
      StepUpP2MessageCommand= cmd(queuecommand,"DoUp"),
    },
  },
}
