From df97ac177886e453da3253e29ee70ad457ebd5df Mon Sep 17 00:00:00 2001 From: div0 Date: Fri, 12 Jun 2009 08:19:20 +0000 Subject: [PATCH] make proper use of barriers now :P git-svn-id: svn://svn.icculus.org/nexuiz/trunk@6997 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- misc/tools/midi2cfg-ng.conf | 11 ++++++----- misc/tools/midi2cfg-ng.pl | 21 ++++++++------------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/misc/tools/midi2cfg-ng.conf b/misc/tools/midi2cfg-ng.conf index d534763d3..21625dee2 100644 --- a/misc/tools/midi2cfg-ng.conf +++ b/misc/tools/midi2cfg-ng.conf @@ -4,8 +4,8 @@ bot tuba cmd barrier cmd selectweapon 16 cmd wait 0.5 - raw g_balance_tuba_attenuation 0.1 - raw g_balance_tuba_damage 0 + cmd console "g_balance_tuba_attenuation 0.1" + cmd console "g_balance_tuba_damage 0" note on -18 time -0.05 buttons left backward crouch @@ -446,6 +446,7 @@ bot crylink bot jetpack init cmd barrier + cmd console "g_jetpack_attenuation 0.5" percussion 42 time 0 buttons hook @@ -478,7 +479,7 @@ bot hagar cmd barrier cmd selectweapon 8 cmd wait 0.5 - raw g_balance_hagar_primary_lifetime 0.1 + cmd console "g_balance_hagar_primary_lifetime 0.1" percussion 35 time 0 buttons attack1 @@ -502,7 +503,7 @@ bot tag cmd barrier cmd selectweapon 14 cmd wait 0.5 - raw g_balance_seeker_tag_lifetime 0.1 + cmd console "g_balance_seeker_tag_lifetime 0.1" percussion 36 time 0 buttons attack1 @@ -522,7 +523,7 @@ bot laser cmd barrier cmd selectweapon 1 cmd wait 0.5 - raw g_balance_laser_primary_lifetime 0.2 + cmd console "g_balance_laser_primary_lifetime 0.2" percussion 39 time 0 buttons attack1 diff --git a/misc/tools/midi2cfg-ng.pl b/misc/tools/midi2cfg-ng.pl index d82638475..c3da444a0 100755 --- a/misc/tools/midi2cfg-ng.pl +++ b/misc/tools/midi2cfg-ng.pl @@ -226,7 +226,7 @@ sub busybot_cmd_bot_execute($$@) { if($_->[0] eq 'time') { - printf "w %d %f\n", $bot->{id}, $time + $_->[1]; + printf "sv_cmd bot_cmd %d wait_until %f\n", $bot->{id}, $time + $_->[1]; $bot->{timer} = $time + $_->[1]; } elsif($_->[0] eq 'busy') @@ -243,14 +243,14 @@ sub busybot_cmd_bot_execute($$@) } for(keys %buttons_release) { - printf "r %d %s\n", $bot->{id}, $_; + printf "sv_cmd bot_cmd %d releasekey %s\n", $bot->{id}, $_; delete $bot->{buttons}->{$_}; } for(@{$_}[1..@$_-1]) { /(.*)(\?)?/ or next; defined $2 and next; - printf "p %d %s\n", $bot->{id}, $_; + printf "sv_cmd bot_cmd %d presskey %s\n", $bot->{id}, $_; $bot->{buttons}->{$_} = 1; } } @@ -305,7 +305,7 @@ sub busybot_note_on_bot($$$$$) { return 0 if not busybot_cmd_bot_test $bot, $time + $notetime, @$cmds; - busybot_cmd_bot_execute $bot, 0, ['wait', $timeoffset]; + busybot_cmd_bot_execute $bot, 0, ['cmd', 'wait', $timeoffset]; busybot_cmd_bot_execute $bot, 0, ['cmd', 'barrier']; busybot_cmd_bot_execute $bot, 0, @{$bot->{init}} if @{$bot->{init}}; @@ -397,11 +397,6 @@ sub busybot_note_on($$$) return 0; } -print 'alias p "sv_cmd bot_cmd $1 presskey $2"' . "\n"; -print 'alias r "sv_cmd bot_cmd $1 releasekey $2"' . "\n"; -print 'alias w "sv_cmd bot_cmd $1 wait_until $2"' . "\n"; -print 'alias m "sv_cmd bot_cmd $1 moveto \"$2 $3 $4\""' . "\n"; - for(@preallocate) { die "Cannot preallocate any more $_ bots" @@ -409,7 +404,7 @@ for(@preallocate) my $bot = Storable::dclone $busybots->{$_}; $bot->{id} = @busybots_allocated + 1; $bot->{classname} = $_; - busybot_cmd_bot_execute $bot, 0, ['wait', $timeoffset]; + busybot_cmd_bot_execute $bot, 0, ['cmd', 'wait', $timeoffset]; busybot_cmd_bot_execute $bot, 0, ['cmd', 'barrier']; busybot_cmd_bot_execute $bot, 0, @{$bot->{init}} if @{$bot->{init}}; @@ -458,14 +453,14 @@ for(@allmidievents) for(@busybots_allocated) { - busybot_cmd_bot_execute $_, 0, ['wait', $timeoffset3]; + busybot_cmd_bot_execute $_, 0, ['cmd', 'wait', $timeoffset3]; busybot_cmd_bot_execute $_, 0, ['cmd', 'barrier']; if($_->{done}) { - busybot_cmd_bot_execute $_, @{$_->{done}}; + busybot_cmd_bot_execute $_, 0, @{$_->{done}}; } busybot_cmd_bot_execute $_, 0, ['cmd', 'barrier']; - busybot_cmd_bot_execute $_, 0, ['wait', $timeoffset4]; + busybot_cmd_bot_execute $_, 0, ['cmd', 'wait', $timeoffset4]; } print STDERR "Range of notes: $note_min .. $note_max\n"; -- 2.39.2