Assassination gametype script

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Assassination gametype script

Post 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
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
Mj
Map Reviewer
Posts: 1394
Joined: Sun Apr 25, 2004 3:36 pm
Location: England

Post 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:
ImageImage
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post 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
An ambiguous question will get a similar answer...
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

so how can you determine whos the VIP?,the first one to pic the skin?
how is this determined?
Image
mefy
Corporal
Posts: 33
Joined: Tue Oct 21, 2003 2:57 am

Post 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:
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post 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/-------------------------
An ambiguous question will get a similar answer...
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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>
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
mefy
Corporal
Posts: 33
Joined: Tue Oct 21, 2003 2:57 am

Post 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
New Gametypes for Medal of Honor
Capture-The-Flag | Freeze-Tag | Demolition
www.planetmedalofhonor.com/mefy
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Wow! That's great! :)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply