Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Pages: 1 2 3 4 [All]

Author Topic: have a 3d char walking and running  (Read 19855 times)

0 Members and 1 Guest are viewing this topic.

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
have a 3d char walking and running
« on: June 20, 2007, 12:17:34 PM »

Hello again. its been  a while but i managed to get 3d characters working in our game chess-worlds.
now i have the char walking.
i have an animation for running also

how can i declare the running animation and where do i have to do it ?
and how can i implement the running animation on left double click ?

sorry if this have been explained already. i only found something in the czech forum but cant manage to understand enough of it ...

greets stucki
« Last Edit: June 20, 2007, 04:03:57 PM by Stucki »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #1 on: June 20, 2007, 05:36:03 PM »

The code from the czech thread looks approximately like this:

Code: [Select]
method RunTo(x, y)
{
  this.WalkAnimName = "run";
  this.Velocity = 200;
  this.GoTo(x, y)
}


method GoTo(x, y)
{
  this.WalkAnimName = "walk";
  this.Velocity = 100;
  this.GoTo(x, y);
}

If you add this to your actor's script, you can then call actor.RunTo(100, 200); just like you'd call GoTo. The RunTo method changes the walking animation to an animation called "run", and it changes the movement velocity. The overriden GoTo method in turn changes the walking animation back to "walk" and restores the walking velocity.

So you've found a 3D modeller?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #2 on: June 20, 2007, 05:51:01 PM »

thanks now i begin to see !!
can i do the same with actor.GoToObject(x); ??

and yes i found a very good modeler ... but he is not doing the animation ... so i have to learn this myself ...
slowing down things a little bit ... but things are going on .. i just got a contract from a publisher ... now i have to see if i can get the game done in one year ...

greets stucki



Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #3 on: June 20, 2007, 06:50:20 PM »

hmmmm.
done everything but its not working. there is no difference between walking and running ... even the velocity is not changing ...
so i changed the x,y coordinates for the runto command to see if this works.
and this is okay if i double left click it walks to the new coordinates and if i left click it walks to the old ones.
there doesnt lie the problem ...

here is my actor script:

method RunTo(x, y)
{
  this.WalkAnimName = "run";
  this.Velocity = 3;
  this.GoTo(x, y);
}

method GoTo(x, y)
{
  this.WalkAnimName = "walk";
  this.Velocity = 1.5;
  this.GoTo(x, y);
}

method RunToObject(name)
{
  this.WalkAnimName = "run";
  this.Velocity = 3;
  this.GoToObject(name);
}

method GoToObject(name)
{
  this.WalkAnimName = "walk";
  this.Velocity = 1.5;
  this.GoToObject(name);
}

and here is the actor definition file:

ACTOR3DX
{
  NAME = "test_x"
  CAPTION = ""
  INTERACTIVE = TRUE
  ACTIVE = TRUE
  SCRIPT = "D:\Wintermute\Demo_1.0\data\actors\test_x\test_x.script"
  SCRIPT= "actors\molly\talk.script"
  SCRIPT= "actors\molly\footsteps.script"
 
  SCALE = 11000
 
  ;--- velocity
  VELOCITY =1.5
  ANGULAR_VELOCITY = 400.0

  ;--- external data
  MODEL = "d:\test.X"
  FONT = "fonts\nik.font"
  ;SHADOW_MODEL = "d:\test.X"
  SHADOW_TYPE = "stencil"
  LIGHT_POSITION { -10, -10, -10 }
  SHADOW_COLOR { 0, 0, 0, 208 }
  ;CURSOR = ...

ANIMATION
  {
    NAME="idle"
    LOOPING=TRUE
  }

ANIMATION
  {
    NAME="walk"
    LOOPING=TRUE
  }

ANIMATION
  {
    NAME="run"
    LOOPING=TRUE
  }
}

and here is the call from the object.script that triggers the actions:

on "LeftClick"
{
  actor.GoToObject(this);
}

on "LeftDoubleClick"
{
  actor.RunTo(400,400); // did this for seeing if it is working ... normal this would be actor.RunToObject(this);
}

