PDA

View Full Version : Please help (How To?)



miron
01-16-2004, 04:39 AM
Hello everyone.
I need to find a way to control camera in Layout with a keyboard and mouse. Much the same like you do in any FPS 3D Shooter.

I've just started to learn lscript so i cant figure out how it can be done by myself.
Any suggestions are very much welcome.


PS Sorry for my bad English

wiffzack
01-21-2004, 06:44 AM
I dont think its possible, there might be a workaround but it would not be very useable.

Why do you want that? Layouts camera navigation is faster to use then these games controls?

miron
01-21-2004, 06:53 AM
i want to test game levels which i build using layout.
i'd like to use camera like in GTK Radiant or Hammer Editor.

wiffzack
01-22-2004, 04:54 AM
Well i ve give it try. With 2.6 it could be possible. The script only moves the current object on X Z. And it is impossible to react on two pressed keys at the same time, isnt it?

heres the script




@version 2.6
@warnings
@script generic

scene = Scene();
c1;
generic
{
reqbegin("gamove");

c1 = ctlminislider("speed", 1, 1, 1000 );
ctlsep();
c0 = ctltext("Use w, a, s, d keys","to move the current object");

return if ! reqpost();
}



reqkeyboard: key
{
o = scene.firstSelect();
c = c1.value / 1000;
t = scene.currenttime;
switch( key ) {

case 119 :
// w
v = o.getForward(t) * c;
CommandInput("AddPosition "+v.x+" "+v.y+" "+v.z);
CommandInput("RefreshNow");
return true;
case 115 :
// s
v = o.getForward(t)*-c;
CommandInput("AddPosition "+ v.x+" "+ v.y+" "+ v.z);
CommandInput("RefreshNow");
return true;
case 97 :
// a
v = o.getRight(t)* -c;
CommandInput("AddPosition "+v.x+" "+v.y+" "+v.z);
CommandInput("RefreshNow");
return true;
case 100 :
// d
v = o.getRight(t)*c;
CommandInput("AddPosition "+ v.x+" "+ v.y+" "+ v.z);
CommandInput("RefreshNow");
return true;

}
return false;

}



See in the 2.6 update notes. i think theres a reqmousemove function too.
please tell me if you get a better version, this could be a funny thing

miron
01-27-2004, 07:56 AM
uh, does not seem to work... lw7.5c