Improved holo toaster, added support for the WAFFLE models, 4 color changes during cooking, easily tweak-able modes of poping up of toast, holograms actually look like toast now, not just a block.
By … more info
Improved holo toaster, added support for the WAFFLE models, 4 color changes during cooking, easily tweak-able modes of poping up of toast, holograms actually look like toast now, not just a block.
By Unsmart
please comment on this video.
Code:
http://www.wiremod.com/forum/contraption...
propcore + holoModelAny required
@name Unsmarts holo toaster
@inputs
@outputs [Find Wafles]:array Cook Phase Col:vector
@persist
@trigger
interval(200)
if(first())
{
Wafles1=array()
for(I=1,6)
{
holoCreate(I)
holoColor(I,vec(100,100,100))
if(I<3|I==6)
{
holoScale(I,vec(1.5,2,0.2))
holoAng(I,ang(90,0,0))
}
elseif(I>2&I<5)
{
holoScale(I,vec(1.5,1,0.2))
holoAng(I,ang(90,90,0))
#holoAlpha(I,0)
}
else
{
holoScale(I,vec(2,1,0.2))
holoAng(I,ang(0,90,0))
}
}
H1= holoEntity(1)
H5= holoEntity(5)
H3= holoEntity(3)
holoPos(1,H1:toWorld(vec(0,0,-4.9)))
holoPos(2,H1:toWorld(vec(0,0, 4.9*2)))#multiplication anyone?
holoPos(4,H3:toWorld(vec(0,0,11)))
holoPos(3,H3:toWorld(vec(0,0,-11)))
holoPos(5,H5:toWorld(vec(0,0,-9)))
}
if(clk()&!Cook)
{
findByModel("models/waffle.mdl")
findClipToClass("prop_physics")
findSortByDistance(entity():pos())
Find= findToArray()
Wafles=array()
for(I=1,Find:count())
{
This= Find[I,entity]
if((This:pos()-entity():pos()):length()<30)
{
if(Wafles:count()<2)
{
Wafles:pushEntity(This)
This:setAlpha(0)
This:propFreeze(1)
}
if(Wafles:count()>=2)
{
Cook=1
print("cook")
timer("cook",5000)
break
}
if(Wafles:count()==1)
{
H1=holoEntity(1)
holoCreate(8)
holoModelAny(8,"models/waffle.mdl")
#holoScale(8,vec(1,1,0.1))
holoAng(8,ang(90,0,0))
holoPos(8,H1:toWorld(vec(-2,0,7.5)))
}
}
else
{
#This:setAlpha(255)
}
}
}
if(Cook&clk("cook"))
{
Cook=-1
print("cooked")
}
if(clk("throw"))
{
Wafles[1,entity]:propRotate(ang(0,180,0))
Wafles[2,entity]:propRotate(ang(0,180,0))
Wafles[1,entity]:tele(holoEntity(8):pos())
Wafles[2,entity]:tele(holoEntity(9):pos())
holoDelete(8)
holoDelete(9)
Wafles[1,entity]:setAlpha(255)
Wafles[2,entity]:setAlpha(255)
Wafles[1,entity]:setColor(vec(137,119,119))
Wafles[2,entity]:setColor(vec(137,119,119))
#Wafles[1,entity]:propFreeze(0)
#Wafles[2,entity]:propFreeze(0)
Wafles[1,entity]:applyForce(vec(0,0,50))
Wafles[2,entity]:applyForce(vec(0,0,50))
#timer("dis throw",2000)
}
if(clk("dis throw"))
{
Cook=0
}
if(changed(Cook)&Cook==1)
{
#H1=holoEntity(1)
holoCreate(8)
holoModelAny(8,"models/waffle.mdl")
#holoScale(8,vec(1,1,0.1))
holoAng(8,ang(90,0,0))
holoPos(8,H1:toWorld(vec(-2,0,7.5)))
holoCreate(9)
holoModelAny(9,"models/waffle.mdl")
#holoScale(9,vec(1,1,0.1))
holoAng(9,ang(90,0,0))
holoPos(9,H1:toWorld(vec(-2,0,2.3)))
Phase=1
}
if(Phase){timer("phaser",1000)}
if(changed(Cook)&Cook==-1&!first())
{
#holoDelete(8)
#holoDelete(9)
H1=holoEntity(1)
holoPos(8,H1:toWorld(vec(-7,0,7.5)))
holoPos(9,H1:toWorld(vec(-7,0,2.3)))
timer("throw",1000)
}
if(clk("phaser"))
{
#if(Phase==0){Col=vec(255,255,255)}
Phase++
if(Phase==1){Col=vec(255,255,255)}
if(Phase==2){Col=vec(150,130,130)}
if(Phase==3){Col=vec(96,76,76)}
if(Phase>=4){Col=vec(137,119,119) Phase=0 stoptimer("phaser")}
holoColor(8,Col)
holoColor(9,Col)
} less info
- 567 Views
- Added 2 months ago
:D Wafles, nom nom nom
TOAST!!!!!!