any ideas ?!?
interesting is that the velocity of the walking isnt changing...

and yes there is a running animation defined in the x-file
 

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #4 on: June 20, 2007, 07:03:38 PM »

Ah, oops, my mistake. The original code looked a little bit different. It didn't use the normal GoTo() method for walking, but a custom method (such as WalkTo()). Because in the above code the RunTo method calls GoTo in the end, which in turn uses the overriden GoTo and switches the animation and velocity back.

So you'd have to use something like this:

Code: [Select]
method RunTo(x, y)
{
  this.WalkAnimName = "run";
  this.Velocity = 200;
  this.GoTo(x, y)
}


method WalkTo(x, y)
{
  this.WalkAnimName = "walk";
  this.Velocity = 100;
  this.GoTo(x, y);
}

and use WalkTo() instead of GoTo() in all your scripts..
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #5 on: June 20, 2007, 07:14:55 PM »

yeah thats it !!! many thanks for helping me once again ..

one last thing .. where can i change the running if i click somewhere irrelevant in the scene.
now my char is always walking if i click once or twice on no interactive object ..

have i to put it in the scene.ini ?
 

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #6 on: June 20, 2007, 07:16:20 PM »

It's handled in the scripts\scene.script, which is attached to every scene by default.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #7 on: June 20, 2007, 07:29:11 PM »

okay stupid me again ...
thanks for your time and patience !
 O0 ::rock O0

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #8 on: June 21, 2007, 09:16:52 AM »

everything works fine now except the stencil shadows.

if i turn on flat shadows everything works fine ... if i turn on stencil shadow i see no shadow ... even on the walkplane ...
i have created a geometry file but it doesnt change ...

any idea ??

Nihil

  • Supporter
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 528
  • Fear me! I'm evil!
    • View Profile
    • Order of Dagon
Re: have a 3d char walking and running
« Reply #9 on: June 21, 2007, 10:10:43 AM »

Did you enable the stencil-shadows in SceneEdit, too? (under 3d-options)

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #10 on: June 21, 2007, 10:15:28 AM »

yes in sceneedit as well as in the actor definition ...
if i switch in sceneedit to flat shadow everythings works fine, even if the actor definition says stencil ..

Nihil

  • Supporter
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 528
  • Fear me! I'm evil!
    • View Profile
    • Order of Dagon
Re: have a 3d char walking and running
« Reply #11 on: June 21, 2007, 10:51:50 AM »

Hmmm .... and the shadow-parts of the geometry appear in SceneEdit, too?

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #12 on: June 21, 2007, 11:05:49 AM »

i am not really sure what you mean ....

if i insert the char in scene edit i can see a shodow if i switch to flat shadows but i cant see a shadow if i turn to stencil shadows
i thought there would be no difference except the shadow appears on all hidden geometry that is shadow enabled by the .geometry file if i turn to stencil ...

Nihil

  • Supporter
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 528
  • Fear me! I'm evil!
    • View Profile
    • Order of Dagon
Re: have a 3d char walking and running
« Reply #13 on: June 21, 2007, 11:39:26 AM »

Note: I'm anything but an expert for stencil shadows ;-)

For using the shadows, you need the expanded hidden geometry, I think the shadow-catching objects must be named shadow_name (like walk_ and blk_ ). In SceneEdit you can see them by activating "Display Scene Geometry", and the "shadow-catchers" should appear in green.

At least that is how I understood it by reading the documentation and looking at the 3d-demo - I never really tried it myself as I don't use 3d characters atm.

Nihil

  • Supporter
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 528
  • Fear me! I'm evil!
    • View Profile
    • Order of Dagon
Re: have a 3d char walking and running
« Reply #14 on: June 21, 2007, 11:42:38 AM »

Oh, I overlooked the .geometry-stuff .... hm, then I'm out of ideas, sorry.

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #15 on: June 21, 2007, 02:52:15 PM »

okay i got it working now ...
i had to change the light position....

