Multiplayer assassinate script
Moderator: Moderators
-
MC Disgruntled Goat
- Lance Corporal
- Posts: 22
- Joined: Mon Sep 02, 2002 9:58 pm
Multiplayer assassinate script
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
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
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
put an end at the end of the leader thread
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
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
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

http://www.shiftys-bunker.tk Under Construction
.Map Reviewer

http://www.shiftys-bunker.tk Under Construction
-
MC Disgruntled Goat
- Lance Corporal
- Posts: 22
- Joined: Mon Sep 02, 2002 9:58 pm
if/while
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
You can also use:
level.targets_destroyed ++
to add one to the number targets destroyed.
while(level.targets_destroyed < level.targets_to_destroy)
waitframe
