CnC Source Forums: Animating A Model When Enemy Comes In Range - CnC Source Forums

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Animating A Model When Enemy Comes In Range Rate Topic: -----

#1 User is offline   danpaul88 

  • umm...
  • Group: VIP Member
  • Posts: 161
  • Joined: 17-December 04

Posted 24 April 2005 - 01:50 PM

OK, this may seem like a dumb question but I have never tried this before...

How can I setup a base defense (setup as a mounted vehicle in leveledit) to 'deploy' when an enemy comes in range? I have created bones where the moving parts are, copied these bones to a new gmax file and animated them how they should work, but I need to know how to make the animation run when an enemy is in range....

I think what I need is something like the reborn laser turrets will use (they said something about it in the latest updates at some point).

any help would be appreciated :D
0

#2 User is offline   NeoSaber 

  • Renegade Mapper
  • Group: VIP Member
  • Posts: 350
  • Joined: 19-December 02

Posted 24 April 2005 - 02:29 PM

I personally haven't tried it before, but I think it could be done using a few scripts. Mainly the scripts JFW_Enemy_Seen_Send_Custom and JFW_Set_Animation_On_Custom. Use the first script so the gun will send a message to itself when it sees an enemy, and use the second script to run the deploy animation when it gets the "I saw an enemy" message. The SightRange of the weapon would need to be about the same as the weapon range, so when it popped it could fire.

I'm sure there are a lot of little details that would need to be worked out, but that's what I would start with.
0

#3 User is offline   danpaul88 

  • umm...
  • Group: VIP Member
  • Posts: 161
  • Joined: 17-December 04

Posted 25 April 2005 - 02:38 PM

well they sound like what I need, had a fiddle around and can't get it to work tho...

I have never played with animations before tho, am I right to think that you copy the animation bones to a new gmax file, animate them as they should move on the model and export them under a different name, and them put the animname.w3d as the animation name in the script? because I have looked at a few in the presets and they have animname.animname as the animation name...
0

#4 User is offline   sgtmay 

  • Jack of all trades master of none
  • Group: VIP Member
  • Posts: 1,384
  • Joined: 27-August 03

Posted 25 April 2005 - 03:30 PM

You need to create a hirearcheal model and export it to w3d.....save your first gmax copy.

Then you will have to animate the model by manipulating the bones and setting key frames......then export the animation as "pure animation".....checkmark "Export Using Existing Skeleton".....and select your first exported version as the existing skeleton.

Make sure that you don't move the animation bones from their base pose in frame 0 (original model's bone position) or it will not export correctly.

To view the animation in the w3d viewer open it and then click file/open and select both the base model and the pure animation....then select open or OK.

When you open them you will see the base model and a child animation that is parented to the base model......and the exact name of that animation is displayed in the side tool bar.

Then when you want to impliment the animation you will call the animation "original model name"."pure animation model name".......for example.....Orcabomber.door_anim

The commando editor part is the hardest thing to figure out.
Some of the script values need to be names and some need to be the preset identification numbers......the readme isn't exactly clear on some of the settings but if you play around with them enough you will figure it out ;)
0

#5 User is offline   danpaul88 

  • umm...
  • Group: VIP Member
  • Posts: 161
  • Joined: 17-December 04

Posted 25 April 2005 - 04:03 PM

thanks, thats much clearer now. I didn't know about the export with existing skeleton etc

I will have a go tommorow :thumb:
0

#6 User is offline   danpaul88 

  • umm...
  • Group: VIP Member
  • Posts: 161
  • Joined: 17-December 04

Posted 05 October 2005 - 04:27 PM

(Sorry for bump by the way)

It's been a while since I worked on this, and I got round to it at last.

The two scripts ( JFW_Enemy_Seen_Send_Custom and JFW_Set_Animation_On_Custom ) work, but not as I need them to.

While an enemy is in range it resets the animations every second or so, so the weapon redeploys constantly, and is therefore unable to shoot while this is going on.

Oh, and another thing, my model has no texture set, yet when you see it in-game it has the westwood logo (missing texture) applied quite small, and its scrolling over the surface :S

Any ideas on either of these things?
0

#7 User is offline   -= Nameme99 =- 

  • CnC-Source Staff
  • View gallery
  • Group: Network Mod Staff
  • Posts: 489
  • Joined: 25-May 05

Posted 05 October 2005 - 06:39 PM

danpaul88, on Apr 25 2005, 05:03 PM, said:

thanks, thats much clearer now. I didn't know about the export with existing skeleton etc

I will have a go tommorow :thumb:
<{POST_SNAPBACK}>

um maybe make a ping-pong animation? also look on the scripts for like a deploy timer or so.
0

#8 User is offline   danpaul88 

  • umm...
  • Group: VIP Member
  • Posts: 161
  • Joined: 17-December 04

Posted 06 October 2005 - 02:17 AM

I found a script that works slightly better, JFW_Base_Defense_Animated_No_VTOL (The no_vtol part is because I only want it shooting ground units).

Now the weapon deploys, but immediatly undeploys again, before it has chance to finish aiming and shoot. Maybe I will send jonwil an email to ask if he can modify this script sometime...

I would still like to know if anyone has any ideas about the scrolling texture?
0

#9 User is offline   -= Nameme99 =- 

  • CnC-Source Staff
  • View gallery
  • Group: Network Mod Staff
  • Posts: 489
  • Joined: 25-May 05

Posted 06 October 2005 - 05:27 AM

open your model in renx then look at the texture selection and then go under settings then over lap I think (havn't opened renx in a while)
0

#10 User is offline   danpaul88 

  • umm...
  • Group: VIP Member
  • Posts: 161
  • Joined: 17-December 04

Posted 06 October 2005 - 07:09 AM

It shouldnt have any texture applied at all, I never gave it one..

But I will look when I get home
0

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users