Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 10 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 SP Mapping
CoD 4 mapping and level design for single player.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: waittill goal
Marty22
General Member
Since: Jan 2, 2008
Posts: 42
Last: Sep 17, 2011
[view latest posts]
Level 2
Category: CoD4 SP Mapping
Posted: Monday, Apr. 26, 2010 08:52 pm
Hi, for the last couple of weeks I have tried to make a function work; the waittill( "goal" );. But it just skips it, and to make sure, it didn't work properly, I made another actor go to a node as soon as the first actor had come to the node. Both actors moved right at the beginning.

Generally I have some very weird problems with simple things with the modding tools sometimes, and they don't always get solved.

Anyway, here's the script, which I have shortened it down to, to locate the problem:
Code:
#include common_scripts\utility;

#include maps\_utility;

#include maps\_anim;

#include maps\_vehicle;

#include maps\test_code;


main()
{   
    maps\test_anim::main();
    maps\_load::main();

    /////////////////////////
    //      Level      //
    ////////////////////////
    level.campaign = "british";
    level.early_level[ level.script ] = false;
    battlechatter_off( "allies" );
    battlechatter_off( "axis" );
    battlechatter_off( "neutral" );

    /////////////////////////
    //Player Setup//
    ////////////////////////
    level.player takeallweapons();
    level.player giveWeapon( "mp5_silencer");
    level.player giveMaxAmmo("mp5_silencer");
    level.player giveWeapon("usp_silencer");
    level.player giveWeapon("flash_grenade");
    level.player switchtoWeapon("mp5_silencer");
    level.player setOffhandSecondaryClass( "flash" );
    level.player setViewmodel( "viewhands_black_kit" );

    ////////////////////////
    //  Precaches //
    ///////////////////////
    precacheString( &"TEST_INTRO_1" );
    precacheString( &"TEST_INTRO_2" );
    precacheString( &"TEST_INTRO_3" );
    precacheString( &"TEST_INTRO_4" );
    precacheString( &"TEST_INTRO_LOGO" );
    precacheString( &"TEST_INTRO_LOGO_2" );
    precacheshader("white");
    precacheshader("black");
    precacheshader("test_logo");
    precacheItem("facemask");

    //////////////////////////
    //Weapon Clips//
    //////////////////////////
    level.weaponClipModels = [];
    level.weaponClipModels[1] = "weapon_ak47_clip";
    level.weaponClipModels[2] = "weapon_mp5_clip";
    level.weaponClipModels[3] = "weapon_m16_clip";

    /////////////////////////
    //    Threads    //
    ////////////////////////
    thread intro();
}

intro()
{
    level.player disableWeapons();
    level.player freezeControls( true );

    MusicPlayWrapper( "intro" );

    thread intro_sequence();
}

intro_sequence()
{
    level.player unlink();

    smooth_move( "intro_point", 0.50 ); // custom function
    wait 0.01;
    level.player unlink();

    thread squad_setup();
    thread introscreen();
}

introscreen()
{ 
    level.intro_offset = ( -20 );
    lines = [];
    lines[ lines.size ] = &"TEST_INTRO_1";
    lines[ "date" ] = &"TEST_INTRO_2";
    lines[ lines.size ] = &"TEST_INTRO_3";
    lines[ lines.size ] = &"TEST_INTRO_4";
    maps\_introscreen::introscreen_feed_lines( lines );

    level.intro_offset = ( 0 );
    fade_time = ( 8 );
    time = ( 8.5 );
    maps\_introscreen::introscreen_generic_fade_in( "black", time, fade_time );

    thread start_briefing();
}

squad_setup()
{
    guy1_spawn = getent( "guy1", "targetname" );
    level.guy1 = guy1_spawn stalingradspawn();
    level.guy1.animname = "guy1"; 
    level.guy1 thread magic_bullet_shield();
    level.guy1.accuracy = 1000;
    level.guy1.grenadeammo = 0;
    level.guy1 pushplayer( true );

    guy2_spawn = getent( "guy2", "targetname" );
    level.guy2 = guy2_spawn stalingradspawn();
    level.guy2.animname = "guy2";
    level.guy2 thread magic_bullet_shield();
    level.guy2.accuracy = 900;
    level.guy2.grenadeammo = 2;
    level.guy2 pushplayer( true );

    guy3_spawn = getent( "guy3", "targetname" );
    level.guy3 = guy3_spawn stalingradspawn();
    level.guy3.animname = "guy3";
    level.guy3 thread magic_bullet_shield();
    level.guy3.accuracy = 500;
    level.guy3.grenadeammo = 0;
    level.guy3 pushplayer( true );

    level.squad = getentarray( "squad", "script_noteworthy" );
}

