| Author |
Topic: Animation Error: "Not an Actor" |
| Tim451 |
 |
General Member Since: Feb 22, 2005 Posts: 771 Last: May 28, 2009 [view latest posts] |
|
|
|
Category: CoD4 MP Mapping Posted: Wednesday, May. 27, 2009 12:03 pm |
 |
I've got a doorway that i'd like an actor to walk past, perform an animation, then vanish (going for a creepy style map). I've got an actor set up as a spawner with a targetname "ghost1" and a scripted node with the targetname "ghost1_look" where I want the animation to be performed. I keep getting a "Not an Actor" error when I try to run the level. I have a spawned patroller & a spawned dog working flawlessly but I can't seem to get this one to work. My code is below:
main gsc file:
Code:
#include maps\_utility;
#include maps\_anim;
#include common_scripts\utility;
#include animscripts\utility;
#include maps\_patrol;
#using_animtree( "generic_human" );
main()
{
maps\_load::main();
maps\tunnel_fx::main();
maps\createfx\tunnel_fx::main();
maps\tunnel_anim::main();
VisionSetNaked( "tunnel" );
maps\_load::set_player_viewhand_model
( "viewhands_player_sas_woodland" );
setExpFog(500, 3500, .1, .125, .14, 0);
level.player takeallweapons();
level.player giveWeapon( "m4_grunt" );
level.player giveWeapon( "usp" );
level.player giveWeapon( "flash_grenade" );
level.player switchToWeapon( "m4_grunt" );
patroller1 = getent( "patroller1", "targetname" );
patroller1 thread add_spawn_function( maps\_patrol::patrol, self.target );
thread doorghost1();
}
doorghost1()
{
doorghost = getent("ghost1","targetname");
doorghost.animname = "smoker";
smokenode = getnode("ghost1_look","targetname");
doorghost setgoalnode(smokenode);
doorghost waittill("goal");
smokenode anim_reach_solo(doorghost,"smoke_idle");
smokenode anim_single_solo(doorghost,"smoke_idle");
self delete();
}
anim gsc file:
Code:
#include maps\_utility;
#include maps\_anim;
#include common_scripts\utility;
#include animscripts\utility;
#using_animtree( "generic_human" );
main()
{
level.scr_anim[ "smoker" ][ "smoke_idle" ] = %patrol_bored_idle_smoke;
level.scr_anim[ "generic" ][ "patrol_walk" ] = %patrol_bored_patrolwalk;
level.scr_anim[ "generic" ][ "patrol_walk_twitch" ] = %patrol_bored_patrolwalk_twitch;
level.scr_anim[ "generic" ][ "patrol_stop" ] = %patrol_bored_walk_2_bored;
level.scr_anim[ "generic" ][ "patrol_start" ] = %patrol_bored_2_walk;
level.scr_anim[ "generic" ][ "patrol_turn180" ] = %patrol_bored_2_walk_180turn;
level.scr_anim[ "generic" ][ "patrol_idle_1" ] = %patrol_bored_idle;
level.scr_anim[ "generic" ][ "patrol_idle_2" ] = %patrol_bored_idle_smoke;
level.scr_anim[ "generic" ][ "patrol_idle_3" ] = %patrol_bored_idle_cellphone;
level.scr_anim[ "generic" ][ "patrol_idle_4" ] = %patrol_bored_twitch_bug;
level.scr_anim[ "generic" ][ "patrol_idle_5" ] = %patrol_bored_twitch_checkphone;
level.scr_anim[ "generic" ][ "patrol_idle_6" ] = %patrol_bored_twitch_stretch;
level.scr_anim[ "generic" ][ "patrol_idle_smoke" ] = %patrol_bored_idle_smoke;
level.scr_anim[ "generic" ][ "patrol_idle_checkphone" ] = %patrol_bored_twitch_checkphone;
level.scr_anim[ "generic" ][ "patrol_idle_stretch" ] = %patrol_bored_twitch_stretch;
}
It's probably something simple that I've overlooked but I've tried everything I can think of. Any ideas?
Cheers! |
 |
