Page 1 of 1

Multiplayer assassinate script

Posted: Thu Apr 17, 2003 9:52 pm
by MC Disgruntled Goat
Hey guys,

I am almost finished a multiplayer map where the Allied object is to kill an Axis officer. When I load the map, I can kill the officer but the map does not finish. In the console I am getting a Null listener error on the waittill death line. Here is part of the script, what am I missing? My bot model has a targetname of $leader. Thanks a lot for any help, Goat
main:

exec global/ai.scr

level waittill prespawn
level waittill spawn

level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 1
level.dmrespawning = 1
level.dmroundlimit = 15
level.clockside = axis

thread axis_win_timer
thread leader

end

leader:

$leader waittill death
thread allies_win_kill


allies_win_kill:

if(isalive $leader)
{
if(isalive $leader)
teamwin allies
}
else
waitframe

end

axis_win_timer:

level waittill axiswin
end

Posted: Thu Apr 17, 2003 10:13 pm
by MC Disgruntled Goat
K, got rid of the Null listener error but the map still will not finish after the officer is killed. Thanks, Goat

Posted: Thu Apr 17, 2003 10:20 pm
by nuggets
put an end at the end of the leader thread :D if not post back

and also put in your script
iprintlnbold_noloc "is he dead" //after the $leader waittill death line just to see if it's reading the script

and remove the second if (isalive $leader), u only need the 1st

Posted: Thu Apr 17, 2003 10:40 pm
by MC Disgruntled Goat
Thanks Nuggets!!!! I did the changes you suggested. It printed the 'is he dead' but still didn't finish. I then took out the whole 'isalive $leader 'section and just had teamwin allies for that section and now it works. Much oblige, Goat

Posted: Thu Apr 17, 2003 11:14 pm
by nuggets
no probs ;)

another satisfied customer :D

tarriffs and charges will be in the post :P

Posted: Fri Apr 18, 2003 4:09 am
by mohaa_rox
if(IsAlive $leader)
$leader waittill death
teamwin allies

better

Posted: Fri Apr 18, 2003 10:24 am
by Wilson
Ask Parts as him and Sparx have already done this by making Angryfields into and Objective although the Colonel is stupid and doesnt shoot at ya jus throws nades lol thats all i have seen him do anyway it still makes the map more exciting

Posted: Sun Apr 20, 2003 3:28 pm
by Shifty
I got that objective in my war in a hall map aswell hopefully i wanna get the guy to at least run off if he's attacked - i've made a mock up escape route which will be inaccessable (lol did i spell that right) but 1st i've got to figure out makin him run off

Posted: Mon Apr 21, 2003 2:07 am
by nuggets
$chappys_name exec global/disable_ai.scr //chappy's name to be defined
$chappys_name runto $wp1 //and again and place a waypoint in there to move to called wp1

Posted: Mon Apr 21, 2003 7:14 am
by mohaa_rox
Use a pathnode instead of waypoint. AI use pathnodes, not waypoints.

Posted: Mon Apr 21, 2003 11:30 pm
by nuggets
lol, of course, oops

derrrr.... :roll:

Posted: Tue Apr 22, 2003 11:18 am
by _Snake_
Hey Goat, if it's not to much to ask, do you think I can borrow your script for my map? If you don't want to send it out... that's fine. I just think that it would go great with my map :)

Posted: Wed Apr 23, 2003 6:56 pm
by MC Disgruntled Goat
Sure man, it is on it's way. I will only include the assassinate part as the script is huge. It also has elevators, gondolas, trucks, stuff that you don't need. Cool?

if/while

Posted: Wed Apr 23, 2003 7:14 pm
by tltrude
An "if" statment only runs once, so the waitframe stopped the game from ending. You should of made it a "while" statment so it would keep checking to see if the officer was alive.

You can also use:

level.targets_destroyed ++

to add one to the number targets destroyed.

while(level.targets_destroyed < level.targets_to_destroy)
waitframe