Multiplayer assassinate script

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
MC Disgruntled Goat
Lance Corporal
Posts: 22
Joined: Mon Sep 02, 2002 9:58 pm

Multiplayer assassinate script

Post 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
MC Disgruntled Goat
Lance Corporal
Posts: 22
Joined: Mon Sep 02, 2002 9:58 pm

Post 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
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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
hope this helps, prob not cos it's all foreign 2 me :-/
MC Disgruntled Goat
Lance Corporal
Posts: 22
Joined: Mon Sep 02, 2002 9:58 pm

Post 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
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

no probs ;)

another satisfied customer :D

tarriffs and charges will be in the post :P
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

if(IsAlive $leader)
$leader waittill death
teamwin allies

better
Live to map, not map to live.
-mohaa_rox, .map
moderator
Wilson
Warrant Officer
Posts: 131
Joined: Fri Mar 07, 2003 6:12 pm

Post 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
Shifty
Map Reviewer
Posts: 717
Joined: Sun Dec 15, 2002 11:53 pm
Location: UK
Contact:

Post 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
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer
Image
http://www.shiftys-bunker.tk Under Construction
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Use a pathnode instead of waypoint. AI use pathnodes, not waypoints.
Live to map, not map to live.
-mohaa_rox, .map
moderator
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

lol, of course, oops

derrrr.... :roll:
hope this helps, prob not cos it's all foreign 2 me :-/
_Snake_
Sergeant
Posts: 52
Joined: Mon Mar 03, 2003 12:22 pm
Location: Canada
Contact:

Post 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 :)
:D
MC Disgruntled Goat
Lance Corporal
Posts: 22
Joined: Mon Sep 02, 2002 9:58 pm

Post 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?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

if/while

Post 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
Tom Trude,

Image
Post Reply