Well, I was originally intending to ask this in a more of a cloak-and-dagger manner, but I might as well not, as I suppose I'll receive better help if I'm clearer.
THAT is a mouse-driven menu using playeraction.
The whole vector thing at the end is needless, methinks. I just copied that part over from the farsight cog. Once I had the playeraction down, I decided that I might model the mouse movement system off of farsight. The mouse, however, just disappears once I move it ingame. How would I move the mouse up, down, left, or right in a free form fashion?
[This message has been edited by Grismath (edited December 23, 2002).]
Code:
# menu.cog
#
#
# [Grismath]
#======================================================================================#
symbols
message activated
message playeraction
thing screen
thing camera
thing cam0
thing cam1
thing cam2
thing cam3
thing mouse
int curFrame=0 local
int using=0 local
flex tempflex local
vector tempvec local
vector tempvec2 local
vector motionVector local
end
#======================================================================================#
code
#--------------------------------------------------------
activated:
if(GetSenderRef()==screen) {
SetCurrentCamera(0);
SetCameraFocus(0, camera);
using=1;
SetActionCog(0, -1);
SetActionCog(GetSelfCog(), 0x7FFFFFFF);
}
return;
#--------------------------------------------------------
playeraction:
if(using==1) {
ReturnEx(0);
if(GetParam(0)==8) {
if(GetParam(2)>0) {
tempflex=2.8;
motionVector = VectorSet(VectorX(motionVector), tempflex, VectorZ(motionVector));
}
if(GetParam(2)<0) {
tempflex=2.8;
motionVector = VectorSet(VectorX(motionVector), -tempflex, VectorZ(motionVector));
}
}
if(GetParam(0)==5) {
if(GetParam(2)>0) {
motionVector = VectorSet(GetParam(2), VectorY(motionVector), VectorZ(motionVector));
}
if(GetParam(2)<0) {
motionVector = VectorSet(GetParam(2), VectorY(motionVector), VectorZ(motionVector));
}
}
if(GetParam(0)==3) {
print("Click");
Sleep(0.2);
}
tempvec = GetThingLVec(camera);
tempvec = VectorScale(tempvec, VectorZ(motionVector) / 3);
tempvec2 = GetThingUVec(camera);
tempvec2 = VectorScale(tempvec2, VectorY(motionVector) / 3);
tempvec = VectorAdd(tempvec, tempvec2);
tempvec2 = GetThingRVec(camera);
tempvec2 = VectorScale(tempvec2, VectorX(motionVector) / 3);
tempvec = VectorAdd(tempvec, tempvec2);
SetThingVel(camera, tempvec);
}
return;
#--------------------------------------------------------
endTHAT is a mouse-driven menu using playeraction.
The whole vector thing at the end is needless, methinks. I just copied that part over from the farsight cog. Once I had the playeraction down, I decided that I might model the mouse movement system off of farsight. The mouse, however, just disappears once I move it ingame. How would I move the mouse up, down, left, or right in a free form fashion?
[This message has been edited by Grismath (edited December 23, 2002).]
