Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: tinchopunk on December 28, 2004, 03:37:08 AM
-
ok the first one...
I have my character in 3d moving with keys (thank´s new wme version) i want to run first with the shift key+up, if the character colision with an object say something and you can pick up with some key or look or anything but with keys, and other thing how can i make that i move with the character and change the scene but if i move over with the character... sorry with my bad english explanation.
thanks
Martin
-
I think the best approach would be to use the "ActorEntry" event which is triggered when the actor enters a region. That way you can place regions on the floor neer your active objects and execute some code when the actor approaches your object. Same with scene exits.
I created a small demo which uses this approach to roughly mimic Monkey Island 4 interface.
You can download the demo here: http://dead-code.org/download/demos/direct_control_3d.zip
Unfortunately I forgot to implement the ActorEntry functionality for 3D characters before, so I also uploaded a modified wme.exe. Please dowload it and replace the old one in WME installation directory, otherwise the demo won't work.
http://dead-code.org/download/wme_latest.zip
-
The new demo download is dead.
-
Oops, wrong link, sorry. It should work now.
-
nice thats my solution for a lot of things...
the only one i don´t have it´s to run but a lot of work have to do now
THANKS
MArtin
-
nice thats my solution for a lot of things...
the only one i don´t have it´s to run but a lot of work have to do now
In your actor's definition (e.g. trinity.act3d) you can add another animation block for "running" for this purpose, just copy the walk animation block, name it "run" and enter the start/end frames for it.
To associate the running animation to some key combination, you will have to add it to Mnemonic's script example in scripts/direct_control.script. The only difference is, that you always have to set the current walking/running animation and the actor's velocity when you change between running and walking. You can do this by setting the new actor attributes "Velocity" (walking speed), "AngularVelocity" (turning speed) and "WalkAnimName" (your new animation's name). Check the docs here: Scripting in WME -> Script language reference -> 3D actor object.
Good luck :)
-
The only difference is, that you always have to set the current walking/running animation and the actor's velocity when you change between running and walking. You can do this by setting the new actor attributes "Velocity" (walking speed), "AngularVelocity" (turning speed) and "WalkAnimName" (your new animation's name). Check the docs here: Scripting in WME -> Script language reference -> 3D actor object.
Yes, that's the idea. In case of direct controls it's even simpler, because you can specify different animation and speed directly when calling the DirectWalk method.
-
ok thanks that really help
MArtin
-
ok i can´t do that of running, i try but was imposible for me, i have an animation of my character running but i faild in the part of ataching a key (shift+arrow) so any help??
thanks
AMrtin
-
Hi tinchopunk,
ok i can´t do that of running, i try but was imposible for me, i have an animation of my character running but i faild in the part of ataching a key (shift+arrow) so any help??
Ok, let's say you already inserted your animation into the actor's definition file and named it "run", you have to edit the direct_control.script. It might work for you this way:
#include "scripts\base.inc"
#include "scripts\keys.inc"
var IsTurning;
var IsWalking;
while(true)
{
IsTurning = false;
IsWalking = false;
if(Game.Interactive)
{
if(Keyboard.IsKeyDown(VK_LEFT))
{
if (true == Keyboard.IsShift)
{
actor.DirectTurnLeft(600);
}
else
{
actor.DirectTurnLeft();
}
IsTurning = true;
}
if(Keyboard.IsKeyDown(VK_RIGHT))
{
if (true == Keyboard.IsShift)
{
actor.DirectTurnRight(600);
}
else
{
actor.DirectTurnRight();
}
IsTurning = true;
}
if(Keyboard.IsKeyDown(VK_UP))
{
if (true == Keyboard.IsShift)
{
actor.DirectWalk(120,"run");
}
else
{
actor.DirectWalk();
}
IsWalking = true;
}
if(Keyboard.IsKeyDown(VK_DOWN))
{
if (true == Keyboard.IsShift)
{
actor.DirectWalkBack(120,"run");
}
else
{
actor.DirectWalkBack();
}
IsWalking = true;
}
}
if(!IsWalking) actor.DirectWalkStop();
if(!IsTurning) actor.DirectTurnStop();
Sleep(20);
}
Hope this helps.
-
thanks that really help
Martin