strange ... but first it only worked with negative numbers ... than i updated my hidden geometry and now i have to use positive numbers ...
but why are the flat shadows working like the way before and the stencil shadows not ??

doesnt matter its working now .... absolut fantastic feature !!!!
many thanks for charing time and ideas !!

greets
stucki

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #16 on: June 21, 2007, 03:39:56 PM »

but why are the flat shadows working like the way before and the stencil shadows not ??
Stencil shadows and flat shadows both use quite a different technology, so it's possible they'll give different results, especially when the light source is misplaced (e.g. when it's stuck inside the model).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

jbw

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • View Profile
Re: have a 3d char walking and running
« Reply #17 on: June 25, 2007, 12:38:40 AM »

and use WalkTo() instead of GoTo() in all your scripts..

I have another idea how to do that by changing the file "game.script" (thinking of script system similar to that used in WME demo).

1. Replace header of mouse event handler from:
Code: [Select]
on "LeftClick"
to:
Code: [Select]
function lclk()

2. Add new event handler:
Code: [Select]
on "LeftClick"
{
  actor.WalkAnimName = "walk";
  actor.Velocity = 100;
  actor.AngularVelocity = 400;
  lclk();
}

3. Add handler for double click:
Code: [Select]
on "LeftDoubleClick"
{
  actor.WalkAnimName = "run";
  actor.Velocity = 300;
  actor.AngularVelocity = 1200;
  lclk();
}

Now single and double clicks shares all the (possibly sophisticated) behaviour except of actor's moving speed.

Beware that this trick (as well as that mentioned above) has side effect: if the actor motion is triggered in other way (e.g. by scene startup script) it will use last-used, not the default walk style, so we must remember to reset walk parameters in the begining of such action. Unfortunately it cannot be done at the end of doubleclick handler as the "gotos" are nonblocking.
Logged

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #18 on: June 27, 2007, 12:59:53 PM »

while testing with the 3d-char i found two things that i would like ro have changed..

first:
if i am testing the charakter and its lightning and shadows in the scene-edititor the scene.ini is not used for actor scale and the setlightposition. (
it always takes the values from the 3dactor-file ... can this be changed ... otherwise i have to start each time the engine for seeing if the shadow is cast to the right side or if the actor scale is right ...  and i have to do this a lot of times before everything is right ..
it would reduce time for adjusting a lot

second:
in sceneedit i need more place for scrolling the scene up/down and left / right.
because if the walkplane isnt in the viewport but maybe 1 meter below so you can only see the actors head ... i cant define the walkplane and the waypoints because i cant scroll down far enough ...

but thanks for all this possibilities !!! the stencil shadows work amazing. its so beautiful when !! i love it !!
greets
stucki

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #19 on: June 27, 2007, 01:18:27 PM »

if i am testing the charakter and its lightning and shadows in the scene-edititor the scene.ini is not used for actor scale and the setlightposition. (
it always takes the values from the 3dactor-file ... can this be changed ... otherwise i have to start each time the engine for seeing if the shadow is cast to the right side or if the actor scale is right ...  and i have to do this a lot of times before everything is right ..
it would reduce time for adjusting a lot
I believe jbw mentioned he developed some debugging script for setting the light position interactively. But I don't know if he's able to share it with the community.

in sceneedit i need more place for scrolling the scene up/down and left / right.
because if the walkplane isnt in the viewport but maybe 1 meter below so you can only see the actors head ... i cant define the walkplane and the waypoints because i cant scroll down far enough ...
If you click the "Properties" tab in SceneEdit, there are two values marked "Editor margins vertical/horizontal".
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #20 on: June 27, 2007, 01:30:52 PM »

the debugging script sounds like a very nice feature ... !! maybe we can borrow it ?!?  ;)

and now i know what the margins are for !!! stupid blind me !!

thanks
stucki

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #21 on: June 27, 2007, 04:08:49 PM »

some other things ...

is it possible to adresse the lightsources from the 3ds file ?? i do all these lighting layers and they can be turned on and off but can i turn the lights for the character on and off too ??
it looks a little ridiculous if all the lights are turning on slowly one after another but the actor is just full lit from the beginning ...

can you make the camera fov. value in the scene editor editable per keyboard input. because the background and the 3ds.geometry arent exactly over another after i imported the 3ds-file and the mouse slider is not exact enought to correct it. Do you have an idea why this happens. i am exporting from 3dsmax ..

as always thanks for taking time ..
stucki

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #22 on: June 27, 2007, 05:25:50 PM »

is it possible to adresse the lightsources from the 3ds file ??
Yes, using the Scene.SetLightColor() method.

can you make the camera fov. value in the scene editor editable per keyboard input. because the background and the 3ds.geometry arent exactly over another after i imported the 3ds-file and the mouse slider is not exact enought to correct it. Do you have an idea why this happens. i am exporting from 3dsmax ..
If it helps a little, you can focus the slider and then move it by pressing the arrow keys. It will give you better precision than dragging it with mouse.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #23 on: June 27, 2007, 05:45:53 PM »

super. so i can adjust th lights  O0 ::rock O0

but the geometry problem stays ... but i found out that its not because of the .5 intervals ...
its just not 100 percent correct .... if it fits perfect on the one side it isnt exact on the other side ... i have a scene 1280 * 960 pixels and the difference is up to 4 pixels ..
just looks a little weird when the shadow stops 4 pixels before an object and then shines on the object again ..

does anybody else have the same effect ... ??

i am using the same file for rendering and exporting the 3ds.geometry ... there shouldnt be any difference ?!?

stucki

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #24 on: June 27, 2007, 08:50:53 PM »

maybe this has to do with it...
when i import the 3ds. geometry in scene edit it does not match the background very well ...
then i change the overide button it fits better even if i do not change the value
when i then uncheck the button again it changes a little more and i getting the nearest to the background  but it is far from the original imported mech ....

shouldnt the imported and the (checked and unchecked) geometry be the same ??
greets
stucki

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #25 on: June 28, 2007, 06:50:10 AM »

Sadly, that's the way it is. There are some imprecisions when comparing the Max camera and the in-game camera..
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #26 on: June 28, 2007, 08:33:04 AM »

is there no way to get the result more precise ... i am just guessing. but it makes the fantastic shadow feature a little useless for commercial games if the shadows do not fall acurate on the scene ...

in max there are two values for the camera: lens and fov. the fov value can be adjusted in scene edit ... what about the lens value ...
and maybe it would help a little if the fov value could be edited via keyboard and would be more acurat. example: the fov value in one of my scenes is 65.23 in scene edit the nearest values would be 65.0 or 65.5. could that make a difference ??

sorry for bothering you so much, but i think this feature is so important for the game atmosphere !!
greets
stucki

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #27 on: June 29, 2007, 10:46:22 AM »

sorry for bothering again ... 
i am just too curious if you are thinking about any possible solutions ?!?
am i able to help in any way ?

 

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #28 on: June 29, 2007, 11:47:52 AM »

I can make the FOV value hand-editable, but I don't have any solution for the differences in camera interpretation.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #29 on: June 29, 2007, 01:14:28 PM »

i think that would be helpful. please make the value editable by keyboard in the scene edit. and up to 2 counts after the ,

another thing that is mysterious to me. in 3dsmax the camera fov value in one scene is 64,47. the imported 3ds files gives me the fov value 51,5 in sceneedit.
why are these two values so different ?

and what about the lens value ?? can this be the reason for the small difference ??

stucki
 

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #30 on: June 29, 2007, 01:24:45 PM »

Well I think the lens are just a way of setting the field-of-view in Max. The exported 3DS file actually only contains the "lens" value, and the default FOV is computed from it.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #31 on: June 29, 2007, 01:52:47 PM »

and why does the fov value in 3dsmax differ from the one in sceneedit ?
 

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #32 on: June 29, 2007, 05:28:35 PM »

Yes, that's a good question. I'm not really sure. It seems there's no 1:1 relationship between the lens value in 3DS file and FOV. That's why SceneEdit has the ability to tweak FOV manually.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #33 on: July 01, 2007, 12:51:39 AM »

i am running into trouble again ...
till now i used to work with a premade modell and animation and everything worked fine.
now i have a new model and animated it in the same way in 3dsmax and exported it the same way with the pandasoft exporter

in fragmotion everythings looks fine . but in wme i cannot see the modell in the preview ..

when i insert it in a scene i can see the cast shadow on the ground and on the half of the model ... somehow the model seems to be transparent with a shadow cast on the inside half of the model ??

Does anybody now what i am doing wrong ??
stucki


Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #34 on: July 01, 2007, 06:59:30 AM »

Perhaps the new model uses a different scale and the light needs to be moved?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #35 on: July 01, 2007, 10:04:46 AM »

thats what i thought too , but experimenting with these values results only in other weird looking transparent characters casting more or less real shadows ...
here is the char in fragmotion

here is the chr in a scene


and here is a link to the x-file if you want to have a look ...
http://www.schach-welten.de/nik.X

hope somebody has an idea about it ...
thanks for helping
stucki

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #36 on: July 01, 2007, 10:26:58 AM »

fixed it maself ...
was something about the texture path ...
sorry for bothering ...

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #37 on: July 05, 2007, 11:34:50 PM »

huray !! i managed to get my first real character into my game and it works wonderful .. ecept my pretty basic animation skills .... but i am learning ...
now i am integrating all the effects that i have done with the 2d actors ...

i know it is possible to turn 3d lights on and off
and it is possible to set its color by rgb value .. that has to be the FFFFFF number thing ... right ??
is it possible to set the intensity of the light just like the alpha value of a sprite ??

i mean i am using slow fade ins for the lights and the turn on and off method doesnt work very good with this.

i guess setting the colour may help, but how can i change the amount of light ... maybe for a flickering fire i might want to increase and decrease the light amount by script.
how can this be done if it can be done ??

greets stucki
 

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #38 on: July 06, 2007, 07:57:38 AM »

For lights using shades of gray (including black and white) it's easy. You simply set the R, G and B components to the same value (just like you're setting the Alpha value in a loop for fading).
For colored lights the correct way would be to convert the RGB color to HSL (hue-saturation-luminance). Then you'd change the L (luminance) component in a loop and convert the HSL color back to RGB before passing the color to Scene.SetLightColor(). You can find the code for converting RGB->HSL and HSL->RGB on this site.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #39 on: July 06, 2007, 01:11:19 PM »

okay i trie to get it working this way.

but wouldnt it be nice to have a function SceneSetLightAmount like having a SceneEn/Disablelight and SetColorfunction. Would make things much easier, because i need it in nearly every scene ....

by the way .. is it possible to query the lightamount and the colour from the 3ds.file ??

thanks for helping

stucki

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #40 on: July 08, 2007, 04:28:14 PM »

Nope, apparently there's no GetLightColor() method at the moment, but there should be. Adding it to my ToDo.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #41 on: July 08, 2007, 10:07:20 PM »

thanks very much thats good news ... and about the lightamount/intensity thing .... could you please add this too ?!? it would help pretty much.
greets stucki


Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #42 on: July 11, 2007, 08:06:58 AM »

is it possible to have a animation from frame 100 to 500 but the looping should be from 200 to 500.
for example i want my char to kneel down and then start the looping animation of breathing while kneeing.
or do i have to make to separate animations ?
 

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #43 on: July 11, 2007, 09:42:23 AM »

Yes, you will need to use two separate animations.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #44 on: July 11, 2007, 10:05:12 AM »

thanks !!  got it working ...
another thing....
does actor.Talk overrirde the playasyncanim command ? and if how can i work around this ..


 

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: have a 3d char walking and running
« Reply #45 on: July 11, 2007, 10:29:51 AM »

The Talk() method plays the "talk" animation in channel 0. If I understand it correctly, you need to premanently change the actor's pose. In that case perhaps the most effective way would be to set the idle and talk animations to the kneeling pose instead of using PlayAnim.

Code: WME Script
  1. actor.TalkAnimName = "kneel"; // or whatever the animation is called
  2. actor.IdleAnimName = "kneel";
  3.  

You can set them back once the character stands up again.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #46 on: July 11, 2007, 10:33:17 AM »

thanks thats it !!!

jbw

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • View Profile
Re: have a 3d char walking and running
« Reply #47 on: July 25, 2007, 03:22:22 AM »

I believe jbw mentioned he developed some debugging script for setting the light position interactively. But I don't know if he's able to share it with the community.

It is no very big secret (and please don't expect too much).

I have started my adventure of adventures from the "wme_demo_3d" example, so:
 - my script system is still similar to it
 - you can apply my code to it and quickly see results

1. All my interactive debug extensions are called from infinite loop of game_daemon.script by:
Code: [Select]
  if (Game.DebugMode) Game.debugkeys();
This is deliberately limited to debug mode only.

2. The main code is placed in the game.script:
Code: [Select]
method debugkeys()
{
  var shift = Keyboard.IsKeyDown(VK_SHIFT); //-- it is smarter to check it once
  //-- some stupid actions on some stupid keys, like:
  if (Keyboard.IsKeyDown("0")) Game.QuitGame(); //-- exit without annoying dialogues ;-)
  //-- and more, and more, and finally:
  var max = 300; //-- reasonably big limit
  var mod = max+max; //-- our numbers will be changed in circular manner with "modulo"
  var inc = 10; //-- increment by tenths is precise enough
  var chg = false; //-- no changes so far
  if (shift) inc = mod-inc; //-- [Shift] key forces decrementing instead of incrementing
  if (Keyboard.IsKeyDown("x") && (shlx != null)) { shlx = ((shlx+max+inc)%mod)-max; chg = true; }
  if (Keyboard.IsKeyDown("y") && (shly != null)) { shly = ((shly+inc)%mod); chg = true; }
  if (Keyboard.IsKeyDown("z") && (shlz != null)) { shlz = ((shlz+max+inc)%mod)-max; chg = true; }
  if (chg) //-- we have changed something
  {
    actor.SetLightPosition(shlx, shly, shlz);
    Game.Msg("shadow casting light:"+shlx+","+shly+","+shlz);
  }
}
Keys 'x', 'y', 'z' leads to change light position toward X, Y or Z axis respectively (with 'Shift' in reverse direction).
Note that this is not 'click', but rather 'depress' handler, so values will be changed continously as long as we hold the key.
For X and Z the range -300..290 was good for me, and Y - 0..590 (negative Y makes no sense).
Checking for 'null' prevents unwanted action before initialization (see below).

3. Globals are placed in base.inc:
Code: [Select]
global shlx;
global shly;
global shlz;
and initialized for each scene in scene.script:
Code: [Select]
if (Scene.shlpos == null) //-- no scene's custom property named 'shlpos'?
{
  shlx = -40; shly = 200; shlz = -40; //-- default for 'trinity'
}
else //-- get shadow light position from custom property
{
  var tmp = new String(Scene.shlpos); tmp = tmp.Split();
  shlx = ToInt(tmp[0]);
  shly = ToInt(tmp[1]);
  shlz = ToInt(tmp[2]);
}
actor.SetLightPosition(shlx, shly, shlz);

Current light position shows itself in debug message area on the screen - we can read it using eyes and keep it by pen-and-paper method ;-)
Catched numbers can be coded permanently as the 'shlpos' property of scene in the form of comma separated list.

I'm sorry for the extended delay, but I'm not reading posts here much frequently. If somebody wishes to get rapid answer please ask me by e-mail.
Logged

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: have a 3d char walking and running
« Reply #48 on: July 25, 2007, 08:30:02 AM »

thanks for sharing this very useful script !!
it makes light placement much more comfortable !!!
greets
stucki
Pages: 1 2 3 4 [All]
 

Page created in 0.071 seconds with 24 queries.