My friend hated the JK rotateing doors cog. I dont know why but he did, he wanted something less hard to use and enlisted me!
Now i realise that it relies on the pivoit point of the door 3DO being on the side of the door, but i am thinking of explaining how to fix that in the readme.
do you think its worth submiting to massassi?
------------------
I am Darth PJB!
well, go on, run away!
i have a plastic lightsaber and a jedi cape.. am i a nerd?
If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
Code:
# PJ_rotate.cog
#
# this cog will rotate two things allong a set number of degries
# the number of degries must ALLWAY be posive, change the right int
# to 0 for positive, 1 for negative.
#
#
symbols
message activated
thing door0
thing door1
int right=0
int angle=90
int a=0 local
int b=0 local
int c=0 local
int d=0 local
int i=0 local
flex time=0.5 local
vector lvec local
vector lvec2 local
end
code
activated:
if(d==0 && right==0)c=0;
if(d==0 && right==1)c=1;
if(d==1 && right==1)c=0;
if(d==1 && right==0)c=1;
if(c==0)
{
if(b==0)
{
lvec2=GetThingLVec(door0);
a=vectorY(lvec2);
for(i=0;i<=angle;i=i+1)
{
lvec=VectorSet(0, i+a, 0);
SetThingLook(door0, lvec);
sleep(angle/time);
}
b=1;
call activated;
return;
}
if(b==1)
{
lvec2=GetThingLVec(door1);
a=vectorY(lvec2);
for(i=0;i>=angle;i=i+1)
{
lvec=VectorSet(0, i+a, 0);
SetThingLook(door1, lvec);
sleep(angle/time);
}
b=0;
d=1;
return;
}
}
if(c==0)
{
if(b==1)
{
lvec2=GetThingLVec(door0);
a=vectorY(lvec2);
for(i=angle;i<=0;i=i-1)
{
lvec=VectorSet(0, a-i, 0);
SetThingLook(door0, lvec);
sleep(angle/time);
}
b=1;
call activated;
return;
}
if(b==1)
{
lvec2=GetThingLVec(door1);
a=vectorY(lvec2);
for(i=angle;i<=0;i=i-1)
{
lvec=VectorSet(0, a-i, 0);
SetThingLook(door1, lvec);
sleep(angle/time);
}
b=0;
d=0;
return;
}
}
return;
endNow i realise that it relies on the pivoit point of the door 3DO being on the side of the door, but i am thinking of explaining how to fix that in the readme.
do you think its worth submiting to massassi?
------------------
I am Darth PJB!
well, go on, run away!
i have a plastic lightsaber and a jedi cape.. am i a nerd?
If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
I am Darth PJB!
well, go on, run away!
i have a plastic lightsaber and a jedi cape.. am i a nerd?
If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
well, go on, run away!
i have a plastic lightsaber and a jedi cape.. am i a nerd?
If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
![http://forums.massassi.net/html/tongue.gif [http://forums.massassi.net/html/tongue.gif]](http://forums.massassi.net/html/tongue.gif)
![http://forums.massassi.net/html/smile.gif [http://forums.massassi.net/html/smile.gif]](http://forums.massassi.net/html/smile.gif)
![http://forums.massassi.net/html/biggrin.gif [http://forums.massassi.net/html/biggrin.gif]](http://forums.massassi.net/html/biggrin.gif)