start_briefing()
{
    level.guy1 anim_single_solo( level.guy1, "briefing" );
    
    wait 1;

    level.player enableWeapons();
    level.player freezeControls( false );

    thread door();
}

door() 
{
     guy2_node = getnode( "guy2_door", "targetname" );
     level.guy2 setgoalnode(guy2_node);

     wait 0.5;

     level.guy2 waittill( "goal" );

     guy3_node = getnode( "guy3_node", "targetname" );
     level.guy3 setgoalnode(guy3_node);
}


Now, I have tried to remove all other custom content and reinsert the files for the modding tools manually in again.

In the test map, it doesn't work either, and I'm sure, it's not just a wait function I need. No errors also.
Share |
Marty22
General Member
Since: Jan 2, 2008
Posts: 42
Last: Sep 17, 2011
[view latest posts]
Level 2
Category: CoD4 SP Mapping
Posted: Wednesday, Apr. 28, 2010 09:48 pm
I have tried to narrow down the problem in my script:
Code:
#include common_scripts\utility;

#include maps\_utility;

#include maps\test_code;


main()
{   
    maps\test_anim::main();
    maps\_load::main();

    /////////////////////////
    //Player Setup//
    ////////////////////////
    level.player setViewmodel( "viewhands_black_kit" );

    /////////////////////////
    //    Threads    //
    ////////////////////////
    thread intro();
}

intro()
{
    thread intro_sequence();
}

intro_sequence()
{
    level.player unlink();

    smooth_move( "intro_point", 0.50 ); // custom function
    wait 0.01;
    level.player unlink();

    thread squad_setup();
    thread introscreen();
}

introscreen()
{ 
    thread start_briefing();
}

squad_setup()
{
    guy1_spawn = getent( "guy1", "targetname" );
    level.guy1 = guy1_spawn stalingradspawn();

    guy2_spawn = getent( "guy2", "targetname" );
    level.guy2 = guy2_spawn stalingradspawn();

    guy3_spawn = getent( "guy3", "targetname" );
    level.guy3 = guy3_spawn stalingradspawn();
}

start_briefing()
{
    thread door();
}

door() 
{
     guy2_node = getnode( "guy2_door", "targetname" );
     level.guy2 setgoalnode(guy2_node);

     level.guy2 waittill( "goal" );

     guy3_node = getnode( "guy3_node", "targetname" );
     level.guy3 setgoalnode(guy3_node);
}

But again: nothing.

edited on Apr. 28, 2010 05:50 pm by Marty22
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
Category: CoD4 SP Mapping
Posted: Saturday, May. 1, 2010 06:46 am
so wat your trying to do is get level.guy2 to go to a spot and once it reaches there have another actor go to it? and then wait there? i know that ur trying to get them to reach there and wait till he is there. but i just dont know which actors ur talking about. plz clarify so i can help u out more.
Share |
Marty22
General Member
Since: Jan 2, 2008
Posts: 42
Last: Sep 17, 2011
[view latest posts]
Level 2
Category: CoD4 SP Mapping
Posted: Sunday, May. 2, 2010 09:13 pm
I use the SAS actors.
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
Category: CoD4 SP Mapping
Posted: Sunday, May. 2, 2010 09:27 pm
yea i know but which actors are going where?
Share |
Marty22
General Member
Since: Jan 2, 2008
Posts: 42
Last: Sep 17, 2011
[view latest posts]
Level 2
Category: CoD4 SP Mapping
Posted: Monday, May. 3, 2010 08:24 pm
ok, it was just hard to tell, what exactly you were asking.

Nevertheless, I just want the actors to go to each their node, but one of them with the wait:

level.guy2 -> guy2_node
level.guy3 -> guy3_node

It's just a test to see if the function works. I only use the 2 of them, because it makes it easier.


Maybe upload the test map, so you could try and compile it?

thanks in advance
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
Category: CoD4 SP Mapping
Posted: Monday, May. 3, 2010 10:19 pm
hit me up on xfire. it would probably be best. my xfire is voidsource
Share |
sgtpadrino
General Member
Since: Apr 22, 2008
Posts: 5
Last: Jul 14, 2011
[view latest posts]
Level 0
Category: CoD4 SP Mapping
Posted: Thursday, May. 27, 2010 12:57 am
If you want one of them to wait, don't use the waittill(goal) command - that command instructs the AI to go to their goal node and then do whatever the next lines instruct (say, play an animation.)

Instead, you just need the 'wait' command.

level.guy2 wait(5)

(where the number in the parenthesis is the number of seconds you want him to wait for)
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 SP Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»