rappeling script help

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
User avatar
Mooselflies
CJ Spammer!
CJ Spammer!
Posts: 641
Joined: April 20th, 2009, 8:29 pm
PSN ID: mooselflies
Location: Reading :<

rappeling script help

Post by Mooselflies » June 12th, 2011, 5:06 pm

i get a error with the last line b4 the } which says that it is a syntax error

Code: Select all

#include maps\_utility;
#include common_scripts\utility;
#include maps\_anim;
#include maps\_vehicle_aianim;
#include maps\orchtest;
 
#using_animtree ("generic_human");
 
anim_main()
{
    thread blackhawk_anims();
}
 
#using_animtree( "vehicles" );
blackhawk_anims()
{
    level.scr_anim[ "blackhawk" ][ "idle" ][ 0 ]                 = %blackout_bh_evac_heli_idle;
    level.scr_anim[ "blackhawk" ][ "landing" ]                 = %blackout_bh_evac_heli_land;
 
    
    level.scr_anim[ "blackhawk" ][ "rotors" ]                     = %bh_rotors;
    level.scr_animtree[ "blackhawk" ]                         = #animtree;
}
 
 
player_heli_ropeanimoverride()
{
    tag = "TAG_FastRope_RI";
    model = "rope_test_ri";
    snipeanim = %armada_blackhawk_sniper_idle_fastrope80;
    idleanim = %armada_blackhawk_sniper_idle_loop_fastrope80;
    dropanim = %armada_blackhawk_sniper_drop_fastrope80;
    
    array = [];
    array[ "TAG_FastRope_RI" ] = spawnstruct();
    self.attach_model_override = array;  // gets rid of blackhawks standard fastrope stuff for this rig
 
    rope = spawn("script_model", level.player.origin);
    rope setmodel (model);
    rope linkto (self, tag, (0,0,0),(0,0,0));
    rope useanimtree (#animtree);
    
//    flag_wait ("snipefromheli");
    //self notify ("groupedanimevent","snipe");  //tells the ai to snipe.
    //maps_vehicle_aianim::animontag( rope, tag, snipeanim );
    thread player_heli_ropeanimoverride_idle( rope, tag, idleanim );
    self waittill ("unload");
    level.player thread play_loop_sound_on_entity("fastrope_loop_plr");
    //maps_vehicle_aianim::animontag( rope, tag, dropanim );
    wait getanimlength( dropanim ) - .2;
    level.player stop_loop_sound_on_entity("fastrope_loop_plr");
     rope unlink();
     level.player thread play_sound_on_entity("fastrope_end_plr");
    wait 10;
    rope delete();  // possibly do something to delete when the player is not looking at it.    
}
 
player_heli_ropeanimoverride_idle( guy, tag, animation )
{
    self endon ("unload");
    while(1)
        maps_vehicle_aianim::animontag( guy, tag, animation );
}


its trying to get a rappeling helicopter to work
Last edited by Drofder2004 on June 12th, 2011, 6:00 pm, edited 1 time in total.
Reason: [code=cod]

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: rappeling script help

Post by Drofder2004 » June 12th, 2011, 6:01 pm

Code: Select all

maps_vehicle_aianim::animontag( guy, tag, animation );
should be

Code: Select all

maps\_vehicle_aianim::animontag( guy, tag, animation );
Or simply:

Code: Select all

animontag( guy, tag, animation );
because you already have the "#include maps\_vehicle_aianim;" on the top...
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Mooselflies
CJ Spammer!
CJ Spammer!
Posts: 641
Joined: April 20th, 2009, 8:29 pm
PSN ID: mooselflies
Location: Reading :<

Re: rappeling script help

Post by Mooselflies » June 12th, 2011, 6:16 pm

syntax error @ 2nd last line

Code: Select all

#include common_scripts\utility;      
#include maps\_utility;
#include maps\_anim;
#include maps\_vehicle_aianim;
 
main()
{
 
default_start( ::ride_start );          //ACTIVE IT
precachemodel( "fastrope_arms" );      
 
maps\_blackhawk::main( "vehicle_blackhawk" );
maps\_load::main();
maps\orchtest_anim::anim_main();  
 
}
 
 
loadplayer( position, animfudgetime )
{
    if ( getdvar( "fastrope_arms" ) == "" )
        setdvar( "fastrope_arms", "0" );
    if ( !isdefined( animfudgetime ) )
        animfudgetime = 0;
    assert( isdefined( self.riders ) );
    guy = undefined;
    for ( i = 0; i < self.riders.size; i++ )
    {
        if ( self.riders[ i ].pos == position )
        {
            guy = self.riders[ i ];
            guy.drone_delete_on_unload = true;
            guy.playerpiggyback = true;
            break;
        }
    }
    
    animpos = anim_pos( self, position );
    guy notify( "newanim" );
    guy detachall();
    guy setmodel( "fastrope_arms" );
    guy useanimtree( animpos.player_animtree );
    guy_idle( guy, position );    
    level.player playerlinktodelta( guy, "tag_player", 1.0, 60, 28, 30, 30, true );   //number 6 seat
    level.player freezecontrols(false);    
 
    guy hide();
    animtime = getanimlength( animpos.getout );
    animtime -= animfudgetime;
 
    self waittill( "unload" );
    if ( getdvar( "fastrope_arms" ) != "0" )
        guy show();
 
    level.player disableweapons();
    guy notsolid();
 
    wait animtime;
 
    level.player unlink();
    level.player enableweapons();
}
 
ride_start()
 
{
 heli_trigger = getent( "heli_trigger", "targetname" );
 heli_trigger notify ( "trigger" );
 level.player_heli = waittill_vehiclespawn_noteworthy( "players_helicopter" );
 level.player_heli thread mapsorchtest_anim::player_heli_ropeanimoverride();
 level.player_heli thread loadplayer( 3 );
}

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: rappeling script help

Post by Drofder2004 » June 12th, 2011, 7:23 pm

does:
mapsorchtest_anim.gsc exist?

Or should it be: maps\orchtest_anim?
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: rappeling script help

Post by IzNoGoD » June 12th, 2011, 7:56 pm

Mooselflies wrote:

Code: Select all

while(1)
        maps_vehicle_aianim::animontag( guy, tag, animation );
}
Are you sure there shouldnt be a wait in this?
LMGTFY!

