Page 1 of 1

Assassination gametype script

Posted: Sun Feb 27, 2005 10:03 am
by Rookie One.pl
Hi,

I've written the assassination script for Mj and I thought it might be useful for other people too, so I decided to post it. :)

You can download it here. :)

A sample modified version of Aligers is included. Basically you just need a trigger_multiple (or more than one - any number will work :P) with the targetname of $vip_extraction_point and set a few variables in your map script.

Enjoy! ;)

Rookie One

Posted: Sun Feb 27, 2005 3:05 pm
by Mj
:D Many thanks to the man :D

I'll check it out later, thanks a lot, i've been waiting ages for this after the AlienX incident :wink:

Posted: Sun Feb 27, 2005 10:14 pm
by Grassy
:shock: Well done mate! I like it. Also like the fact that you can define what player model to use, this makes it usefull for all sorts of fun things to do for eg; protect the player carrying the beer barrel, or protect Santa so he can make his deliveries etc .... LOL :D Sorry my twisted mind is rampant this morning... Nice work mate, the boys in my clan will like a map or two runningn under this mode I'm sure.
Speaking of modes, how do you define the gametype, I mean I know how to define obj, tow etc etc.. I'm talking about the gametype displayed in All Seeing Eye, I have seen some displayed as Training, Freeztag etc etc.. Is that just a cvar setting?
Grassy

Posted: Mon Feb 28, 2005 3:45 am
by Green Beret
so how can you determine whos the VIP?,the first one to pic the skin?
how is this determined?

Posted: Mon Feb 28, 2005 7:44 am
by mefy
Grassy wrote:Speaking of modes, how do you define the gametype, I mean I know how to define obj, tow etc etc.. I'm talking about the gametype displayed in All Seeing Eye, I have seen some displayed as Training, Freeztag etc etc.. Is that just a cvar setting?
Grassy
Just set "g_gametypestring" to "Assassination" :wink:

Posted: Mon Feb 28, 2005 12:04 pm
by Grassy
Cool thanks Mefy, u da man! 8-)

Er Rookie,
I have tried to get your script working in SH using banhof as a baase map, I have done it in roundbased mode and set the gametype to obj. All starts to work ok until it gets to this part of your script. I added some println's to get an idea on what values it was generating.
else
{
//if (level.as_debug != 1)
level waittill roundstart
local.num = 1
for (local.i = 1; local.i <= $player.size; local.i++)
{
$player[local.i].isthevip = NIL
if ($player[local.i].dmteam == level.as_vipteam)
{
local.vipteamplayers[local.num] = $player[local.i]
local.num++
}
}
local.randnum = randomint(local.vipteamplayers.size) + 1
local.vipteamplayers[local.randnum] thread vip_control
for (local.i = 1; local.i <= $vip_extraction_point.size; local.i++)
$vip_extraction_point[local.i] thread vip_extraction_control

println "------------------------/zz/-------------------------"
println "local.randnum = " local.randnum
println "local.vipteamplayers.size = " local.vipteamplayers.size
println "$vip_extraction_point.size = " $vip_extraction_point.size
println "------------------------/zz/-------------------------"

}
The error in the log is this; Note the value of local.vipteamplayers.size :?
Loading Ambient.scr
[ASSASSINATION]: Initializing assassination script v0.2 (27.02.2005)...
[ASSASSINATION]: VIP team is allies.
[ASSASSINATION]: VIP player model: models/player/allied_SAS.tik
local.vipteamplayers[local.randnum] thread vip_control (global/assassination.scr, 83)
local.vipteamplayers[local.randnum] ^

^~^~^ Script Error: command 'thread' applied to NIL

------------------------/zz/-------------------------
local.randnum = 1
local.vipteamplayers.size = -1
$vip_extraction_point.size = 1
------------------------/zz/-------------------------

Posted: Mon Feb 28, 2005 1:08 pm
by Rookie One.pl
That's what happens if there are no players on the VIP team and you are using level.as_debug = 1 or comment out level waittill roundstart. ;) If you're alone, join the VIP team, pick a weapon and do a restart.

@Green Beret: the VIP is picked randomly from the VIP team players.

<EDIT>I've just noticed the vipteamplayers.size value. I have no idea what happens! :? It's just impossible... The initial value is 1 and then it can only be increased! If it's OK with you, could you post the whole script? And make sure that you did not comment level waittill spawn!</EDIT>

Posted: Wed May 18, 2005 11:56 pm
by mefy
Rookie One:
I've converted your Assassination gametype into an addon for my Extended-Gametypes MOD. What you do is install the addon pk3 onto the server along with version 1.2.2 of my mod and then set "g_extgametype" to "as" to start Assassination mode. It's set up for all of the dm maps except mohdm5 (Posse set it up for dm1, 2, 3, 4, & 6).

I've posted it here:
http://mefymods.clan-dwr.com/viewtopic.php?t=343

I've also written a tutorial on how to create an addon gametype (which uses the Assassination addon as an example) here:
http://mefymods.clan-dwr.com/viewtopic.php?t=344

Posted: Thu May 19, 2005 11:52 am
by Rookie One.pl
Wow! That's great! :)