Page 1 of 1

rappeling script help

Posted: June 12th, 2011, 5:06 pm
by Mooselflies
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

Re: rappeling script help

Posted: June 12th, 2011, 6:01 pm
by Drofder2004

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...

Re: rappeling script help

Posted: June 12th, 2011, 6:16 pm
by Mooselflies
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 );
}

Re: rappeling script help

Posted: June 12th, 2011, 7:23 pm
by Drofder2004
does:
mapsorchtest_anim.gsc exist?

Or should it be: maps\orchtest_anim?

Re: rappeling script help

Posted: June 12th, 2011, 7:56 pm
by IzNoGoD
Mooselflies wrote:

Code: Select all

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

Re: rappeling script help

Posted: June 12th, 2011, 8:28 pm
by Drofder2004
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".

Re: rappeling script help

Posted: June 13th, 2011, 10:14 am
by Mooselflies
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

Re: rappeling script help

Posted: June 13th, 2011, 11:15 am
by Drofder2004
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...