Page 1 of 1

assasination script in MP

Posted: Tue Jan 14, 2003 1:13 pm
by Gizzy (nl)
I am trying to combine a random spawn script with the assassination script in a MP map. I did add the following script to my mymap.scr

Code: Select all

spawn_random_leader local.num: 
// find a spawnpoint 
local.spawnpoints = $("spawn" + local.num) 
// local.spawnpoints is now the list of available spawnpoints 
// find a random index 
local.index = randomint (local.spawnpoints.size - 1) + 1 
// randomint <max> returns a number between o and max 
// so randomint <size - 1> returns a number between o and 
// the number of spawnpoints - 1 
// after +1 local.index is a number between 1 and 
//the number of spawnpoints. 
local.spawnpoint = local.spawnpoints[local.index] 
// ordinary spawn code here, e.g. 
local.enemy = spawn models/human/allied_misc_manon.tik 
local.enemy.origin = local.spawnpoint.origin 
local.enemy.angles = local.spawnpoint.angles 
local.enemy.targetname = "leader" 
local.enemy.health = 200
thread target
end

Code: Select all

target:
If(IsAlive $leader)
$leader waittill death // if the leader is killed, then the mission will complete
thread theend
end

Code: Select all

theend:
iprintIn "The resistance leader has been killed. Mission completed!"
 waitframe
 teamwin axis
end
The manon (a request from JV_map :lol: ) is spawned randomly in the map (that is : at several places in the map are script_origin 's with targetname= spawn1) That part is working fine. But whenever I add the SECOND CODE (target) the manon won't spawn anymore...

What am I doing wrong?

Re: assasination script in MP

Posted: Tue Jan 14, 2003 1:26 pm
by mohaa_rox
[quote="Gizzy (nl)"]

Code: Select all

target:
If (IsAlive $leader)
$leader waittill death // if the leader is killed, then the mission will complete
thread theend
end
Ah hah! You see the If (IsAlive $leader)? The "if" must be in small letters. So

if (IsAlive $leader)
.......

Then it will work.

Posted: Tue Jan 14, 2003 2:03 pm
by Gizzy (nl)
ahhhh, you're kidding me...????? I tried and I tried..I searched on the internet...almost cried out loud..and started to think I could only make a bombing objective again...i instead of I...aja aja ajaa aj... :shock:

I could kiss you if this works... :lol: Thanx for your fast response..

Posted: Tue Jan 14, 2003 2:10 pm
by jv_map
Maybe you should check your console for errors if you have a problem.

I'm sure this one would've shown up.

Posted: Tue Jan 14, 2003 2:19 pm
by mohaa_rox
That's how I managed to furnish up my assassination tut. Checked the console. "If" was an unknown command. So I tried "if" and it worked.

Posted: Tue Jan 14, 2003 3:19 pm
by Gizzy (nl)
ok, i am convInced, next tIme i wIll check my console fIrst... 8) :lol:

Posted: Tue Jan 28, 2003 8:00 am
by Gizzy (nl)
well, just around to say now it works... 8) together with the random spawn script...

Posted: Tue Jan 28, 2003 8:26 am
by mohaa_rox
Gizzy (nl) wrote:I could kiss you if this works... :lol: Thanx for your fast response..
Come on! I'm ready!

Posted: Tue Jan 28, 2003 6:36 pm
by Gizzy (nl)
smak smak.... shall I write a tutorial on this one ?

Posted: Tue Jan 28, 2003 6:46 pm
by jv_map
I think we already have a tutorial about this subject :roll:

Posted: Wed Jan 29, 2003 12:47 pm
by Gizzy (nl)
yes, its a SP tut...

For Mp it doesn't work if you do it this way...

Posted: Thu Jan 30, 2003 9:45 pm
by panTera
sounds interesting to have an assassination objective;). One question though, what happens if one of the players of the defending team decides to spoil the fun and starts shooting at their own leader?

Posted: Fri Jan 31, 2003 5:15 am
by mohaa_rox
Maybe someone great will come up with that. Every played CS? You know the as_tundra or as_highrise, someone gets to be the VIP. Maybe a MOD can make this, with a classname "VIP" and the enemy will win when the VIP is killed.

Posted: Sat Feb 01, 2003 9:41 am
by Gizzy (nl)
pantera wrote:sounds interesting to have an assassination objective;). One question though, what happens if one of the players of the defending team decides to spoil the fun and starts shooting at their own leader?
then the other team wins...I already tested this...everyone can shoot the leader...but setting the health a little higher (1000) it will prevent teammates killing their leader by accident... This script together with the random spawnscript makes it much more difficult for the team who has to kill the leader...

Posted: Sat Feb 01, 2003 12:36 pm
by mohaa_rox
That would be cool! Like CS, maybe someone can make some classname of VIP and make random selections of the leader. Then the denfending team will have to escort the VIP to the other side while the enemy has to kill him, probably like crossroads with snipers everywhere. Cool.