|
|
| Tim451 |
 |
General Member Since: Feb 22, 2005 Posts: 771 Last: May 28, 2009 [view latest posts] |
|
|
|
|
| SparkyMcSparks |
 |
General Member Since: Feb 28, 2004 Posts: 1713 Last: Dec 29, 2016 [view latest posts] |
|
|
 |
|
Category: CoD4 MP Mapping Posted: Thursday, May. 28, 2009 11:01 am |
 |
Code: doorghost = getent("ghost1","targetname");
Is that an actual AI or a spawner. |
|
|
|
| Tim451 |
 |
General Member Since: Feb 22, 2005 Posts: 771 Last: May 28, 2009 [view latest posts] |
|
|
|
|
| jeannotvb |
 |
General Member Since: Dec 8, 2007 Posts: 620 Last: Feb 1, 2010 [view latest posts] |
|
|
 |
|
Category: CoD4 MP Mapping Posted: Thursday, May. 28, 2009 12:56 pm |
 |
A spawner is not an actor, remove the trigger and spawn an actor through the spawner with a script:
Use this: DoSpawn();
like so:
Code:
spawner = getEnt( "my_spawner", "targetname" );
myAI = spawner DoSpawn();
myAI will become the name of the spawner actor, you will use this name to call the AI in script so use myAI.
For example:
Code:
myAI.animname =
He will not spawn if you can see him, if you want it to spawn even if you can see him then replace DoSpawn with StalingradSpawn.
edited on May. 28, 2009 08:57 am by jeannotvb
edited on May. 28, 2009 08:58 am by jeannotvb |
|
|
|
| Tim451 |
 |
General Member Since: Feb 22, 2005 Posts: 771 Last: May 28, 2009 [view latest posts] |
|
|
|
Category: CoD4 MP Mapping Posted: Thursday, May. 28, 2009 02:25 pm |
 |
Ok cheers for that, I've got him spawning now. How can I use the script to make him spawn only when I near the doorway? Currently he spawns, does his thing, then deletes before I get anywhere near it. I want the effect to be that when the player nears the doorway he moves into view, does his animation, then vanishes.
This is the "doorghost1" thread as it stands:
Code:
doorghost1()
{
spawner = getent("ghost1","targetname");
ghostspawn = spawner StalingradSpawn();
ghostspawn.animname = "smoker";
smokenode = getnode("ghost1_look","targetname");
ghostspawn setgoalnode(smokenode);
ghostspawn waittill("goal");
smokenode anim_reach_solo(ghostspawn,"smoke_idle");
smokenode anim_single_solo(ghostspawn,"smoke_idle");
//ghostspawn delete();
}
I commented out the "ghostspawn delete();" line for now so I could ensure he was spawning correctly, which he is.
Cheers
edited on May. 28, 2009 10:29 am by Tim451 |
 |
|
|
| techno2sl |
 |
General Member Since: Aug 5, 2004 Posts: 2977 Last: Oct 14, 2010 [view latest posts] |
|
|
|
Category: CoD4 MP Mapping Posted: Thursday, May. 28, 2009 03:04 pm |
 |
Code:
doorghost1()
{
spawner = getent("ghost1","targetname");
trig = getent("trig_ghost", "targetname);
trig waittill("trigger)
ghostspawn = spawner StalingradSpawn();
ghostspawn.animname = "smoker";
smokenode = getnode("ghost1_look","targetname");
ghostspawn setgoalnode(smokenode);
ghostspawn waittill("goal");
smokenode anim_reach_solo(ghostspawn,"smoke_idle");
smokenode anim_single_solo(ghostspawn,"smoke_idle");
//ghostspawn delete();
}
So add a trigger (most likely a trigger_multiple) with a targetname of "trig_ghost".
Not sure if that will work as I have no knowledge of scripting ![[drink]](images/BBCode/smilies/drink.gif) |
|
|
|
| Tim451 |
 |
General Member Since: Feb 22, 2005 Posts: 771 Last: May 28, 2009 [view latest posts] |
|
|
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|