Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: a lot of questions  (Read 5060 times)

0 Members and 2 Guests are viewing this topic.

tinchopunk

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 90
    • View Profile
    • martinarregui.tumblr.com
a lot of questions
« 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
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: a lot of questions
« Reply #1 on: December 28, 2004, 04:13:13 PM »

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



« Last Edit: December 28, 2004, 05:28:35 PM by Mnemonic »
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Orange Brat

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 112
    • View Profile
    • Orange Brat Shenanigans™
Re: a lot of questions
« Reply #2 on: December 28, 2004, 05:24:50 PM »

The new demo download is dead.
Logged
The Disenfranchised™ - coming later

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: a lot of questions
« Reply #3 on: December 28, 2004, 05:29:06 PM »

Oops, wrong link, sorry. It should work now.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

tinchopunk

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 90
    • View Profile
    • martinarregui.tumblr.com
Re: a lot of questions
« Reply #4 on: December 29, 2004, 03:38:36 AM »

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
Logged

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 690
    • View Profile
Re: a lot of questions
« Reply #5 on: December 29, 2004, 04:03:16 AM »

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 :)
Logged
Mooh!

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: a lot of questions
« Reply #6 on: December 29, 2004, 09:18:44 AM »

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.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

tinchopunk

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 90
    • View Profile
    • martinarregui.tumblr.com
Re: a lot of questions
« Reply #7 on: December 30, 2004, 04:21:27 AM »

ok thanks that really help
 MArtin
Logged

tinchopunk

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 90
    • View Profile
    • martinarregui.tumblr.com
Re: a lot of questions
« Reply #8 on: December 31, 2004, 12:36:06 AM »

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
Logged

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 690
    • View Profile
Re: a lot of questions
« Reply #9 on: December 31, 2004, 11:12:37 AM »

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:

Code: [Select]
#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.
Logged
Mooh!

tinchopunk

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 90
    • View Profile
    • martinarregui.tumblr.com
Re: a lot of questions
« Reply #10 on: January 01, 2005, 12:25:59 AM »

thanks that really help
 Martin
Logged
 

Page created in 0.032 seconds with 24 queries.