Its not a glitch... Its the future!

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: rappeling script help

Post by Drofder2004 » June 12th, 2011, 8:28 pm

IzNoGoD wrote:
Mooselflies wrote:

Code: Select all

while(1)
        maps_vehicle_aianim::animontag( guy, tag, animation );
}
Are you sure there shouldnt be a wait in this?
I checked this first, but this is exactly how IW has done it.

Edit:
guy waittillmatch( flag, "end" );

Inside the function "animontag".
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Mooselflies
CJ Spammer!
CJ Spammer!
Posts: 641
Joined: April 20th, 2009, 8:29 pm
PSN ID: mooselflies
Location: Reading :<

Re: rappeling script help

Post by Mooselflies » June 13th, 2011, 10:14 am

Drofder2004 wrote:
IzNoGoD wrote:
Mooselflies wrote:

Code: Select all

while(1)
        maps_vehicle_aianim::animontag( guy, tag, animation );
}
Are you sure there shouldnt be a wait in this?
I checked this first, but this is exactly how IW has done it.

Edit:
guy waittillmatch( flag, "end" );

Inside the function "animontag".

doesn't work still a syntax error with line 69

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: rappeling script help

Post by Drofder2004 » June 13th, 2011, 11:15 am

Mooselflies wrote:doesn't work still a syntax error with line 69
level.player_heli thread mapsorchtest_anim::player_heli_ropeanimoverride();

"mapsorchtest_anim" - What is it, because it is not a raw file
"maps\orchtest_anim" is also not a raw file...
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest